#30 undefined reference

closed
nobody
None
5
2003-09-08
2003-05-14
Marcelo Taube
No

I'm getting a strage output with the linker. This
didn't happen before but now it does, i don't remember
having done something to make it happen (which doesn't
mean i haven't).

It seems that i have an undefined reference to mcount..
However those references come from the STL, so they
should be defined, shouldn't they?

I will thank for any help,
Sincerily,
Marcelo Taube

When i try linking i get this:
****************************************************************
Compiler: Default compiler
Building Makefile:
"C:\DOCUME~1\Marcelo\ESCRIT~1\COMUNI~2\Makefile.win"
Executing make...
make.exe -f
"C:\DOCUME~1\Marcelo\ESCRIT~1\COMUNI~2\Makefile.win" all
dllwrap.exe --output-def libcomunication.def
--driver-name c++ --implib libcomunication.a
objetos/protocolo.o objetos/computadoras.o
objetos/lists.o objetos/paraC.o objetos/mensaje.o
objetos/error.o objetos/sockets.o objetos/threads.o
objetos/random.o objetos/debug.o -L"C:/MinGW/lib"
-lws2_32 -o libreria/comunication.dll
objetos/protocolo.o(.text+0xc): In function
`ZSt3maxIjERKT_S2_S2_':
C:/MinGW/include/c++/3.2/bits/stl_alloc.h: undefined
reference to `mcount'
objetos/protocolo.o(.text+0x30): In function
`ZN2PS10PsigSocket14_manejamensajeERNS_7mensajeE':
C:/DOCUME~1/Marcelo/ESCRIT~1/COMUNI~2/protocolo.cpp:19:
undefined reference to `mcount'
objetos/protocolo.o(.text+0x6c): In function
`ZN2PS10PsigSocket10threadmainEv':
C:/DOCUME~1/Marcelo/ESCRIT~1/COMUNI~2/protocolo.cpp:32:
undefined reference to `mcount'
objetos/protocolo.o(.text+0x8d): In function
`ZN2PS10PsigSocket7netwaitEv':
C:/DOCUME~1/Marcelo/ESCRIT~1/COMUNI~2/protocolo.cpp:38:
undefined reference to `mcount'
objetos/protocolo.o(.text+0x140): In function
`ZN2PS10PsigSocket10getmessageERNS_7mensajeE':
C:/DOCUME~1/Marcelo/ESCRIT~1/COMUNI~2/protocolo.cpp:90:
undefined reference to `mcount'
objetos/protocolo.o(.text+0x1d5):C:/DOCUME~1/Marcelo/ESCRIT~1/COMUNI~2/protocolo.cpp:97:
more undefined references to `mcount' follow

c:\MinGW\bin\dllwrap.exe: no export definition file
provided.
Creating one, but that may not be what you want

c:\MinGW\bin\dllwrap.exe: c++ exited with status 1

make.exe: *** [libreria/comunication.dll] Error 1
Execution terminated
****************************************************************

Discussion

  • Danny Smith
    Danny Smith
    2003-05-14

    Logged In: YES
    user_id=11494

    Were any objects compiled wih -pg switch to enable
    profiling? If so, add libgmon.a to libs when building dll.
    (or recompile objects without -pg)
    Danny

     
  • Marcelo Taube
    Marcelo Taube
    2003-09-08

    • status: open --> closed