Use QT, OpenGL FAQ 1--glut on Mac

Source: Internet
Author: User
Tags win32

: -1:error:symbol (s) not found for architecture x86_64

: -1:error:linker command failed with exit code 1 (use-v to see invocation)

The above error is reported when using the glut library. Of course, when using other third-party libraries, there will be problems, the following solutions can be analogous.

Prior to this, when using OpenGL, you first need to add the Qt+=opengl in the. Pro file

After continuing the error, it may be because QT is not upgraded after the Mac system upgrade, because QT is compiled with Xcode, and the new Xcode call OS X 10.9, but QT has not been updated, or 10.6.

Change.. In the/qt5.2.0/5.2.0-rc1/clang_64/mkspecs/macx-clang/qmake.conf fileQMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6,

QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9,then the QT to the project first clean, then rebuild, you can compile.

is not working properly, it may be necessary to load a third-party library, using the Add Library,glut in the Mac is Xcode,/system/library/frameworks/ Glut.framework, and then you can compile, and the. Pro file Changes there

 
   Win32:config (Release, debug|release): LIBS +-l$ $PWD/. /.. /.. /.. /.. /system/library/frameworks/release/-lglut
Else:win32:CONFIG (Debug, Debug|release): LIBS + =-l$ $PWD/. /.. /.. /.. /.. /system/library/frameworks/debug/-lglut
Else:mac:LIBS + =-f$ $PWD/.. /.. /.. /.. /.. /system/library/frameworks/-framework GLUT
Else:unix:LIBS + =-l$ $PWD/.. /.. /.. /.. /.. /system/library/frameworks/-lglut
Includepath + = $ $PWD/.. /.. /.. /.. /.. /system/library/frameworks
Dependpath + = $ $PWD/.. /.. /.. /.. /.. /system/library/frameworks
Compile successfully!
 
   

Use QT, OpenGL FAQ 1--glut on Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.