User forums > Using Code::Blocks
Problems with configuration wxWidgets in C::B
Tkachov:
Hello.
Tried to create simple application in C::B using wxWidgets.
First my problem was (yes, was - I'm talking about it just to provide more information about what I've done) with compiled exe-file. Running through IDE is allright, but running compiled one asks wxWidgets dlls. To solve it I've compiled wxWidgets myself using MinGW as static (SHARED=0), non-monolithic (MONOLITHIC=0) Release-configuration (BUILD=release) libraries.
And now I've got the second problem. The project I've done and compiled earlier couldn`t be compiled now; I`ve got about 700 errors like "undefined reference to `_imp___ZN16wxEventHashTableD1Ev'". (But I`ve changed path to new wxWidgets directory, corrected libraries names at Build options -> Linker settings.)
Also, default wxWidgets-project (one label, two buttons) can`t be compiled without libwxjpeg.a and libwxtiff.a now. But it`s strange, `cos it don`t uses it.
May be I`ve forgotten something and so this is a reason why I`ve got these errors?
P.S.: if this already was discussed, please, give me some links to the topics.
stahta01:
Turn on "Full Compiler Logging" it sometimes will show up the problem.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
Common causes of weird errors:
Using a different Compiler version to compile User App and wxWidgets Library.
Having two different version of wxWidgets Library in the search paths.
Tim S.
Tkachov:
Looks like I'm getting the same errors without new information.
I`ve compiled wxWidgets using the same compiler as I`m using at Code::Blocks and I`m sure I have only one version of these libraries.
There are also some info about undefined reference error at wxWidgets wiki: static libs must be given to compiler before shared libs. There are some libraries like lkernel32 and luser32 (and 11 others). I don`t know, are these libraries shared or not, so I`ve tried to change their position in compiler call and got no effect - same errors.
Also, I`ve used wxPack before getting first problem I`ve described there (compiled exe-file asks wxWidgets dll to be in the same directory). But, as I said, I`ve removed it and compiled static libraries instead (so there are shouldn`t be another versions of wxWidgets).
stahta01:
And if you post the Full compiler build log, someone can help you understand them.
If you do not, then you will get no more help from me.
Tim S.
Tkachov:
This is not full build log for my project (there are 650 errors, undefined references like "_imp___ZN12wxStringBaseC2Ejc" and then error messages about libwxjpeg and libwxtiff like a default wxWidgets project provides):
--- Code: ----------------- Build: Release in P ---------------
mingw32-g++.exe -LD:\CPP\IDE\wxWidgets\lib\gcc_lib -o bin\Release\P.exe obj\Release\PMain.o obj\Release\PApp.o obj\Release\resource.res -s -mthreads -lwxmsw28u_core -lwxbase28u -lwxpng -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows
obj\Release\PMain.o:PMain.cpp:(.text+0x27): undefined reference to `_imp___ZN16wxEventHashTableD1Ev'
obj\Release\PMain.o:PMain.cpp:(.text+0x54): undefined reference to `_imp___ZN12wxStringBaseC2Ejc'
obj\Release\PMain.o:PMain.cpp:(.text+0xc2ec): undefined reference to `_imp___ZN6wxFontD1Ev'
obj\Release\PMain.o:PMain.cpp:(.text$_ZNK12wxWindowBase7GetNameEv[wxWindowBase::GetName() const]+0x2a): undefined reference to `_imp__wxEmptyString'
obj\Release\PMain.o:PMain.cpp:(.text$_ZN12wxButtonBaseD0Ev[wxButtonBase::~wxButtonBase()]+0xb): undefined reference to `_imp___ZTV12wxButtonBase'
obj\Release\PMain.o:PMain.cpp:(.text$_ZN12wxButtonBaseD0Ev[wxButtonBase::~wxButtonBase()]+0x19): undefined reference to `_imp___ZN9wxControlD2Ev'
obj\Release\PMain.o:PMain.cpp:(.text$_ZN12wxButtonBaseD1Ev[wxButtonBase::~wxButtonBase()]+0xb): undefined reference to `_imp___ZTV12wxButtonBase'
obj\Release\PMain.o:PMain.cpp:(.text$_ZN12wxButtonBaseD1Ev[wxButtonBase::~wxButtonBase()]+0x15): undefined reference to `_imp___ZN9wxControlD2Ev'
D:\CPP\IDE\wxWidgets\lib\gcc_lib/libwxmsw28u_core.a(corelib_imagjpeg.o):imagjpeg.cpp:(.text+0x2c0): undefined reference to `jpeg_resync_to_restart'
D:\CPP\IDE\wxWidgets\lib\gcc_lib/libwxmsw28u_core.a(corelib_imagjpeg.o):imagjpeg.cpp:(.text+0x3a2): undefined reference to `jpeg_std_error'
D:\CPP\IDE\wxWidgets\lib\gcc_lib/libwxmsw28u_core.a(corelib_imagjpeg.o):imagjpeg.cpp:(.text+0xcd8): undefined reference to `jpeg_finish_compress'
D:\CPP\IDE\wxWidgets\lib\gcc_lib/libwxmsw28u_core.a(corelib_imagjpeg.o):imagjpeg.cpp:(.text+0xce0): undefined reference to `jpeg_destroy_compress'
D:\CPP\IDE\wxWidgets\lib\gcc_lib/libwxmsw28u_core.a(corelib_imagjpeg.o):imagjpeg.cpp:(.text+0xdfc): undefined reference to `jpeg_set_quality'
D:\CPP\IDE\wxWidgets\lib\gcc_lib/libwxmsw28u_core.a(corelib_imagtiff.o):imagtiff.cpp:(.text+0x287): undefined reference to `TIFFClientOpen'
D:\CPP\IDE\wxWidgets\lib\gcc_lib/libwxmsw28u_core.a(corelib_imagtiff.o):imagtiff.cpp:(.text+0xfeb): undefined reference to `TIFFWriteScanline'
D:\CPP\IDE\wxWidgets\lib\gcc_lib/libwxmsw28u_core.a(corelib_imagtiff.o):imagtiff.cpp:(.text+0x10a9): undefined reference to `_TIFFfree'
D:\CPP\IDE\wxWidgets\lib\gcc_lib/libwxmsw28u_core.a(corelib_imagtiff.o):imagtiff.cpp:(.text+0x118a): undefined reference to `TIFFClose'
--- End code ---
(Full log in attachment.)
____________
UPD: tired to compile a default wxWidgets project using wxPack (got my libraries out of search directories and then installed wxPack). If I'm using static non-monolithic libraries from wxPack, it gives me the same errors.
Navigation
[0] Message Index
[#] Next page
Go to full version