开发者

I cannot build Pythonqt

It is PythonQt : pythonqt.sourceforge.net. I am using PythonQt-1.1 . Qt version 4.6.2 and Python 2.6.4.10 . Visual studio 2008 From instruction:

cd PythonQtRoot  
vcvars32  
qmake  
nmake

after I typed qmake, it generated makefile, then I开发者_如何学C entered nmake but it said "makefile(22) :fatal error U1000: syntax error: ')' missing in macro invocation Stop." What did I do wrong here?

Thanks in advance....


I remember running into similar problems when building other packages with recent releases of Qt on Win32. I'm running under cygwin, by the way. After a fair amount of debugging, I discovered that 'qmake' was using the wrong 'mkspec'. One thing that helped this situation was to force the use of the correct mkspec, like so:

export QMAKESPEC=win32-msvc2008 or export QMAKESPEC=win32-msvc

To find the list of all valid mkspecs, I looked in the directory: c:\Qt\4.6.0\mkspecs or c:\Qt\2010.01\qt\mkspecs

For one particular package, I had some conflicts with other tools installed on my system and had to edit the actual mkspec file to point to the correct tool using an absolute path, but it sounds like that is not your problem here. It sounds like yours is generating a gmake-compatible Makefile instead of an nmake-compatible Makefile, so this fix should work.

-- Glenn


My suggestion is to include the PythonQt project as part of your very same project with CMake.

You then simply have to build it as part of your project statically (remove the SHARED from the add_library in the base CMakeLists.txt, by remembering that if you want it to be so, you have to remove the project(PythonQt) from its base CMakeLists.txt and then adding to your proper CMakeLists.txt base file the following:

if( PYTHON_QT_SUPPORT )
    message(STATUS ":::: Including support for PythonQT Shell ::::")
    # Include Python directories
    find_package(PythonLibs REQUIRED)
    include_directories("${PYTHON_INCLUDE_DIR}")
    # Include PythonQt 
    include_directories(YOURPATHTOPYTHONQT/pythonqt/src)
    add_subdirectory(YOURPATHTOPYTHONQT/pythonqt)
endif(PYTHON_QT_SUPPORT)


Have you made sure to update the Python/Qt versions in the build folder, and include everything you need in your environment?

In build\python.prf: update python version

Use a Visual Studio Command Prompt and skip the vcvars32.

set your environment paths:

set PATH=E:\toolkits\Trolltech\Qt-4.8.6\Win_x64_6.1_v12_debug\lib;%PATH%
set PATH=E:\toolkits\Trolltech\Qt-4.8.6\Win_x64_6.1_v12_debug\bin;%PATH%
set PYTHON_PATH=E:\toolkits\Python\2.7.9\Win_x64_6.1_v12
set PYTHON_LIB=E:\toolkits\Python\2.7.9\Win_x64_6.1_v12\libs

In those paths, you should have available:

  • all qt libraries (QtCore4.dll, etc.)
  • all qt executables (uic, moc, etc)
  • python26.dll, python.exe

I've also had to update the other .prf files to make sure the debug extensions are properly done when i'm binding on debug dlls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