Results 1 to 5 of 5

Thread: Compiling problems from XCode using the xcodeproj file as generated by qmake

  1. #1
    Join Date
    Apr 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Compiling problems from XCode using the xcodeproj file as generated by qmake

    Hi guys,

    I need help from you. I used gmake -macx filename.pro command to generate the .xcodeproj file. After opening this file in Xcode and compiling the C++ sources files, I've got thousands of errors related to C/C++ standard code and Qt included headers.
    I have the impression that the code is considered by xcode as C code not C++ since the errors are related to the string.h interpretation, the public class statement is not known, "using namespace" statements not known , etc.
    If generating the Makefile and compiling the source code with make command from command line, everything works fine.
    Could you please tell me what should I add to the pro file (preferably) or in XCode to get rid of those errors related to C/C++ standard code?
    Please note that if creating a new project in XCode, there I have the possibility to specify the project type (i.e C++ standard application) and the code added there is compiled well.
    I have the above mentioned problem only with the xcodeproj files generated with qmake.

    Thanks in advance for your help!

  2. #2
    Join Date
    Apr 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Compiling problems from XCode using the xcodeproj file as generated by qmake

    I finally managed to fix the issue. It was caused by the PRECOMPILED_HEADER statement in the .pro file.
    Have a good day!

  3. #3
    Join Date
    Jun 2007
    Location
    Plymouth, UK
    Posts
    36
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Compiling problems from XCode using the xcodeproj file as generated by qmake

    I've never experienced this issue before. By the way, within the .pro file you can manually specify the C++ compiler you want to be used by Xcode by default, using the parameter QMAKE_CXX. Here a standard .pro file I use for most of my projects developed on Mac OS:

    Qt Code:
    1. TEMPLATE = app
    2. TARGET =
    3. DEPENDPATH += .
    4.  
    5. # Compiler to be used
    6. QMAKE_CXX = g++-4.2
    7.  
    8. # Application configuration
    9. CONFIG += qt warn_off release x86_64 x86
    10.  
    11. # Application icon
    12. ICON = icon.icns
    13.  
    14. # OpenGL and XML Qt Frameworks
    15. QT += opengl
    16. QT += xml
    17.  
    18. # MacOS/Linux
    19. macx {
    20.  
    21. # Libraries
    22. INCLUDEPATH += /usr/local/include/
    23. LIBS += /usr/local/lib/libnnfw.a
    24. #LIBS += -lIrrlicht
    25. LIBS += /usr/local/lib/libIrrlicht.a
    26.  
    27. # Frameworks
    28. LIBS += -framework Carbon
    29. LIBS += -framework Cocoa
    30.  
    31. }
    32.  
    33. # Windows
    34. win32 {
    35.  
    36. # Libraries
    37. INCLUDEPATH += "C:\nnfw-1.1.5-src\include"
    38. INCLUDEPATH += "C:\irrlicht-1.7.1\include"
    39. LIBS += "C:\nnfw-1.1.5-src\lib\Release\nnfw.lib"
    40. LIBS += "C:\irrlicht-1.7.1\lib\Win32-visualstudio\Irrlicht.lib"
    41.  
    42. }
    43.  
    44. # Input files
    45. SOURCES += main.cpp \
    46. simulatorEngine.cpp \
    47. team.cpp \
    48. mav.cpp \
    49. nn.cpp \
    50. target.cpp \
    51. irrlichtGUI.cpp \
    52. eventReceiver.cpp
    53.  
    54. HEADERS += simulatorEngine.h \
    55. team.h \
    56. mav.h \
    57. nn.h \
    58. target.h \
    59. simulationParameters.h \
    60. irrlichtGUI.h \
    61. eventReceiver.h
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Apr 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Compiling problems from XCode using the xcodeproj file as generated by qmake

    Thanks for your answer.
    BTW, have you ever mixed cpp files with m files in the same .pro file?
    I have such a case, and the xcodeproj file give an error about the "Qt Preprocessors" script (something related to "No rule to make target '../folder/myfile.h' ").

    The error in xcodeproj looks like this:
    c -D_DEBUG -DUNICODE ... -I/usr/llocal/Qt4.6/....

    Make: c: No such file or directory

    Does this mean something for you?

    Thanks.

  5. #5
    Join Date
    Apr 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Compiling problems from XCode using the xcodeproj file as generated by qmake

    I found meanwhile that is a bug logged already on this issue at the Qt Team:
    http://bugreports.qt.nokia.com/browse/QTBUG-7953

    Have a good day!

Similar Threads

  1. Problems compiling QMAKE
    By JNT in forum Installation and Deployment
    Replies: 4
    Last Post: 9th January 2007, 17:23
  2. help explaining qmake generated make file
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2006, 09:54
  3. Replies: 3
    Last Post: 12th January 2006, 17:41
  4. Replies: 1
    Last Post: 11th January 2006, 14:15

Tags for this Thread

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.