Code::Blocks Forums
User forums => General (but related to Code::Blocks) => Topic started by: new-c::b-user on September 14, 2007, 01:08:03 pm
-
Hi everybody,
i'm quite new to codeblocks and i installed codeblocks (nightly) on windows without any problems. I also installed it on Ubuntu 7.04 successfully. I created a new wxwidget project under windows and this runs fine there. Now i wanted to use this project in linux too and setted up a svn for this.
But the project won't compile because of '-mthreads' is a typical MinGW option :-)
So my question is: What must i do to have a real cross OS project?
The next question is how to handle the compiler and linker options?
In Windows i linked against C:\Programme\wxWidgets-2.8.4\lib\gcc_dll\libwxmsw28u.a
And how to handle the windows resource? Ok maybe this can be handled via wxresources ...
I searched the forum and wiki, but found nothing about it.
Can anybody give me some hints about this topic?
TIA
-
Hi,
one solution is to have to build targets for windows and linux, or you may attach a script to a build target and test the operating system to switch between different settings.
-
i'm quite new to codeblocks and i installed codeblocks (nightly) on windows without any problems. I also installed it on Ubuntu 7.04 successfully. I created a new wxwidget project under windows and this runs fine there. Now i wanted to use this project in linux too and setted up a svn for this.
Create a blank wxWidgets project on Linux. Then add your sources to the project. You'll need to maintain two project files for your project. You can't use your Windows project file on Linux.
-
There's no problem to use the same code and project files if you leave the OS specific settings under Build options ...empty.
You only have to use the same compiler(-name) under linux and windows and set the directories executables and so on under Settings -> Compiler and debugger.
If you need project specific settings you don't want to use for your any of the standard compilers you can create a special compiler there.
I tried it and it works fine. At least for me. It even works if change the OS and build without cleaning.
Of course you can also cross-compile and build win-executables under linux without the need to change to Win :D.
-
Hi,
you may use something like that in the linker options or pre/postbuild steps:
[[ if (PLATFORM == PLATFORM_MSW) { print (_T("cmd /c")); } else { print (_T("sh ")); } ]] <command>
-
Thanks for your ideas. I will try them. I thought Codeblocks has some automatic way for this, and i didn't see it.
BTW: BIG thx to the devteam, great work!!
-
There's no problem to use the same code and project files if you leave the OS specific settings under Build options ...empty.
You only have to use the same compiler(-name) under linux and windows and set the directories executables and so on under Settings -> Compiler and debugger.
You do not have to use the same compiler under linux and windows. I am sharing project files and source files 100% transparently between XP and Kubuntu and I am using Visual Studio 2005 Express C++ compiler under Windows and GCC under linux. This can be done using 4 build targets, i.e. Debug/Release for windows and Debug/Release for linux.
cacb