Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Undefined identifier on Mac
Forum Updated to NodeBB v4.3 + New Features

Undefined identifier on Mac

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 2 Posters 386 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JP Larson
    wrote on last edited by
    #1

    Okay, this keeps coming back. I get it solved for a while, but then I do an OS upgrade or something, and it comes back, and I must be doing something wrong. I haven't been able to make this go away this time.

    For this question, I'm using Qt as an IDE. I'm not doing GUI code. I'm targeting Linux -- I use a docker Ubuntu instance for builds, although I can also build under Mac with the same makefile.

    However, even though Make is entirely happy, Qt is not.

    exit(0); <-- Qt IDE complains about undefined identifier
    

    I've tried including stdlib.h. I've tried including cstdlib. Both resolve somewhere down in the general vicinity of /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1, which is another of my Mac complaints, but be that as it may.

    This is my TestApps.pro file:

    TEMPLATE = app
    
    CONFIG += c++11 sdk_no_version_check
    CONFIG -= app_bundle
    CONFIG -= qt
    
    INCLUDEPATH += /usr/local/include
    INCLUDEPATH += ../../CT-StandardLibrary/src
    INCLUDEPATH += ../../CT-StandardLibrary/src/includes
    
    LIBS += -L/usr/local/lib -L../../CT-StandardLibrary/lib -lvitac-mac -lhiredis
    LIBS += -framework CoreFoundation
    LIBS += -lz -llog4cplus -lpthread -lcurl -lcrossguid  -lboost_system -lboost_thread-mt -lboost_filesystem -levent -lssl -lcrypto
    
    RunTestEvent {
            TARGET = RunTestEvent
    }
    
    SOURCES += \
        src/RunTestEvent.cpp \
        src/TestEventConfiguration.cpp
    
    HEADERS += \
        src/TestEventConfiguration.h
    

    I tend to see these errors on calls to pretty much all the old-style C calls. I've tried things I don't think would work like prepending :: or std:: to the calls.

    I suspect this is due to the weirdness of Xcode include files. Is there magic to just make this go away?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What version of Qt ?
      What version of Qt Creator ?
      What version of Xcode ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JP Larson
        wrote on last edited by
        #3

        Qt 5.14.2 (CLang 10 (Apple), 64-Bit)
        Qt Creator 4.12.0

        Xcode 11.5, which is a couple months old.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Sorry, I don't have that version yet.

          In any case, can you provide a minimal compilable example that shows that issue ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved