Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: bryceman on June 22, 2006, 01:57:52 am
-
I'm using wxwidgets 2.6.3 and the 6-21 nightly (on older nightlies, I had the same problem).
When I try to compile a virgin wxSmith project, I get the following linking errors:
-------------- Build: default in wxSmith5 ---------------
Linking executable: wxSmith5.exe
.objs\mainframe.o:mainframe.cpp:(.text$_Z16wxGetTranslationPKc[wxGetTranslation(char const*)]+0x2c): undefined reference to `_imp___ZNK8wxLocale9GetStringEPKcS1_'
.objs\mainframe.o:mainframe.cpp:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x27): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
.objs\app.o:app.cpp:(.rdata$_ZTV5MyApp[vtable for MyApp]+0x68): undefined reference to `wxApp::Initialize(int&, char**)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
Also notice that the build messages window doesn't report linking errors
-
If I recall correctly, this means that you're trying to use a Unicode wxWidgets build without wxUSE_UNICODE defined, or a non-Unicode build with it defined. Check your project's build options and make sure that everything matches up: your actual wxWidgets build, the custom variable "WX_SUFFIX" (should be "u" if using Unicode or blank otherwise), and the #define "wxUSE_UNICODE" (should be used if using Unicode; not otherwise).
If that wasn't the issue, also make sure that WXUSINGDLL is defined if you're building from wxWidgets DLLs (you compiled with SHARED=1), and make sure that __WXMSW__ is defined (and possibly HAVE_W32API_H).
-
My wxwidgets installaion has lib/gcc_dll/mswu, so I assum it's a unicode build.
I just created another wxSmith project w/ the wizard, with default settings, except for "use unicode" set. This means that config mode is global variables and lib-type is dll.
I just noticed another bug. When I right-click the project and select "build options", I don't see the details that I see when I select properties, then click project's build options.
The resulting project build settings are:
Compiler-defines:
USE_PCH
__GNUWIN32__
__WXMSW__
HAVE_W32API_H
WXUSINGDLL
link libraries:
wxmsw26$(WX_CFG)
Compiler directories:
$#(WX.include)
$#(WX.lib)\gcc_dll\msw$(WX_CFG)
$#(WX.lib)\gcc_dll$(WX_CFG)\msw
$#(WX)\contrib\include
Linker Directories:
$#(WX.lib)\gcc_dll
$#(WX.lib)\gcc_dll\msw$(WX_CFG)
$#(WX.lib)\gcc_dll$(WX_CFG)
Resource directories:
$#(WX.include)
Custom variables:
WX_CFG = u
So I see WX_CFG, not WX_SUFFIX, as you mentioned. I don't know where exactly I should look for any "#define wxUSE_UNICODE". I also don't know where I'd look for a "SHARED=1". Should I actually be able to compile a virgin wxSmith project successfully?
-
My wxwidgets installaion has lib/gcc_dll/mswu, so I assum it's a unicode build.
Correct.
So I see WX_CFG, not WX_SUFFIX, as you mentioned.
They should act identically in this case.
I don't know where exactly I should look for any "#define wxUSE_UNICODE".
You would place "wxUSE_UNICODE" in the Compiler defines. In fact, if you chose Unicode in the wizard and it wasn't placed there for you, it is a bug in the wizard.
I also don't know where I'd look for a "SHARED=1".
This is one of the command-line options when building wxWidgets itself. SHARED=0 means static libraries (.a files only) are built; SHARED=1 means DLLs (.a and .dll files) are built.
-
You would place "wxUSE_UNICODE" in the Compiler defines. In fact, if you chose Unicode in the wizard and it wasn't placed there for you, it is a bug in the wizard.
Yep, adding this resulted in a successful compile, so I have found two bugs. Where should I be reporting them?
-
Yep, adding this resulted in a successful compile, so I have found two bugs. Where should I be reporting them?
Hello,
You can report the bug(s) on BerliOS (see www.codeblocks.org).
Best wishes,
Michael