Hello p2rkw,
Thanks for your tip !
I tried it and the result is interesting but kinda puzzling for me :
I placed a
system("cd"); at the beginning of the main function and another at the end.
In both case (run or debugging), the first gives the correct result : Parent/ProjectName/bin
But the second
system("cd");, run at the end, gives "Parent/ProjectName/bin" when I run the program but "Parent" when I debug it.
In other words, when I run it, everything is ok, but when I debug it, the first is ok, the second is wrong.
Maybe it is a problem in the code I use, though, I can't see how the behavior can differ from runing with debugging. I though it was the very same assembly ?
Here is the build log :
-------------- Build: Debug in ProjectName ---------------
Compiling: src\ProjectTest.cpp
lib\orx-1.3rc0\include/utils/orxString.h:276:41: warning: 'orxU32 orxString_PrintUTF8Character(orxCHAR*, orxU32, orxU32)' defined but not used [-Wunused-function]
lib\orx-1.3rc0\include/display/orxDisplay.h:391:35: warning: 'orxCOLOR* orxColor_FromRGBToHSL(orxCOLOR*, const orxCOLOR*)' defined but not used [-Wunused-function]
lib\orx-1.3rc0\include/display/orxDisplay.h:468:35: warning: 'orxCOLOR* orxColor_FromHSLToRGB(orxCOLOR*, const orxCOLOR*)' defined but not used [-Wunused-function]
lib\orx-1.3rc0\include/display/orxDisplay.h:562:35: warning: 'orxCOLOR* orxColor_FromRGBToHSV(orxCOLOR*, const orxCOLOR*)' defined but not used [-Wunused-function]
lib\orx-1.3rc0\include/display/orxDisplay.h:637:35: warning: 'orxCOLOR* orxColor_FromHSVToRGB(orxCOLOR*, const orxCOLOR*)' defined but not used [-Wunused-function]
Compiling: main.cpp
lib\orx-1.3rc0\include/utils/orxString.h:276:41: warning: 'orxU32 orxString_PrintUTF8Character(orxCHAR*, orxU32, orxU32)' defined but not used [-Wunused-function]
lib\orx-1.3rc0\include/display/orxDisplay.h:391:35: warning: 'orxCOLOR* orxColor_FromRGBToHSL(orxCOLOR*, const orxCOLOR*)' defined but not used [-Wunused-function]
lib\orx-1.3rc0\include/display/orxDisplay.h:468:35: warning: 'orxCOLOR* orxColor_FromHSLToRGB(orxCOLOR*, const orxCOLOR*)' defined but not used [-Wunused-function]
lib\orx-1.3rc0\include/display/orxDisplay.h:562:35: warning: 'orxCOLOR* orxColor_FromRGBToHSV(orxCOLOR*, const orxCOLOR*)' defined but not used [-Wunused-function]
lib\orx-1.3rc0\include/display/orxDisplay.h:637:35: warning: 'orxCOLOR* orxColor_FromHSVToRGB(orxCOLOR*, const orxCOLOR*)' defined but not used [-Wunused-function]
Linking console executable: bin\ProjectNameD.exe
Output size is 5.24 MB
Process terminated with status 0 (0 minutes, 7 seconds)
0 errors, 10 warnings
Well, my path kinda look like people waving both arms \o/ and the compiler seems to be a little too careful regarding libraries (yes, some functions are declared but not used, easy compiler, easy, it's gonna be okay), but nothing too bad I think.
The project config file :
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="ProjectName" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin\ProjectNameD" prefix_auto="1" extension_auto="1" />
<Option working_dir="bin" />
<Option object_output="obj\Debug\" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
<Add option="-D__orxDEBUG__" />
</Compiler>
<Linker>
<Add library="lib\orx-1.3rc0\lib\static\liborxed.a" />
<Add library="lib\extern\SOIL\lib\mingw\libSOIL.a" />
<Add library="lib\extern\openal-soft\lib\mingw\libopenal32.a" />
<Add library="lib\extern\freetype-2.4.1\lib\mingw\libfreetype.a" />
<Add library="lib\extern\libsndfile-1.0.22\lib\mingw\libsndfile.a" />
<Add library="lib\extern\SDL-1.2.14\lib\mingw\libSDL.a" />
<Add library="lib\extern\Box2D_2.1.3\lib\mingw\libbox2dd.a" />
<Add library="lib\extern\glfw-2.7\lib\win32\libglfw.a" />
<Add library="lib\extern\SFML-1.5\lib\mingw\libsfml-system-d.a" />
<Add library="lib\extern\SFML-1.5\lib\mingw\libsfml-audio-d.a" />
<Add library="lib\extern\SFML-1.5\lib\mingw\libsfml-graphics-d.a" />
<Add library="lib\extern\SFML-1.5\lib\mingw\libsfml-network-d.a" />
<Add library="lib\extern\SFML-1.5\lib\mingw\libsfml-window-d.a" />
<Add library="OpenGL32" />
</Linker>
</Target>
<Target title="Release">
<Option output="bin\ProjectName" prefix_auto="1" extension_auto="1" />
<Option working_dir="bin" />
<Option object_output="obj\Release\" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
<Add library="lib\orx-1.3rc0\lib\static\liborxe.a" />
<Add library="lib\extern\SOIL\lib\mingw\libSOIL.a" />
<Add library="lib\extern\openal-soft\lib\mingw\libopenal32.a" />
<Add library="lib\extern\freetype-2.4.1\lib\mingw\libfreetype.a" />
<Add library="lib\extern\libsndfile-1.0.22\lib\mingw\libsndfile.a" />
<Add library="lib\extern\SDL-1.2.14\lib\mingw\libSDL.a" />
<Add library="lib\extern\Box2D_2.1.3\lib\mingw\libbox2d.a" />
<Add library="lib\extern\glfw-2.7\lib\win32\libglfw.a" />
<Add library="lib\extern\SFML-1.5\lib\mingw\libsfml-system.a" />
<Add library="lib\extern\SFML-1.5\lib\mingw\libsfml-audio.a" />
<Add library="lib\extern\SFML-1.5\lib\mingw\libsfml-graphics.a" />
<Add library="lib\extern\SFML-1.5\lib\mingw\libsfml-network.a" />
<Add library="lib\extern\SFML-1.5\lib\mingw\libsfml-window.a" />
<Add library="OpenGL32" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
<Add option="-static-libgcc" />
<Add option="-D__orxSTATIC__" />
<Add directory="include" />
<Add directory="lib\orx-1.3rc0\include" />
</Compiler>
<Linker>
<Add directory="lib\orx-1.3rc0\dev-mingw\bin" />
</Linker>
<Unit filename="include\ProjectTest.h" />
<Unit filename="main.cpp" />
<Unit filename="src\ProjectTest.cpp" />
<Extensions>
<code_completion />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>