User forums > Help

Problems with compiling Code::Blocks with wxWidgets 2.6.1

(1/2) > >>

skaut:
Hi all,

I have some problems with building Code::Blocks from sources (sources are from cvs)
wxWidgets are in version 2.6.1, build like described on wiki pages.
When I try to compile Code::Blocks usin Code::Blocks everything goes fine, but last step fails.
I can not link codeblocks.exe file - it makes lot of error - undefined reference.
Attached is file with buid messages.
Can somebody help me to solve this problem ?

Best Regards
skaut


[attachment deleted by admin]

rickg22:
Apparently the makefile for wx261 is broken

try using the makefile.unix but edit the wxwidgets 2.4.2 references and change them to 2.6.1's.

skaut:
Hi,

Thanks for answer.

I am not using makefile, I am compiling with Code::Blocks itself, using "CodeBlocks-wx2.6.0.cbp" project file.

tiwag:
Hi skaut,
have you done some changes in your "CodeBlocks-wx2.6.0.cbp" project file ?
if i compare it with my output, you have some unnecessary library path includes, like

--- Code: ----LC:\MinGW\wxWidgets-2.6.1\lib\gcc_dll\msw
--- End code ---

and

--- Code: ----LC:\CodeBlocks\lib
--- End code ---


you only should need this

--- Code: ----LC:\MinGW\wxWidgets-2.6.1\lib\gcc_dll 
--- End code ---

but it should not harm.

but
in my project file CodeBlocks.exe links as GUI executable with linker option "-mwindows" which is missing in your project definition !

your output

--- Code: ---Project   : Code::Blocks (wx2.6)
Compiler  : GNU GCC Compiler (called directly)
Directory : D:\Progs\CodeBlocks\src\
--------------------------------------------------------------------------------
...
Switching to target: src
...
mingw32-g++.exe 
-Ldevel -Lsrc\wxDockit\lib  -Lsdk\tinyxml -LC:\MinGW\wxWidgets-2.6.1\lib\gcc_dll\msw
-LC:\MinGW\wxWidgets-2.6.1\lib\gcc_dll  -LC:\CodeBlocks\lib
-o devel\codeblocks.exe 
-lcodeblocks -lwxDockIt -lwxmsw26_stc -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lodbc32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32  -lwxmsw26 
.objs\2.6\src\app.o .objs\2.6\src\dlgabout.o .objs\2.6\src\dlgaboutplugin.o .objs\2.6\src\environmentsettingsdlg.o .objs\2.6\src\impexpconfig.o .objs\2.6\src\main.o .objs\2.6\src\printdlg.o .objs\2.6\src\startherepage.o   
.objs\2.6\src\app.o: In function `ZN11wxVideoModeC1Eiiii':
C:/MinGW/wxWidgets-2.6.1/include/wx/app.h:(.text+0x45): undefined reference to `_imp___ZN12wxAppConsole17CheckBuildOptionsEPKcS1_'
.objs\2.6\src\app.o: In function `WinMain':
D:/Progs/CodeBlocks/src/src/app.cpp:2
--- End code ---

my output

--- Code: ---Project   : .my.CodeBlocks, 1.0-cvs HEAD, wx261
Compiler  : GNU GCC Compiler (called directly)
Directory : D:\cpp\_projects\Codeblocks\_HEAD\src\
--------------------------------------------------------------------------------
Switching to target: src
...
mingw32-g++.exe 
-Ldevel -Lsrc\wxDockit\lib  -Lsdk\tinyxml -LD:\wx261\lib\gcc_dll 
-o devel\codeblocks.exe
.objs\2.6\src\app.o .objs\2.6\src\dlgabout.o .objs\2.6\src\dlgaboutplugin.o .objs\2.6\src\environmentsettingsdlg.o .objs\2.6\src\impexpconfig.o .objs\2.6\src\main.o .objs\2.6\src\printdlg.o .objs\2.6\src\startherepage.o  .objs\2.6\src\resources\resources.res     
-lcodeblocks -lwxDockIt -lwxmsw26_stc -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lodbc32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32  -lwxmsw26  -mwindows
Process terminated with status 0 (0 minutes, 54 seconds)
0 errors, 0 warnings
--- End code ---

you can compare your settings with my project file

[attachment deleted by admin]

skaut:
Hi tiwag,

thanks for Your hint.
My project file is the same, but I had different settings in compiler options - for some reasone there wasn't option -mwindows for GUI application.
I modify this and now it is working.
I fix also makefile.wx2.6 to compile it correctly.
Line 765 from makefile:
$(src_BIN): $(src_LINKOBJS) $(src_RESOURCE) ..\wxDockit\lib\libwxdockit.a
this cause a problem - "no rules to make target "..\wxDockit\lib\libwxdockit.a""
after change:
$(src_BIN): $(src_LINKOBJS) $(src_RESOURCE) src/wxDockit/lib/libwxDockIt.a
it compiles without any errors

Best Regards
skaut


Navigation

[0] Message Index

[#] Next page

Go to full version