I am trying to compile a project on the command line on Maverick 10.9. The project compiles fine on Linux. It seems that there is a problem with ctime on MacOSX. Mistakes
$ make Compiling src//core/AbstractARAClient.cpp In file included from src//core/AbstractARAClient.cpp:5: In file included from include/AbstractARAClient.h:8: In file included from include/ARAMacros.h:14: In file included from include/Address.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream:174: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:131: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:18: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex:176: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base:15: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:279: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ctime:56:9: error: no member named 'clock_t' in the global namespace using ::clock_t; ~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ctime:58:9: error: no member named 'time_t' in the global namespace; did you mean 'size_t'? using ::time_t; ~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h:42:23: note: 'size_t' declared here typedef __SIZE_TYPE__ size_t; In file included from src//core/AbstractARAClient.cpp:5: In file included from include/AbstractARAClient.h:8: In file included from include/ARAMacros.h:14: In file included from include/Address.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream:174: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:131: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:18: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex:176: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base:15: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:279: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ctime:60:9: error: no member named 'clock' in the global namespace using ::clock; ~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ctime:61:9: error: no member named 'difftime' in the global namespace using ::difftime; ~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ctime:62:9: error: no member named 'mktime' in the global namespace using ::mktime; ~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ctime:63:9: error: no member named 'time' in the global namespace using ::time;
I searched on the Internet and there seems to be a problem if the project has headers named "time.h" (as is the case with this project). In general, there is also a problem with the actual incomplete implementation of ctime (but, as a rule, people refer to installation command-line commands through xcode).
I am wondering what the general problem is, and finally, how to compile the code on a Mac. Unlike the code in the repository, I added the stdlib parameter to line 53 of the Makefile
CFLAGS_DEBUG = -g -Wall -stdlib=libc++
The C ++ 11 parameter is already set in the previous line of the Makefile.
TIA
c ++ clang ++ macos ctime
user1729210
source share