User forums > Help

Link errors when compiling beta 5

(1/2) > >>

Urxae:
I'm trying to compile Code::Blocks 1.0-beta5, using the project file in the archive.
The compiler is g++ 3.4.2 (mingw-special), the IDE is beta 5 itself.

This is the output: (the part that went wrong)


--- Code: ---Project   : Code::Blocks
Compiler  : GNU GCC Compiler (called directly)
Directory : D:\C++\cvs\CodeBlocks-1.0-beta5\
--------------------------------------------------------------------------------
Linking dynamic library: devel\codeblocks.dll
Creating library file: devel\\libcodeblocks.a
sdk\\.objs\\autodetectcompilers.o: In function `ZN19AutoDetectCompilersC2EP8wxWindow':
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:17: undefined reference to `wxXmlResource::Get()'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:17: undefined reference to `wxXmlResource::LoadDialog(wxDialog*, wxWindow*, wxString const&)'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:19: undefined reference to `wxXmlResource::GetXRCID(char const*)'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:19: undefined reference to `_imp___ZN12wxWindowBase10FindWindowEl'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:22: undefined reference to `_imp___ZN10wxListCtrl8ClearAllEv'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:23: undefined reference to `_imp___ZN10wxListCtrl12InsertColumnElRK8wxStringii'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:24: undefined reference to `_imp___ZN10wxListCtrl12InsertColumnElRK8wxStringii'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:29: undefined reference to `_imp___ZNK10wxListCtrl12GetItemCountEv'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:29: undefined reference to `_imp___ZN10wxListCtrl10InsertItemElRK8wxString'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:31: undefined reference to `_imp___ZNK10wxListCtrl12GetItemCountEv'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:33: undefined reference to `_imp___ZN10wxListCtrl7SetItemEliRK8wxStringi'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:39: undefined reference to `_imp___ZN10wxListCtrl7SetItemEliRK8wxStringi'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:42: undefined reference to `_imp___ZN10wxListCtrl7SetItemEliRK8wxStringi'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:49: undefined reference to `wxXmlResource::GetXRCID(char const*)'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:49: undefined reference to `_imp___ZN12wxWindowBase10FindWindowEl'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:49: undefined reference to `_imp___ZN8wxDialogD2Ev'
sdk\\.objs\\autodetectcompilers.o: In function `ZN19AutoDetectCompilersC1EP8wxWindow':
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:17: undefined reference to `wxXmlResource::Get()'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:17: undefined reference to `wxXmlResource::LoadDialog(wxDialog*, wxWindow*, wxString const&)'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:19: undefined reference to `wxXmlResource::GetXRCID(char const*)'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:19: undefined reference to `_imp___ZN12wxWindowBase10FindWindowEl'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:22: undefined reference to `_imp___ZN10wxListCtrl8ClearAllEv'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:23: undefined reference to `_imp___ZN10wxListCtrl12InsertColumnElRK8wxStringii'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:24: undefined reference to `_imp___ZN10wxListCtrl12InsertColumnElRK8wxStringii'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:29: undefined reference to `_imp___ZNK10wxListCtrl12GetItemCountEv'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:29: undefined reference to `_imp___ZN10wxListCtrl10InsertItemElRK8wxString'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:31: undefined reference to `_imp___ZNK10wxListCtrl12GetItemCountEv'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:33: undefined reference to `_imp___ZN10wxListCtrl7SetItemEliRK8wxStringi'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:39: undefined reference to `_imp___ZN10wxListCtrl7SetItemEliRK8wxStringi'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:42: undefined reference to `_imp___ZN10wxListCtrl7SetItemEliRK8wxStringi'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:49: undefined reference to `wxXmlResource::GetXRCID(char const*)'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:49: undefined reference to `_imp___ZN12wxWindowBase10FindWindowEl'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:49: undefined reference to `_imp___ZN8wxDialogD2Ev'
sdk\\.objs\\autodetectcompilers.o: In function `ZN19AutoDetectCompilersD2Ev':
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:53: undefined reference to `_imp___ZN8wxDialogD2Ev'
sdk\\.objs\\autodetectcompilers.o: In function `ZN19AutoDetectCompilersD1Ev':
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:53: undefined reference to `_imp___ZN8wxDialogD2Ev'
sdk\\.objs\\autodetectcompilers.o: In function `ZN19AutoDetectCompilersD0Ev':
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:53: undefined reference to `_imp___ZN8wxDialogD2Ev'
sdk\\.objs\\autodetectcompilers.o: In function `ZN19AutoDetectCompilers14OnDefaultClickER14wxCommandEvent':
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:59: undefined reference to `wxXmlResource::GetXRCID(char const*)'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:59: undefined reference to `_imp___ZN12wxWindowBase10FindWindowEl'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:60: undefined reference to `_imp___ZNK10wxListCtrl11GetNextItemElii'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:64: undefined reference to `wxXmlResource::GetXRCID(char const*)'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:64: undefined reference to `_imp___ZN12wxWindowBase10FindWindowEl'
sdk\\.objs\\autodetectcompilers.o: In function `ZN19AutoDetectCompilers10OnUpdateUIER15wxUpdateUIEvent':
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:70: undefined reference to `wxXmlResource::GetXRCID(char const*)'
D:/C++/cvs/CodeBlocks-1.0-beta5/sdk//autodetectcompilers.cpp:70: undefined reference to `_imp___ZN12wxWindowBase10FindWindowEl'
Process terminated with status 1 (0 minutes, 59 seconds)
42 errors, 0 warnings

