SourceForge has been redesigned. Learn more.
Close

#781 linking errors with -pg

OTHER
closed
nobody
gcc (462)
works-for-me
User_Error
2013-01-31
2005-05-29
No

When I compile a program with -pg using MinGW 3.2.0
package with GCC 3.4.2 I get a lot of those errors:

C:/MAME/src/machine/segacrpt.c:245: undefined reference
to `mcount'

I checked on the web and found this about a
FreeBSD/x86-64 bug, which sound like the same problem:

http://lists.freebsd.org/pipermail/freebsd-amd64/2004-May/001240.html

Discussion

  • Danny Smith

    Danny Smith - 2005-05-29
    • status: open --> open-works-for-me
     
  • Danny Smith

    Danny Smith - 2005-05-29

    Logged In: YES
    user_id=11494

    You need to add -pg to command line when linking objects as
    well as when compiling.

    gcc -c -pg main.c
    gcc -omain.exe -pg main.o

    Danny

     
  • Oliver Stöneberg

    Logged In: YES
    user_id=591019

    Oh geez. My bad! I first thought of it as a link-only thing,
    but then I realized it's obviously compiling thing and I
    just forgot to add the flags. Works fine now...

     
  • Danny Smith

    Danny Smith - 2005-05-29
    • status: open-works-for-me --> closed-works-for-me
     
  • Earnie Boyd

    Earnie Boyd - 2013-01-31
    • labels: --> gcc
    • status: closed-works-for-me --> closed
    • resolution: --> works-for-me
    • category: --> User_Error
    • milestone: --> OTHER
     

Log in to post a comment.