views:

4236

answers:

4

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.

P.S. 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?

A: 

Sure! Edit code in NetBeans, compile it in Visual Studio, or via command line. ;-) The MS compiler/linker parameters are displayed in the project properties; you can copy from there.

Ivan Krechetov
A: 

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.

Amit Kumar
+1  A: 

To be honest, I always do my spare time coding inside an ide (e.g. 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?).

phresnel
A: 

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.

Spacen Jasset