QT Creator adds -Xarch

后端 未结 3 1117
甜味超标
甜味超标 2021-01-19 04:49

I was using the QT Creator with an old GCC, now i updated to the 4.8 version. But the QT Creator adds a -Xarch_x86_64 option, the GCC 4.8 tells me

g++: error         


        
相关标签:
3条回答
  • 2021-01-19 05:16

    I had the same problem using GCC installed via MacPorts (tested several versions up to gcc5). The solution for me was using g++ supplied with the XCode command line tools. I uninstalled all MacPorts GCC versions. Below version details of the g++ command that worked.

    $ g++ --version
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
    Target: x86_64-apple-darwin13.4.0
    Thread model: posix
    
    0 讨论(0)
  • 2021-01-19 05:25

    I removed all the references using.

    QMAKE_CFLAGS_PPC_64     -= -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5
    QMAKE_OBJECTIVE_CFLAGS_PPC_64  -= -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5
    QMAKE_CFLAGS_X86_64     -= -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5
    QMAKE_OBJECTIVE_CFLAGS_X86_64  -= -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5
    QMAKE_CXXFLAGS_PPC_64   -= -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5
    QMAKE_CXXFLAGS_X86_64   -= -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5
    QMAKE_LFLAGS_PPC_64     -= -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5
    QMAKE_LFLAGS_X86_64     -= -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5
    

    It solved my problem

    0 讨论(0)
  • 2021-01-19 05:26

    Another way to resolve this problem is to edit the file for the compiler configuration for the specific qt version and the specific target build.

    See this post.

    In my case this conf file is:

    /usr/local/Qt4.8/mkspecs/common/g++-macx.conf
    

    And the changes are:

    QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=10.5
    QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=10.5
    

    to

    QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=10.7
    QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=10.7
    

    Please see the linked post from natoferreira in the Q&A of opencv website. Also this post mention this file.

    Please add a comment if you know other information about this configuration file for Qt and GCC.

    0 讨论(0)
提交回复
热议问题