Undefined identifier on Mac
-
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?
-
Hi,
What version of Qt ?
What version of Qt Creator ?
What version of Xcode ? -
Sorry, I don't have that version yet.
In any case, can you provide a minimal compilable example that shows that issue ?