News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

link errors

Started by matt, July 10, 2005, 04:47:33 AM

Previous topic - Next topic

matt

hi

i get a linker error when compiling on fedora core 4 (gcc4, wx2.4):

Linking executable devel/codeblocks.exe...
.objs/src/app.o(.gnu.linkonce.t._ZN13CodeBlocksAppC1Ev[CodeBlocksApp::CodeBlocksApp()]+0x16): In function `CodeBlocksApp::CodeBlocksApp()':
src/app.cpp:77: undefined reference to `vtable for CodeBlocksApp'
collect2: ld returned 1 exit status
make: *** [devel/codeblocks.exe] Error 1

does anyone know what this is about?

thanks

Anonymous

Quote from: matthi

i get a linker error when compiling on fedora core 4 (gcc4, wx2.4):

Linking executable devel/codeblocks.exe...
.objs/src/app.o(.gnu.linkonce.t._ZN13CodeBlocksAppC1Ev[CodeBlocksApp::CodeBlocksApp()]+0x16): In function `CodeBlocksApp::CodeBlocksApp()':
src/app.cpp:77: undefined reference to `vtable for CodeBlocksApp'
collect2: ld returned 1 exit status
make: *** [devel/codeblocks.exe] Error 1

does anyone know what this is about?

thanks

Can you post more of the error? preferably the command being executed to link codeblocks.exe, it looks as if the linker is not linking with all the correct libraries.

matt

thanks for the reply.

i posted the whole error that was printed to the shell, but from exploring the makefile i deduced that `wx-config --libs` is run to determine what to link the program with. on my system this command produces the following result:

-pthread -lwx_gtk2-2.4

is this all that is required?

thanks

p.s. i noticed that in the unix makefile the line which links the executable includes "-mwindows". correct me if im wrong, but is this not incorrect?

rickg22

-mwindows means "no console window". I think it applies to both unix and windows.

mandrav

-mwindows applies only to windows.
Anyway, tomorrow I 'll update the unix project files too,
Now, concerning the error you 're getting, I can't think of anything. I haven't seen this error before and my only suggestion would be rebuilding the project, in case something screwed up.
Also I notice you 're using gcc 4. I'm not saying something's wrong with it, just that it's a pretty recent release and it ***might*** have some bugs.
If I were you and couldn't figure out what's wrong, I 'd try with an older (and proven to be stable) gcc version, like 3.4.

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

matt_matrus

thanks for the advice, i shall try gcc 3.4 tomorrow

matt

Well, i just tried did a cvs checkout and got it to compile first time on Mandriva 2005! But, when i try to run codeblocks.exe in output, it says:

./codeblocks.exe: error while loading shared libraries: libcodeblocks.so: cannot open shared object file: No such file or directory

I ran make -f Makefile.unix update. Has this replaced the shell script?

p.s. i couldn't be bothered to try with fc4

matt_matrus

Sorry, forgot to login!

I got it to work by copying libcodeblocks.so to /usr/lib. Is there no way to run it from its own directory properly, because there is no longer a "run.sh" script.

Thanks

mandrav

QuoteIs there no way to run it from its own directory properly, because there is no longer a "run.sh" script.
run.sh is created when you run the update script.

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

matt_matrus

I couldn't find run.sh anywhere in the cvs version (probably me being stupid). So i downloaded the final-beta, ran make -f Makefile.unix update, and copied the script to the cvs version's directory. With a bit of path tweaking in the script voila! :D

Edit:
To make everything work i needed to run codeblocks with the --prefix option and rename the wxwindows templates to have a capital second w (i.e. wxWindows.* instead of wxwindows.*)

zemo

Hi!

I have the same problem. Using fc4 (gcc 4.0.1, wx 2.4.2). Link error:

Linking executable devel/codeblocks.exe...
.objs/src/app.o(.gnu.linkonce.t._ZN13CodeBlocksAppC1Ev[CodeBlocksApp::CodeBlocksApp()]+0x16): In function `CodeBlocksApp::CodeBlocksApp()':
src/app.h:37: undefined reference to `vtable for CodeBlocksApp'
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `wxwxListStringNode::~wxwxListStringNode()'
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `wxwxMenuItemListNode::~wxwxMenuItemListNode()'
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `wxwxMenuItemListNode::~wxwxMenuItemListNode()'
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `vtable for wxFileProto'
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `wxwxListStringNode::~wxwxListStringNode()'
collect2: ld returned 1 exit status
make: *** [devel/codeblocks.exe] Error 1

Tryed codeblocks-1.0-rc1-1 and codeblocks CVS versions. Any idea?

zemo

#11
Progress report:

I was able so solve some gcc4 compile errors. I applyed 2 patches for wxGTK-2.4.2, found here: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=154958
This solved these errors:
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `wxwxListStringNode::~wxwxListStringNode()'
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `wxwxMenuItemListNode::~wxwxMenuItemListNode()'
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `wxwxMenuItemListNode::~wxwxMenuItemListNode()'
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `vtable for wxFileProto'
/usr/local/lib/libwx_gtk2-2.4.so: undefined reference to `wxwxListStringNode::~wxwxListStringNode()'

but it still won't compile, now I get just this:
Linking executable devel/codeblocks.exe...
.objs/src/app.o(.gnu.linkonce.t._ZN13CodeBlocksAppC1Ev[CodeBlocksApp::CodeBlocksApp()]+0x16): In function `CodeBlocksApp::CodeBlocksApp()':
src/app.h:37: undefined reference to `vtable for CodeBlocksApp'
collect2: ld returned 1 exit status
make: *** [devel/codeblocks.exe] Error 1

I believe this is gcc4 isue. Searched the web, but no luck  :?.

P.S.: wxGTK examples compile without problems.

rickg22

Are you compiling via the makefile.unix ? I've done it without a single problem.

zemo

Yes. I followed instructions from wiki. Did you used gcc3.4 or gcc4 ?

rickg22