I would like to set up a gcc C++ project using my preferred editro NetBeans (since it works with gcc), that would depend on some external libraries. I want it to compile in NetBeans with gcc chain, and in production - using command line make under linux. Preferably, first create project in NetBeans and then modify something to accept it in Linux.
The libraries will be the same but located in different folders, so I need to separate include pathes for these, and during compile time correct pathes must be picked.
Also, I might need to use minor amount of conditional compilation, as under windows and linux some #include directives might or might not contain library sub-pathes.
Is there any useful guide how to make this happen?
Assuming you are developping with Netbeans on Win7 and you have a Linux machine (lets call it a server) accessible by TCP/IP with all packages proprely installed (gcc and you program depedencies).
You need to:
ssh
connection (you server needs deamon sshd
active of course). Netbeans will seek for a toolchain. If everything worked out: this is your remote build host;/usr/include
and libraries in /usr/lib
;Then, when compiling for Win7 target use default profiles Netbeans created for you (build host is localhost) and when compiling for Linux target use new profiles you created (build host is your linux server).
To minimize conditional pre-porcessor codes when including, you just need to use relative paths and keep on Win7 the same file hierarchy for your dependencies that your linux server has.
Additionnaly, you can run on linux server development tools such has gprof
and valgrind
to check your work.
This should work easily.