User forums > Help
Newbie needing help with flags
art-ganseforth:
Hello everyone,
i think i have to ask here after searching a solution for two days now and after posting my problem in two other forums...
I try to migrate my project from devC++ to Code::Blocks (which i installed first time). But i'm not common with all this compiler-settings (always used presets, triel and error etc.). So a part of my problem might be more basic then a specific Code::Blocks-question.
Enviornment: Win10 (64bit) notebook, Code::Blocks 17.12 (portable), MingW32, wxWidgets 3.1.2, several openGL-libraries
I have two projects (one of them is just for testing). Both use the same libraries and (as far as i can see) the same compiler- & linker-settings. In fact i used no project- & file-specific setting. For the moment everything is set in the global compiler-settings-page. The problem is that one of the programs is compiled to a single exe-file but the other one to a dll-based exe and i've now idea why.
Maybe someone can give me a hint, where and how this is specified.
Best,
Frank
stahta01:
I am guessing you need to look under project properties.
Project -> Properties
Tab: Build Targets
Pull down menu set to correct value: Type
Tim S.
art-ganseforth:
For both projects, this ist set to "GUI application".
By the way: here are the .cbp-files...
Test-project (producing monolithic exe):
--- Code: ---<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="test" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Release">
<Option output="bin/Release_x86/test" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release_x86/" />
<Option type="0" />
<Option compiler="gcc" />
<Option projectCompilerOptionsRelation="0" />
<Option projectLinkerOptionsRelation="0" />
<Compiler>
<Add option="-fomit-frame-pointer" />
<Add option="-O3" />
<Add option="-D__WXMSW__" />
<Add option="-D__GNUWIN32__" />
<Add option="-D_UNICODE" />
<Add directory="../../../wxWidgets-3.1.2/lib/gcc730_dll/mswu" />
<Add directory="../../../wxWidgets-3.1.2/include" />
</Compiler>
<Linker>
<Add option="-s" />
<Add library="../../../wxWidgets-3.1.2/lib/gcc730_dll/libwxmsw31u_core.a" />
<Add library="../../../wxWidgets-3.1.2/lib/gcc730_dll/libwxbase31u.a" />
<Add directory="../../../wxWidgets-3.1.2/lib/gcc730_dll" />
</Linker>
</Target>
</Build>
<Unit filename="../../../Libraries/glew-2.1.0/src/glew.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
--- End code ---
Real project (producing dll-exe):
--- Code: ---<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="glLive3d" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Release">
<Option output="glLive3d/glLive3d" prefix_auto="1" extension_auto="1" />
<Option type="0" />
<Option compiler="gcc" />
<Option projectCompilerOptionsRelation="0" />
<Option projectLinkerOptionsRelation="0" />
<Compiler>
<Add option="-fomit-frame-pointer" />
<Add option="-O3" />
<Add option="-D__WXMSW__" />
<Add option="-D__GNUWIN32__" />
<Add option="-D_UNICODE" />
<Add directory="../../../wxWidgets-3.1.2/lib/gcc730_dll/mswu" />
<Add directory="../../../wxWidgets-3.1.2/include" />
</Compiler>
<Linker>
<Add option="-s" />
<Add library="../../../wxWidgets-3.1.2/lib/gcc730_dll/libwxmsw31u_core.a" />
<Add library="../../../wxWidgets-3.1.2/lib/gcc730_dll/libwxbase31u.a" />
<Add directory="../../../wxWidgets-3.1.2/lib/gcc730_dll" />
</Linker>
</Target>
</Build>
<Unit filename="../../Libraries/glew-2.1.0/src/glew.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="_Controls.cpp" />
<Unit filename="_Controls.h" />
<Unit filename="_Fnc3d.cpp" />
<Unit filename="_Fnc3d.h" />
<Unit filename="_Macros.cpp" />
<Unit filename="_Macros.h" />
<Unit filename="_Main.cpp" />
<Unit filename="_Main.h" />
<Unit filename="_Midi.cpp" />
<Unit filename="_Midi.h" />
<Unit filename="_Modules.cpp" />
<Unit filename="_Modules.h" />
<Unit filename="clsMainWin.cpp" />
<Unit filename="clsMainWin.h" />
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
--- End code ---
And here are the linker-call as reported while colpiliation (some flags are set for testing):
Test-project (producing monolithic exe):
--- Code: ---g++.exe -L..\..\..\wxWidgets-3.1.2\lib\gcc730_dll -LF:\codeblocks-17.12-nosetup\CodeBlocks\mingw32\mingw\lib -LF:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll -LF:\codeblocks-17.12-nosetup\Libraries\glfw-3.2.1.bin.WIN32\lib-mingw-w64 -o bin\Release_x86\test.exe obj\Release_x86\Libraries\glew-2.1.0\src\glew.o "obj\Release_x86\Projects\19-01-26 - test-ogl\test\main.o" -s -static-libstdc++ -static-libgcc -static -m32 -mwindows -lwxbase31u -lwxbase31u_net -lwxmsw31u_core -lwxmsw31u_gl -lwxmsw31u_webview -lglut32 -lglu32 -lopengl32 -lwinmm -lgdi32 -flinker-output=exec -no-pie F:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll\libwxbase31u.a F:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll\libwxbase31u_net.a F:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll\libwxmsw31u_core.a F:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll\libwxmsw31u_gl.a F:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll\libwxmsw31u_webview.a -mwindows
--- End code ---
Real project (producing dll-exe):
--- Code: ---g++.exe -L..\..\..\wxWidgets-3.1.2\lib\gcc730_dll -LF:\codeblocks-17.12-nosetup\CodeBlocks\mingw32\mingw\lib -LF:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll -LF:\codeblocks-17.12-nosetup\Libraries\glfw-3.2.1.bin.WIN32\lib-mingw-w64 -o glLive3d\glLive3d.exe .objs\Libraries\glew-2.1.0\src\glew.o ".objs\Projects\19-01-24 - ThreadTest\_Controls.o" ".objs\Projects\19-01-24 - ThreadTest\_Fnc3d.o" ".objs\Projects\19-01-24 - ThreadTest\_Macros.o" ".objs\Projects\19-01-24 - ThreadTest\_Main.o" ".objs\Projects\19-01-24 - ThreadTest\_Midi.o" ".objs\Projects\19-01-24 - ThreadTest\_Modules.o" ".objs\Projects\19-01-24 - ThreadTest\clsMainWin.o" -s -static-libstdc++ -static-libgcc -static -m32 -mwindows -lwxbase31u -lwxbase31u_net -lwxmsw31u_core -lwxmsw31u_gl -lwxmsw31u_webview -lglut32 -lglu32 -lopengl32 -lwinmm -lgdi32 -flinker-output=exec -no-pie F:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll\libwxbase31u.a F:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll\libwxbase31u_net.a F:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll\libwxmsw31u_core.a F:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll\libwxmsw31u_gl.a F:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll\libwxmsw31u_webview.a -mwindows
--- End code ---
art-ganseforth:
Sorry, this are the correct linker-call as reported while colpiliation (the others contined redundant duplicate librarie-links):
--- Code: ---g++.exe -L..\..\..\wxWidgets-3.1.2\lib\gcc730_dll -LF:\codeblocks-17.12-nosetup\CodeBlocks\mingw32\mingw\lib -LF:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll -LF:\codeblocks-17.12-nosetup\Libraries\glfw-3.2.1.bin.WIN32\lib-mingw-w64 -o bin\Release_x86\test.exe obj\Release_x86\Libraries\glew-2.1.0\src\glew.o "obj\Release_x86\Projects\19-01-26 - test-ogl\test\main.o" -s -static-libstdc++ -static-libgcc -static -m32 -mwindows -lwxbase31u -lwxbase31u_net -lwxmsw31u_core -lwxmsw31u_gl -lwxmsw31u_webview -lglut32 -lglu32 -lopengl32 -lwinmm -lgdi32 -flinker-output=exec -no-pie -mwindows
--- End code ---
--- Code: ---g++.exe -L..\..\..\wxWidgets-3.1.2\lib\gcc730_dll -LF:\codeblocks-17.12-nosetup\CodeBlocks\mingw32\mingw\lib -LF:\codeblocks-17.12-nosetup\wxWidgets-3.1.2\lib\gcc730_dll -LF:\codeblocks-17.12-nosetup\Libraries\glfw-3.2.1.bin.WIN32\lib-mingw-w64 -o glLive3d\glLive3d.exe .objs\Libraries\glew-2.1.0\src\glew.o ".objs\Projects\19-01-24 - ThreadTest\_Controls.o" ".objs\Projects\19-01-24 - ThreadTest\_Fnc3d.o" ".objs\Projects\19-01-24 - ThreadTest\_Macros.o" ".objs\Projects\19-01-24 - ThreadTest\_Main.o" ".objs\Projects\19-01-24 - ThreadTest\_Midi.o" ".objs\Projects\19-01-24 - ThreadTest\_Modules.o" ".objs\Projects\19-01-24 - ThreadTest\clsMainWin.o" -s -static-libstdc++ -static-libgcc -static -m32 -mwindows -lwxbase31u -lwxbase31u_net -lwxmsw31u_core -lwxmsw31u_gl -lwxmsw31u_webview -lglut32 -lglu32 -lopengl32 -lwinmm -lgdi32 -flinker-output=exec -no-pie -mwindows
--- End code ---
BlueHazzard:
Are you sure the first produces a monolithic exe?
I am not sure but aren't the static linked wxWidgets libraries in gcc_lib folder and not gcc_dll ? (i am compiling wxWidgets for static libraries right now...)
So if you link against the gcc_lib folder you will get a static linked program, and if you link against gcc_dll you will get a dynamic linked program....
Navigation
[0] Message Index
[#] Next page
Go to full version