Results 1 to 2 of 2

Thread: Compiling Qt in Linux: Unable to compile moc.cpp

  1. #1
    Join Date
    May 2009
    Location
    Rio de Janeiro/RJ/Brazil
    Posts
    20
    Thanks
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Exclamation Compiling Qt in Linux: Unable to compile moc.cpp

    People, during compilation of Qt 4.8.5 in a Linux RHE 5.0 64-bit there goes the following linking command:


    gmake[1]: Entering directory `/Work/ur5m/qt4.8.5/src/tools/moc'
    gcc -g -m64 -Wl,-Bdynamic -Wl,-u,___pseudo_link -L/usr/lib64 -Wl,-rpath,/usr/lib64 -Wl,-rpath-link,/Work/ur5m/qt4.8.5/lib -Wl,-O1 -Wl,-rpath,/Work/ur5m/qt4.8.5_install/lib -Wl,-rpath,/Work/ur5m/qt4.8.5_install/lib -o ../../../bin/moc release-shared/moc.o release-shared/preprocessor.o release-shared/generator.o release-shared/parser.o release-shared/token.o release-shared/main.o****-L/Work/ur5m/qt4.8.5/src/tools/bootstrap -lbootstrap -lz -lz


    I put four red asterisks to mark four suspicious spaces in the configure-generated Makefile command, possibly indicating some environment variable left blank or something alike. But what?

    The command fails with these linking error messages:

    Qt Code:
    1. release-shared/moc.o: In function `normalizeType(char const*, bool)':
    2. moc.cpp:(.text+0x3b29): undefined reference to `operator delete[](void*)'
    3. moc.cpp:(.text+0x3bf5): undefined reference to `operator new[](unsigned long)'
    4. release-shared/moc.o: In function `Moc::parseSlotInPrivate(ClassDef*, FunctionDef::Access)':
    5. moc.cpp:(.text+0xa89e): undefined reference to `operator delete(void*)'
    6. release-shared/moc.o: In function `Moc::parseSignals(ClassDef*)':
    7. moc.cpp:(.text+0xb05c): undefined reference to `operator delete(void*)'
    8. release-shared/moc.o: In function `Moc::parseSlots(ClassDef*, FunctionDef::Access)':
    9. moc.cpp:(.text+0xb8dc): undefined reference to `operator delete(void*)'
    10. release-shared/moc.o: In function `Moc::parse()':
    11. moc.cpp:(.text+0xd27b): undefined reference to `operator delete(void*)'
    12. moc.cpp:(.text+0xd3ae): undefined reference to `operator delete(void*)'
    13. release-shared/moc.o:moc.cpp:(.text+0xd4e1): more undefined references to `operator delete(void*)' follow
    14. release-shared/moc.o: In function `QList<NamespaceDef>::detach_helper_grow(int, int)':
    15. moc.cpp:(.text._ZN5QListI12NamespaceDefE18detach_helper_growEii[QList<NamespaceDef>::detach_helper_grow(int, int)]+0x66): undefined reference to `operator new(unsigned long)'
    16. moc.cpp:(.text._ZN5QListI12NamespaceDefE18detach_helper_growEii[QList<NamespaceDef>::detach_helper_grow(int, int)]+0xd6): undefined reference to `operator new(unsigned long)'
    17. release-shared/moc.o: In function `QList<NamespaceDef>::append(NamespaceDef const&)':
    18. (more about 2000 similar lines)
    To copy to clipboard, switch view to plain text mode 

    Please, help!

  2. The following user says thank you to paulocarvalho_br_2009 for this useful post:


  3. #2
    Join Date
    May 2009
    Location
    Rio de Janeiro/RJ/Brazil
    Posts
    20
    Thanks
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Compiling Qt in Linux: Unable to compile moc.cpp

    Fixed: Problem caused by incorrectly set environment variables causing make to use gcc (instead of g++) to compile and link C++ code.

  4. The following 2 users say thank you to paulocarvalho_br_2009 for this useful post:


Similar Threads

  1. Unable to compile example for QtAudio
    By rikkimongoose in forum Qt Programming
    Replies: 1
    Last Post: 13th March 2013, 01:34
  2. Unable to Compile qextserialport on max os 10.6
    By KenJustKen in forum Qt Programming
    Replies: 1
    Last Post: 16th March 2012, 20:22
  3. Unable to compile an Example
    By learner in forum Newbie
    Replies: 11
    Last Post: 15th November 2010, 15:27
  4. Replies: 1
    Last Post: 7th August 2008, 13:46
  5. fftw unable to compile
    By superutsav in forum General Programming
    Replies: 7
    Last Post: 24th January 2006, 14:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.