--- End code ---


Any ideas? Did I maybe do something wrong installing wxWidgets?

mandrav:
I did a fresh CVS checkout and compiled the sources and everything went fine.
What wxWidgets version are you using? What are its compilation options?
I get the feeling that something is wrong with your wxWidgets installation. In order to build Code::Blocks, you need wxWidgets as a monolithic DLL. You also need contrib/xrc and contrib/stc libraries from the wxWidgets sources.

Yiannis.

Urxae:

--- Quote from: mandrav ---I did a fresh CVS checkout and compiled the sources and everything went fine.
--- End quote ---

This is from the source tarball.

--- Quote ---What wxWidgets version are you using? What are its compilation options?
--- End quote ---

2.4.2, using the options you mentioned in this thread, except I left out UNICODE=0 (isn't that the default?)

--- Quote ---
I get the feeling that something is wrong with your wxWidgets installation.
--- End quote ---

So do I.

--- Quote ---In order to build Code::Blocks, you need wxWidgets as a monolithic DLL. You also need contrib/xrc and contrib/stc libraries from the wxWidgets sources.
--- End quote ---

Does a monolithic DLL include contrib/xrc and contrib/stc, or should these be separate DLLs, or static libs (.a)? The options in that thread just gave me the static ones, so I used those.
Is there any special place the DLL has to be in? I've put it in the lib folder in with my static libs, in the codeblocks directory, and I think I've also tried some other places, but it doesn't seem to make a difference.

mandrav:
I tried it again with the source package. It still compiles fine...

CB needs from wxWidgets the following: wxmsw242.dll, libwxmsw242.a, libwxxrc.a and libwxstc.a (xrc and stc are static libs).
Check that they exist, especially libwxxrc.a (based on the errors above). These are for wxWidgets 2.4.2. It works with 2.4.1 and 2.5.x (IIRC), as long as these files exist.
If you are not using wxWidgets 2.4.2, go to "Settings/Configure plugins/Compiler", switch to the "Custom variables" tab and add/edit a variable named WX_VER containing the wxWidgets version you 're using (e.g. 241 for wx2.4.1, 242 for wx2.4.2, etc)

If you still can't find what's going on, go to "Settings/Configure plugins/Compiler", switch to the "Other" tab and set the GCC logging to full. Compile CB and when it stops with the error, post the compile log. I want to see the linker command line (although, if you 're using the supplied project file, it should be fine)...

Yiannis.

mandrav:
Now that I think of it, the variable WX_VER might be the problem. These custom variables, unfortunately, are not saved with the project file but are global options. I must change that...

Yiannis.

Navigation

[0] Message Index

[#] Next page

Go to full version