Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

:-1: error: cannot find -lPythonQt-Qt5-Python3.8_d



  • I am trying to use PythonQt in my Qt c++ application to embed python script in my application, I have build the PythonQt successfully in my system and also tested all it's examples and they all are working perfectly but when I tried to use it with my application it gives me following error.

    :-1: error: cannot find -lPythonQt-Qt5-Python3.8_d



  • @devillIsHeree said in :-1: error: cannot find -lPythonQt-Qt5-Python3.8_d:

    -lPythonQt-Qt5-Python3.8_d

    Purely at a guess, is that _d suffix for a debug library and you don't have that? Have a search on your disk, do you have any similarly-named library at all?



  • What do you mean by similar named library? @JonB



  • @devillIsHeree
    Any file at all with PythonQt-Qt5-Python3.8 (without the _d) in it, just to see what you have, e.g.

    • Linux: locate 'PythonQt-Qt5-Python3.8'
    • Windows: dir/s/b C:\ | findstr "PythonQt-Qt5-Python3.8"


  • @JonB I have ubuntu, I have run your provided command, It is showing me those results

    /usr/lib/libPythonQt-Qt5-Python3.8.so
    /usr/lib/libPythonQt-Qt5-Python3.8.so.3
    /usr/lib/libPythonQt-Qt5-Python3.8.so.3.2
    /usr/lib/libPythonQt-Qt5-Python3.8.so.3.2.0
    
    


  • @devillIsHeree
    Which is what I kind of wondered might show up. But as I said your error message, assuming you copy/pasted it, reads:

    -lPythonQt-Qt5-Python3.8_d

    If it read -lPythonQt-Qt5-Python3.8 it would link against those libraries you do have. But it has that trailing _d, so will not. Which I suspect is something to do with wanting a debug version of the library. Which you don't have.

    So have a look at wherever that line comes from. Is it supposed to be debug? Are you supposed to download/install a debug version of this PythonQt library?



  • @JonB Actually I had install PythonQt to use the python embedding in Qt c++, This line is coming from the file
    PythonQt.prf. This is the link to that file https://github.com/MeVisLab/pythonqt/blob/master/build/PythonQt.prf

    @JonB and I just watnt o use that PythonQt in my code, It is PythonQt only which wanted to have that debug file I suppose but I don't know how to resolve this Please help



  • @devillIsHeree said in :-1: error: cannot find -lPythonQt-Qt5-Python3.8_d:

    https://github.com/MeVisLab/pythonqt/blob/master/build/PythonQt.prf

    Yes, and I see that has:

    # check if debug or release
    CONFIG(debug, debug|release) {
      DEBUG_EXT = _d 
    } else {
      DEBUG_EXT = 
    }
    ...
    unix: LIBS += -L$$DESTDIR/../lib -lPythonQt-Qt5-Python$${PYTHON_VERSION}$${DEBUG_EXT}
    

    So either don't build for debug/get rid of using the DEBUG_EXT = _d under Linux at least, or somewhere (presumably) you can fetch (or build) the Linux debug libraries with _d on them.



  • Thanks @JonB sir, I just remove all the DEBUG_ext line
    so now my all ```.prf.. files look like that

    CONFIG(debug, debug|release) {
      DEBUG_EXT =
    } else {
      DEBUG_EXT = 
    }
    

    and they're compiling well. Thanks for the help


Log in to reply