Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Project->Build Options sets incorrect Build target
vid512:
Just tested and got the bug (both wrong Build Options and hanged debugging) on following project. Sorry, the project is a bit hacked together from what I got from the projecty wizard, but it exhibits the bug.
tempproj.cbp:
--- Code: ---<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="tempproj" />
<Option pch_mode="2" />
<Option compiler="msvc10" />
<Build>
<Target title="lin-dbg">
<Option platforms="Unix;" />
<Option output="bin/Debug/tempproj" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="/Zi" />
<Add option="/D_DEBUG" />
<Add option="/MDd" />
</Compiler>
<Linker>
<Add option="/DEBUG" />
<Add library="msvcrtd.lib" />
<Add library="msvcprtd.lib" />
</Linker>
</Target>
<Target title="lin-rel">
<Option platforms="Unix;" />
<Option output="bin/Release/tempproj" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="/Ox" />
<Add option="/DNDEBUG" />
<Add option="/MD" />
</Compiler>
<Linker>
<Add library="msvcrt.lib" />
<Add library="msvcprt.lib" />
</Linker>
</Target>
<Target title="win-dbg">
<Option output="tempproj" prefix_auto="1" extension_auto="1" />
<Option type="1" />
<Option compiler="msvc10" />
<Option use_console_runner="0" />
</Target>
<Target title="win-rel">
<Option platforms="Windows;" />
<Option output="tempproj" prefix_auto="1" extension_auto="1" />
<Option type="1" />
<Option compiler="msvc10" />
<Option use_console_runner="0" />
</Target>
</Build>
<Compiler>
<Add option="/W3" />
<Add option="/EHsc" />
</Compiler>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
--- End code ---
main.cpp
--- Code: ---#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
--- End code ---
White-Tiger:
even though it's not directly related to your problem... I still want to comment on this "Target Platform" stuff :P
I prefer to either set "Target Platform" always to "All" or use different project files per target...
Reason is that selecting a platform kills usability. I cannot edit other platform targets (such as increasing or lowering the optimization limit globally, or static linking, libs etc.)
Nor can I use it for cross compilation... as when I want to cross compile for GNU/Linux, I have to set the target to "Windows" as I'm otherwise unable to use my cross compiler on Windows... (and this splits the project file, as my GNU/Linux target can either compile on Windows or GNU/Linux, but not on both, without setting it to "All" even though it's actually meant to be for GNU/Linux)
Code::Blocks would be perfect if it had a way to custom some project stuff without actually changing the project file :P That might improve Subversion use a bit... (eg. interpret used compiler different per project basis without actually changing it within the project file)
vid512:
I agree there are cases when that feature is of no use. But in simple cases like mine (build windows version on windows, build linux version on linux) it is a good thing to have.
Navigation
[0] Message Index
[*] Previous page
Go to full version