Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to prevent QtCreator from adding suffix "_d" to the libraries in the Debug mode?
Forum Updated to NodeBB v4.3 + New Features

How to prevent QtCreator from adding suffix "_d" to the libraries in the Debug mode?

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 3 Posters 2.5k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    roni219
    wrote on last edited by
    #1

    Hello,

    My Qt project links with the library python27.lib on Windows 8.1. The .pro file contains the following line:

    win32:LIBS += C:\Python27_11\libs\python27.lib
    

    When building the project in Release mode, it links correctly with python27.lib.

    When building the project in Debug mode, it looks for python27_d.lib:

    Error: LNK1104: cannot open file 'python27_d.lib'
    

    How to enforce linking with python27.lib in the Debug mode?

    Thank you in advance!

    Roni.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Looks pretty strange. AFAIK, Qt Creator doesn't do such thing (it just use qmake under the hood)

      What version of Qt and Qt Creator are you using ?

      On a side note, you should always use forward slashes when using Qt even on Windows. It will be handled properly for you.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • R Offline
        R Offline
        roni219
        wrote on last edited by roni219
        #3

        Thank you for the response, SGaist. I agree that it might be qmake doing. However it's input must be based on parameters passed down to it by QtCreator when the Debug mode is selected.

        The version info:
        Qt Creator 3.5.1 (opensource)
        Based on Qt 5.5.1 (MSVC 2013, 32 bit)
        The OS is Windows 8.1 Pro 64 bit

        Please see the complete compile output below. Thank you!

        15:33:51: Running steps for project python...
        15:33:51: Starting: "C:\Qt\5.5\msvc2012\bin\qmake.exe" C:\Test\src\experimental\python.pro -r -spec win32-msvc2012 "CONFIG+=debug"
        15:33:52: The process "C:\Qt\5.5\msvc2012\bin\qmake.exe" exited normally.
        15:33:52: Starting: "C:\Qt\Tools\QtCreator\bin\jom.exe" 
        	C:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
        	cl -c -nologo -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -EHsc /Fddebug\my_python.pdb -DUNICODE -DWIN32 -DQT_GUI_LIB -DQT_CORE_LIB -I..\experimental -I. -I..\..\..\..\Python27_11\include -I..\..\..\..\Qt\5.5\msvc2012\include -I..\..\..\..\Qt\5.5\msvc2012\include\QtGui -I..\..\..\..\Qt\5.5\msvc2012\include\QtANGLE -I..\..\..\..\Qt\5.5\msvc2012\include\QtCore -Idebug -I..\..\..\..\Qt\5.5\msvc2012\mkspecs\win32-msvc2012 -Fodebug\ @C:\Users\RONISI~1\AppData\Local\Temp\python.obj.4660.16.jom
        python.cc
        ..\experimental\python.cc(3) : warning C4100: 'argc' : unreferenced formal parameter
        	echo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "debug\\my_python.exe.embed.manifest">debug\my_python.exe_manifest.rc
        	if not exist debug\my_python.exe if exist debug\my_python.exe.embed.manifest del debug\my_python.exe.embed.manifest
        	if exist debug\my_python.exe.embed.manifest copy /Y debug\my_python.exe.embed.manifest debug\my_python.exe_manifest.bak
        	link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:debug\my_python.exe.embed.manifest /OUT:debug\my_python.exe @C:\Users\RONISI~1\AppData\Local\Temp\my_python.exe.4660.422.jom
        LINK : fatal error LNK1104: cannot open file 'python27_d.lib'
        jom: C:\Test\src\build-python-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug\Makefile.Debug [debug\my_python.exe] Error 1104
        jom: C:\Test\src\build-python-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug\Makefile [debug] Error 2
        15:33:52: The process "C:\Qt\Tools\QtCreator\bin\jom.exe" exited with code 2.
        Error while building/deploying project python (kit: Desktop Qt 5.5.1 MSVC2012 32bit)
        When executing step "Make"
        15:33:52: Elapsed time: 00:01.
        
        kshegunovK 1 Reply Last reply
        0
        • R roni219

          Thank you for the response, SGaist. I agree that it might be qmake doing. However it's input must be based on parameters passed down to it by QtCreator when the Debug mode is selected.

          The version info:
          Qt Creator 3.5.1 (opensource)
          Based on Qt 5.5.1 (MSVC 2013, 32 bit)
          The OS is Windows 8.1 Pro 64 bit

          Please see the complete compile output below. Thank you!

          15:33:51: Running steps for project python...
          15:33:51: Starting: "C:\Qt\5.5\msvc2012\bin\qmake.exe" C:\Test\src\experimental\python.pro -r -spec win32-msvc2012 "CONFIG+=debug"
          15:33:52: The process "C:\Qt\5.5\msvc2012\bin\qmake.exe" exited normally.
          15:33:52: Starting: "C:\Qt\Tools\QtCreator\bin\jom.exe" 
          	C:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
          	cl -c -nologo -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -EHsc /Fddebug\my_python.pdb -DUNICODE -DWIN32 -DQT_GUI_LIB -DQT_CORE_LIB -I..\experimental -I. -I..\..\..\..\Python27_11\include -I..\..\..\..\Qt\5.5\msvc2012\include -I..\..\..\..\Qt\5.5\msvc2012\include\QtGui -I..\..\..\..\Qt\5.5\msvc2012\include\QtANGLE -I..\..\..\..\Qt\5.5\msvc2012\include\QtCore -Idebug -I..\..\..\..\Qt\5.5\msvc2012\mkspecs\win32-msvc2012 -Fodebug\ @C:\Users\RONISI~1\AppData\Local\Temp\python.obj.4660.16.jom
          python.cc
          ..\experimental\python.cc(3) : warning C4100: 'argc' : unreferenced formal parameter
          	echo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "debug\\my_python.exe.embed.manifest">debug\my_python.exe_manifest.rc
          	if not exist debug\my_python.exe if exist debug\my_python.exe.embed.manifest del debug\my_python.exe.embed.manifest
          	if exist debug\my_python.exe.embed.manifest copy /Y debug\my_python.exe.embed.manifest debug\my_python.exe_manifest.bak
          	link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:debug\my_python.exe.embed.manifest /OUT:debug\my_python.exe @C:\Users\RONISI~1\AppData\Local\Temp\my_python.exe.4660.422.jom
          LINK : fatal error LNK1104: cannot open file 'python27_d.lib'
          jom: C:\Test\src\build-python-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug\Makefile.Debug [debug\my_python.exe] Error 1104
          jom: C:\Test\src\build-python-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug\Makefile [debug] Error 2
          15:33:52: The process "C:\Qt\Tools\QtCreator\bin\jom.exe" exited with code 2.
          Error while building/deploying project python (kit: Desktop Qt 5.5.1 MSVC2012 32bit)
          When executing step "Make"
          15:33:52: Elapsed time: 00:01.
          
          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          @roni219 said:

          win32:LIBS += C:\Python27_11\libs\python27.lib

          When I link on windows I always use the *nix syntax and it has never given me any problems. Although it's a long-shot, perhaps you can try that?

          win32:LIBS += -LC:/Python27_11/libs -lpython27
          

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            roni219
            wrote on last edited by
            #5

            Thank you for the suggestion, kshegunov. Yes, I tried the syntax earlier, and the result was the same.

            kshegunovK 1 Reply Last reply
            0
            • R roni219

              Thank you for the suggestion, kshegunov. Yes, I tried the syntax earlier, and the result was the same.

              kshegunovK Offline
              kshegunovK Offline
              kshegunov
              Moderators
              wrote on last edited by
              #6

              @roni219
              This is certainly strange. Currently nothing comes to mind.
              As a sort of side note, are you using shadow building? Perhaps that is (or rather not using it is) causing the _d suffix being added ...

              Read and abide by the Qt Code of Conduct

              1 Reply Last reply
              0
              • R Offline
                R Offline
                roni219
                wrote on last edited by
                #7

                No, I do not use the shadow building.

                Based on my online research other people also experienced the issue. Unfortunately non of their posts on various forums was followed up with a solution.

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  roni219
                  wrote on last edited by
                  #8

                  Solved - the problem is with Python.h, not with QtCreator or qmake.

                  1 Reply Last reply
                  1
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Ok, that strange…

                    Thanks for sharing !

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved