Qt5.2.1 Mac 10.9 Undefined symbols for architecture x86_64 오류 해결

3317 단어
Mac 10.9.2를 업데이트한 후 이전 Qt 프로그램 실행에서 다음 오류가 발생했습니다.
Undefined symbols for architecture x86_64:

  "___sincos_stret", referenced from:
      ...
  "___sincos_stret", referenced from:
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [trimeshview.app/Contents/MacOS/trimeshview] Error 1
14:30:06: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project trianglemesh (kit: Desktop Qt 5.2.1 clang 64bit)
When executing step 'Make'
14:30:06: Elapsed time: 00:16.

컴파일러와 sdk 버전이 일치하지 않기 때문에 프로젝트에 추가해야 합니다.
macx:QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
macx:QMAKE_MAC_SDK=macosx10.9

주: Qt에서 컴파일 문제가 발생하면 생성된makefile 파일을 직접 보고 오류 정보를 얻을 수 있습니다. 이번 오류 상태에서makefile 파일은 다음과 같습니다.
Release:


/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -isysroot /Developer/SDKs/MacOSX10.9.sdk -O2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.9 -Wall -W -fPIE -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../Tools/Qt/5.2.1/clang_64/mkspecs/macx-clang -I../trianglemesh -I../trianglemesh/include -I../../Tools/Qt/5.2.1/clang_64/lib/QtOpenGL.framework/Versions/5/Headers -I../../Tools/Qt/5.2.1/clang_64/lib/QtWidgets.framework/Versions/5/Headers -I../../Tools/Qt/5.2.1/clang_64/lib/QtGui.framework/Versions/5/Headers -I../../Tools/Qt/5.2.1/clang_64/lib/QtCore.framework/Versions/5/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I. -F/Users/zdd/Tools/Qt/5.2.1/clang_64/lib -o main.o ../trianglemesh/main.cpp

Debug:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -isysroot /Developer/SDKs/MacOSX10.9.sdk -g -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.9 -Wall -W -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../Tools/Qt/5.2.1/clang_64/mkspecs/macx-clang -I../trianglemesh -I../trianglemesh/include -I../../Tools/Qt/5.2.1/clang_64/lib/QtOpenGL.framework/Versions/5/Headers -I../../Tools/Qt/5.2.1/clang_64/lib/QtWidgets.framework/Versions/5/Headers -I../../Tools/Qt/5.2.1/clang_64/lib/QtGui.framework/Versions/5/Headers -I../../Tools/Qt/5.2.1/clang_64/lib/QtCore.framework/Versions/5/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I. -F/Users/zdd/Tools/Qt/5.2.1/clang_64/lib -o main.o ../trianglemesh/main.cpp

좋은 웹페이지 즐겨찾기