Menu

Building on Xcode6

Help
2014-10-10
2014-10-13
  • Sander Stoks

    Sander Stoks - 2014-10-10

    Hello,

    I am trying to build the library on Xcode 6, Mac OS X 10.9.

    1. I’m getting errors due to toupper/tolower redefinitions. Moving #include <iostream> to the top of PythonQt.h solves this.</iostream>
    2. Building with the included .pro file, I get lots of warnings (mainly uninitialized variables etc.) and one linker error:

    Undefined symbols for architecture x86_64:
    "_PythonQtBoolResult_Type", referenced from:
    PythonQt::PythonQt(int, QByteArray const&) in PythonQt.o
    PythonQt::initPythonQtModule(bool, QByteArray const&) in PythonQt.o
    PythonQtConv::ConvertPythonToQt(PythonQtMethodInfo::ParameterInfo const&, _object, bool, PythonQtClassInfo, void*) in PythonQtConversion.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [../lib/libPythonQt.1.0.0.dylib] Error 1
    make: *** [sub-src-make_first-ordered] Error 2
    12:48:05: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project PythonQt (kit: Desktop Qt 5.3 clang 64bit)

    This is strange, because PythonQtBoolResult_Type is defined in PythonQtBoolResult.h - any idea what’s going wrong here?

    Thanks in advance,
    Sander Stoks

     
  • Florian Link

    Florian Link - 2014-10-10

    That's strange, since PythonQtBoolResult.cpp is part of the profile and should be part of your Xcode project as well. Can you verify that?

     
    • Sander Stoks

      Sander Stoks - 2014-10-10

      I’m not building from an Xcode project (since I understood that the cmake stuff wasn’t fully supported yet, and I got errors:

      MBP:build sander$ cmake ..
      CMake Error at cmake/PythonQt_Qt_5x.cmake:1 (find_package):
      By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
      asked CMake to find a package configuration file provided by "Qt5Core", but
      CMake did not find one.

      Could not find a package configuration file provided by "Qt5Core" with any
      of the following names:

      Qt5CoreConfig.cmake
      qt5core-config.cmake
      

      Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
      "Qt5Core_DIR" to a directory containing one of the above files. If
      "Qt5Core" provides a separate development package or SDK, be sure it has
      been installed.
      Call Stack (most recent call first):
      CMakeLists.txt:59 (include)

      So instead, I am building directly from the included PythonQt.pro file using Qt Creator. The PythonQtBoolResult.cpp file is indeed part of the project file there.

      On 10 Oct 2014, at 14:36, Florian Link florianlink@users.sf.net wrote:

      That's strange, since PythonQtBoolResult.cpp is part of the profile and should be part of your Xcode project as well. Can you verify that?

      Building on Xcode6

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/pythonqt/discussion/631393/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • Florian Link

    Florian Link - 2014-10-10

    Hm, you can use qmake to create an Xcode project from the profile. That's what I did when building on Mac...

     
  • Sander Stoks

    Sander Stoks - 2014-10-13

    I was busy trying that, but maybe the error was due to something else, namely that on 10.9, linking with the Python framework has changed. See http://stackoverflow.com/questions/19555395/python-framework-is-missing-from-os-x-10-9-sdk-why-also-workaround
    I did a clean checkout of the code because I noticed in another thread ("Issue Qt5.3") that some of the patches I had to make are now part of the trunk. I will also append my findings on 10.9 to that thread since I read that you're on an older Mac. See you there :-)

     
  • Sander Stoks

    Sander Stoks - 2014-10-13

    Just in case people google their way to this forum: I have been able to build the debug version of trunk (r363) using the .pro files in Qt Creator directly, using two "hacks".

    As mentioned in my previous post, Apple has changed something in how you are supposed to link against Python in 10.9, so I had to modify the python.prf file:

    unix:PYTHON_VERSION=3.4
    
    macx {
      PYTHON_CONFIG_PATH=/Library/Frameworks/Python.framework/Versions/$${PYTHON_VERSION}/bin/python$${PYTHON_VERSION}-config
      QMAKE_CXXFLAGS += $$system($${PYTHON_CONFIG_PATH} --includes)
      LIBS += $$system($${PYTHON_CONFIG_PATH} --ldflags)
    } else ...
    

    As you see, the framework is installed in /Library/Frameworks if you install a new Python version from python.org, instead of in /System/...

    After building libPythonQt.dylib itself, the rest of the build fails because it wants to link against this previous result, which it can't find. This is because (at least on my install), Qt Creator puts the build results out-of-tree. I could solve this on my system by making a symlink from /Users/sander/Documents/Develop/build-PythonQt-Desktop_Qt_5_3_clang_64bit-Debug/lib to build/lib in the PythonQt directory, and continuing the build. I verified that I got a working PyGuiExample_d. The .app binaries (such as PyGettingStarted_d.app) don't work because they can't find the libPythonQt_d.1.dylib - I'm not sure why since they're sitting right next to it.

    [EDIT: removed litany about Release build failing - the symlink was not pointing to the correct libs]

     

    Last edit: Sander Stoks 2014-10-13

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.