简体   繁体   中英

How to use Microsoft C++ compiler with NetBeans?

I was wondering whether it's possible to use Microsoft's C++ compiler and linker with NetBeans IDE? If so, what's the best way of doing it.

PS I'm not interested in Mingw.

EDIT: Is it possible to get NetBeans to do error parsing (so that I can click on error and have NetBeans open the right file), intellisense, etc? I know NetBeans can work with g++ make files. Why not with nmake?

I am currently writing a plugin/toolchain to use Visual C++ on Netbeans.
You can find the project called VCC4N on source forge or on NetBeans plugins .

To be honest, I always do my spare time coding inside an ide (eg code::blocks, monodevelop, anjuta) or an editor (virtually always scite), and the compiling I do in a terminal via a makefile (handwritten, cmake, automake).

This isn't really a problem w.r.t. time to compile: F7 (or some other of the F keys) vs. (alt+tab, up, enter), where (alt+tab) and (up) are pressed nearly at the same time, but I get the great benefit of having up to full screen compiler reports, and often I am anyways testing my programs in a terminal. Also, it makes my code more independent of the IDE (ever tried to get a makefile from code::blocks for distribution purposes?).

You can get syntax highlighting, code graphing etc from netbeans without having a compiler installed I think (not certain, you may need cygwin or mingw for parsing). What you must do is create at least an empty makefile. If you want to use Microsoft's compiler then you either need to:

a) Write the makefile yourself to compile eveything using cl b) Call on msdev from the makefile with the project name and it will compile everything b) Call something like scons from the makefile to compile everything

I use netbeans to develop cross platform software, at this time though, I don't actually run the builds from netbeans.

The visual studio compiler is called cl.exe and the linker is link.exe. These are present in particular visual studio directories. From inside visual studio > project properties > C++ > Command Line, or by disabling "Suppress Banner" option there, you can find the command that visual studio runs. You can call these command lines from inside netbeans.

Getting all the file names into the list to compile may be more tricky. You need a build system for this. You can try to use the same mechanism that visual studio uses, but sorry my knowledge fails there. Alternatively, you can use CMake or some other build system. Then, whenever you add/delete a source file, you would have to update the CMakelist.txt to be able to compile.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM