Author Topic: Link errors when compiling beta 5  (Read 11082 times)

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Link errors when compiling beta 5
« on: February 10, 2005, 04:18:15 pm »
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


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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Link errors when compiling beta 5
« Reply #1 on: February 10, 2005, 06:07:54 pm »
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.
Be patient!
This bug will be fixed soon...

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Link errors when compiling beta 5
« Reply #2 on: February 10, 2005, 07:10:47 pm »
Quote from: mandrav
I did a fresh CVS checkout and compiled the sources and everything went fine.

This is from the source tarball.
Quote
What wxWidgets version are you using? What are its compilation options?

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.

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.

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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Link errors when compiling beta 5
« Reply #3 on: February 11, 2005, 12:00:52 pm »
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.
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Link errors when compiling beta 5
« Reply #4 on: February 11, 2005, 12:03:28 pm »
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.
Be patient!
This bug will be fixed soon...

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Link errors when compiling beta 5
« Reply #5 on: February 11, 2005, 12:42:02 pm »
Quote from: mandrav
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.

I have all of those, except libwxstc.a. I do, however, have libstc.a (which should be the right name looking at the project file and the linker command line).

Actually, libwxxrc.a is also where I suspect the problem might be. I have it, but "grep LoadDialog libwxxrc.a" (see second error message) doesn't turn up anything, though it is in the source. Just to be sure, I'm recompiling it right now.

Quote
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)

Quote
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...

Actually, I noticed that, and I added a custom variable WX_VER set to 242 (my wxWidgets version). And yes, you should change that. :)

Quote
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)...


Code
mingw32-g++.exe -shared -Wl,--output-def="devel\\libcodeblocks.def" -Wl,--out-implib="devel\\libcodeblocks.a" -Wl,--dll   -L"D:\\C++\\MinGW\\lib" -L"D:\\C++\\local\\lib"  -L"sdk/tinyxml" "sdk\\Managers\\.objs\\Managers.o" "sdk\\Managers\\.objs\\StdAfx.o" "sdk\\.objs\\autodetectcompilers.o" "sdk\\.objs\\cbeditor.o" "sdk\\.objs\\cbplugin.o" "sdk\\.objs\\cbproject.o" "sdk\\.objs\\compileoptionsbase.o" "sdk\\.objs\\compiler.o" "sdk\\.objs\\compilerfactory.o" "sdk\\.objs\\compileroptions.o" "sdk\\.objs\\compiletargetbase.o" "sdk\\.objs\\configmanager.o" "sdk\\.objs\\configuretoolsdlg.o" "sdk\\.objs\\confirmreplacedlg.o" "sdk\\.objs\\devcpploader.o" "sdk\\.objs\\editarrayfiledlg.o" "sdk\\.objs\\editarrayorderdlg.o" "sdk\\.objs\\editarraystringdlg.o" "sdk\\.objs\\editorcolorset.o" "sdk\\.objs\\editorconfigurationdlg.o" "sdk\\.objs\\editormanager.o" "sdk\\.objs\\edittooldlg.o" "sdk\\.objs\\filegroupsandmasks.o" "sdk\\.objs\\finddlg.o" "sdk\\.objs\\globals.o" "sdk\\.objs\\incrementalselectlistdlg.o" "sdk\\.objs\\macrosmanager.o" "sdk\\.objs\\manager.o" "sdk\\.objs\\menuitemsmanager.o" "sdk\\.objs\\messagelog.o" "sdk\\.objs\\messagemanager.o" "sdk\\.objs\\msvc7loader.o" "sdk\\.objs\\msvcloader.o" "sdk\\.objs\\newfromtemplatedlg.o" "sdk\\.objs\\pipedprocess.o" "sdk\\.objs\\pluginmanager.o" "sdk\\.objs\\pluginsconfigurationdlg.o" "sdk\\.objs\\projectbuildtarget.o" "sdk\\.objs\\projectfileoptionsdlg.o" "sdk\\.objs\\projectlayoutloader.o" "sdk\\.objs\\projectloader.o" "sdk\\.objs\\projectmanager.o" "sdk\\.objs\\projectoptionsdlg.o" "sdk\\.objs\\projectsfilemasksdlg.o" "sdk\\.objs\\projecttemplateloader.o" "sdk\\.objs\\replacedlg.o" "sdk\\.objs\\sdk_events.o" "sdk\\.objs\\selecttargetdlg.o" "sdk\\.objs\\simplelistlog.o" "sdk\\.objs\\simpletextlog.o" "sdk\\.objs\\templatemanager.o" "sdk\\.objs\\toolsmanager.o" "sdk\\.objs\\workspaceloader.o"    -L"D:\\C++\\MinGW\\lib" -L"D:\\C++\\local\\lib"  -L"sdk/tinyxml" -o "devel\\codeblocks.dll"   -Wl,--enable-auto-image-base -Wl,--export-all-symbols -Wl,--add-stdcall-alias -ltxml -lwxxrc -lstc  -lwxmsw$(WX_VER)

followed by the errors in my first post.

Oh, and you didn't answer my question where the dll should be. (I put all the .a files I got from compiling wxWidgets in D:\C++\local\lib, which is in the library path of the linker, so that shouldn't be a problem)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Link errors when compiling beta 5
« Reply #6 on: February 11, 2005, 02:15:45 pm »
Quote from: fvbommel
I have all of those, except libwxstc.a. I do, however, have libstc.a (which should be the right name looking at the project file and the linker command line).

You 're right. The correct name is libstc.a

Quote from: fvbommel
Actually, libwxxrc.a is also where I suspect the problem might be. I have it, but "grep LoadDialog libwxxrc.a" (see second error message) doesn't turn up anything, though it is in the source. Just to be sure, I'm recompiling it right now.

It seems the problem is in wxxrc. Sorry I can't help you more with that. Something is probably wrong with your wxxrc build...

Quote from: fvbommel
Oh, and you didn't answer my question where the dll should be.

A DLL is loaded at runtime, so it has nothing to do with the linker errors you 're getting. I suggest you put it in windows\system32 to be available system-wide, If you don't want that, you can put it where codeblocks.exe lives, or anywhere else in you PATH.

Yiannis.
Be patient!
This bug will be fixed soon...

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Link errors when compiling beta 5
« Reply #7 on: February 11, 2005, 05:17:34 pm »
Well, some of the errors disappeared after a recompile of libwxxrc.a, so I recompiled the rest of wxWidgets too (my poor RAM), and now it Just Works (TM). :roll:
Now I'll try a compile of Code::Blocks from CVS, which (hopefully) now also works. (When CVS didn't work the first time, I switched to the source tarball, figuring that was rather unlikely to be broken)