User forums > Using Code::Blocks

link errors

(1/4) > >>

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: 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
--- End quote ---


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:


--- Code: ----pthread -lwx_gtk2-2.4
--- End code ---


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.

Navigation

[0] Message Index

[#] Next page

Go to full version