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. Fail to build .lib on Windows

Fail to build .lib on Windows

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 1.2k Views 1 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.
  • D Offline
    D Offline
    Dick Balaska
    wrote on last edited by
    #1

    I have a project qtpovray (an eclipse-like IDE for povray) It works great on Linux; I can't get it built on Windows.
    There is a master .pro and (3) lib .pros and a gui .pro.
    One of the libs builds fine (libpovray). 2 do not (vfe and platform). nmake skips the compile step and tries to link non-existent objects. I tried loading the failing lib as a stand-alone project but I can't see what I'm doing wrong. (I also loaded libpovray as a stand-alone project and it builds fine). Here is the failing vfe .pro followed by the build output. I've tried gargling dragon tears while cleaning and rerunning qmake, but it didn't help. Annoyingly, this .pro looks remarkably similar to libpovray .pro, which does build. The generated Makefile.debug(s) look nominally similar, too. Any help/advice/sympathies greatly appreciated.

    # vfe.pro - qmake for povray/vfe
    
    QT       -= gui
    
    TEMPLATE = lib
    TARGET = vfe
    CONFIG += staticlib warn_off
    CONFIG += object_parallel_to_source
    CONFIG += c++11
    CONFIG += precompile_header
    
    
    QMAKE_CLEAN += libvfe.a
    
    vDIR = ../../vfe
    vqDIR = ../../vfe/qt
    
    INCLUDEPATH += $$vDIR
    INCLUDEPATH += $$vqDIR
    
    SOURCES += \
        $$vDIR/vfecontrol.cpp \
        $$vDIR/vfedisplay.cpp \
        $$vDIR/vfepovms.cpp \
        $$vDIR/vfesession.cpp \
        $$vqDIR/qtvfe.cpp \
        $$vqDIR/qtgraphics.cpp \
        $$vqDIR/qtoptions.cpp \
        $$vqDIR/vfeplatform.cpp
    
    

    build output:

    23:11:22: Running steps for project vfe...
    23:11:22: Configuration unchanged, skipping qmake step.
    23:11:22: Starting: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"
        "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f Makefile.Debug
        lib /NOLOGO  /OUT:debug\vfe.lib @C:\Users\dick\AppData\Local\Temp\nm1F03.tmp
    LINK : fatal error LNK1181: cannot open input file 'debug\Users\dick\povray\github\qtpovray\qtpovray\vfe\vfecontrol.obj'
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\lib.EXE"' : return code '0x49d'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'
    Stop.
    23:11:22: The process "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" exited with code 2.
    
    
    kshegunovK 1 Reply Last reply
    0
    • D Dick Balaska

      I have a project qtpovray (an eclipse-like IDE for povray) It works great on Linux; I can't get it built on Windows.
      There is a master .pro and (3) lib .pros and a gui .pro.
      One of the libs builds fine (libpovray). 2 do not (vfe and platform). nmake skips the compile step and tries to link non-existent objects. I tried loading the failing lib as a stand-alone project but I can't see what I'm doing wrong. (I also loaded libpovray as a stand-alone project and it builds fine). Here is the failing vfe .pro followed by the build output. I've tried gargling dragon tears while cleaning and rerunning qmake, but it didn't help. Annoyingly, this .pro looks remarkably similar to libpovray .pro, which does build. The generated Makefile.debug(s) look nominally similar, too. Any help/advice/sympathies greatly appreciated.

      # vfe.pro - qmake for povray/vfe
      
      QT       -= gui
      
      TEMPLATE = lib
      TARGET = vfe
      CONFIG += staticlib warn_off
      CONFIG += object_parallel_to_source
      CONFIG += c++11
      CONFIG += precompile_header
      
      
      QMAKE_CLEAN += libvfe.a
      
      vDIR = ../../vfe
      vqDIR = ../../vfe/qt
      
      INCLUDEPATH += $$vDIR
      INCLUDEPATH += $$vqDIR
      
      SOURCES += \
          $$vDIR/vfecontrol.cpp \
          $$vDIR/vfedisplay.cpp \
          $$vDIR/vfepovms.cpp \
          $$vDIR/vfesession.cpp \
          $$vqDIR/qtvfe.cpp \
          $$vqDIR/qtgraphics.cpp \
          $$vqDIR/qtoptions.cpp \
          $$vqDIR/vfeplatform.cpp
      
      

      build output:

      23:11:22: Running steps for project vfe...
      23:11:22: Configuration unchanged, skipping qmake step.
      23:11:22: Starting: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"
          "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f Makefile.Debug
          lib /NOLOGO  /OUT:debug\vfe.lib @C:\Users\dick\AppData\Local\Temp\nm1F03.tmp
      LINK : fatal error LNK1181: cannot open input file 'debug\Users\dick\povray\github\qtpovray\qtpovray\vfe\vfecontrol.obj'
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\lib.EXE"' : return code '0x49d'
      Stop.
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'
      Stop.
      23:11:22: The process "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" exited with code 2.
      
      
      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @Dick-Balaska said in Fail to build .lib on Windows:

      CONFIG += object_parallel_to_source

      Try removing this one. If that fixes it, then you have your culprit. As a side note, could you provide the master project file and the application project file where you link the libraries. Do you use subdirs? Do you have PRE_TARGETDEPS?

      Read and abide by the Qt Code of Conduct

      D 1 Reply Last reply
      1
      • kshegunovK kshegunov

        @Dick-Balaska said in Fail to build .lib on Windows:

        CONFIG += object_parallel_to_source

        Try removing this one. If that fixes it, then you have your culprit. As a side note, could you provide the master project file and the application project file where you link the libraries. Do you use subdirs? Do you have PRE_TARGETDEPS?

        D Offline
        D Offline
        Dick Balaska
        wrote on last edited by
        #3

        @kshegunov said in Fail to build .lib on Windows:

        @Dick-Balaska said in Fail to build .lib on Windows:

        CONFIG += object_parallel_to_source

        Try removing this one.

        Oy. That was it. I'm irked that I didn't think to try that. Thanks.
        Now I can move on and deal with the odd compile errors (i.e. shared_ptr ambiguous between boost:: and std::)

        As a side note, could you provide the master project file and the application project file where you link the libraries. Do you use subdirs? Do you have PRE_TARGETDEPS?

        I don't have any PRE_TARGETDEPS.
        I just order the build so the libs get built before the app.
        Like so:

        # qtpovray.pro - Top level Qt build file
        TEMPLATE = subdirs
        DEFINES += QT_DEPRECATED_WARNINGS
        
        SUBDIRS = qt/vfe \
                    qt/libpovray \
                    qt/platform \
                    qt/gui
        
        CONFIG += ordered
        
        PACKAGE_NAME = "qtpovray"
        

        Here is the application project file on github. The win32 chants are from another project of mine (single .pro for win32|unix) and obviously I haven't got to this stage yet with this project.

        Thanks again.

        aha_1980A 1 Reply Last reply
        0
        • D Dick Balaska

          @kshegunov said in Fail to build .lib on Windows:

          @Dick-Balaska said in Fail to build .lib on Windows:

          CONFIG += object_parallel_to_source

          Try removing this one.

          Oy. That was it. I'm irked that I didn't think to try that. Thanks.
          Now I can move on and deal with the odd compile errors (i.e. shared_ptr ambiguous between boost:: and std::)

          As a side note, could you provide the master project file and the application project file where you link the libraries. Do you use subdirs? Do you have PRE_TARGETDEPS?

          I don't have any PRE_TARGETDEPS.
          I just order the build so the libs get built before the app.
          Like so:

          # qtpovray.pro - Top level Qt build file
          TEMPLATE = subdirs
          DEFINES += QT_DEPRECATED_WARNINGS
          
          SUBDIRS = qt/vfe \
                      qt/libpovray \
                      qt/platform \
                      qt/gui
          
          CONFIG += ordered
          
          PACKAGE_NAME = "qtpovray"
          

          Here is the application project file on github. The win32 chants are from another project of mine (single .pro for win32|unix) and obviously I haven't got to this stage yet with this project.

          Thanks again.

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Dick-Balaska

          https://blog.rburchell.com/2013/10/every-time-you-configordered-kitten-dies.html

          Qt has to stay free or it will die.

          D 1 Reply Last reply
          2
          • aha_1980A aha_1980

            @Dick-Balaska

            https://blog.rburchell.com/2013/10/every-time-you-configordered-kitten-dies.html

            D Offline
            D Offline
            Dick Balaska
            wrote on last edited by
            #5

            @aha_1980 said in Fail to build .lib on Windows:

            @Dick-Balaska

            https://blog.rburchell.com/2013/10/every-time-you-configordered-kitten-dies.html

            Interesting. I originally used blah.depends (I deleted those commented out lines from my .pro paste) but had issues on one platform or another. I don't have any issues with multi-core builds. My first step opening a new project is to add -j4 to the make, but having come from the ./configure world, I'm ok with it finishing building one library before moving on to the next.
            I don't want to kill any kittens, so I'll give it another go.

            aha_1980A 1 Reply Last reply
            0
            • D Dick Balaska

              @aha_1980 said in Fail to build .lib on Windows:

              @Dick-Balaska

              https://blog.rburchell.com/2013/10/every-time-you-configordered-kitten-dies.html

              Interesting. I originally used blah.depends (I deleted those commented out lines from my .pro paste) but had issues on one platform or another. I don't have any issues with multi-core builds. My first step opening a new project is to add -j4 to the make, but having come from the ./configure world, I'm ok with it finishing building one library before moving on to the next.
              I don't want to kill any kittens, so I'll give it another go.

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Dick-Balaska

              That is, because the toplevel pro file is already messed up.

              SUBDIRS = qt/libpovray
              qt/platform
              qt/vfe
              qt/gui

              I'd recommend you, to put a new subdirs qt.pro in the directory qt, and just to reference from here. should make things more easy to handle

              CONFIG += ordered

              Already said.

              qtgui.subdir = qt/gui
              qtconsole.subdir = qt/console
              qtwebsockets.subdir = qt/websockets

              This will be the biggest problem, as the first part should be the one you add to the SUBDIRS list...

              qtgui.depends = libpovray platform
              qtconsole.depends = libpovray
              qtwebsockets.depends = libpovray

              ... which is why this one is not working. correctly.

              You can re-read about SUBDIRS here: https://wiki.qt.io/SUBDIRS_-_handling_dependencies

              Regards

              Qt has to stay free or it will die.

              D 1 Reply Last reply
              1
              • aha_1980A aha_1980

                @Dick-Balaska

                That is, because the toplevel pro file is already messed up.

                SUBDIRS = qt/libpovray
                qt/platform
                qt/vfe
                qt/gui

                I'd recommend you, to put a new subdirs qt.pro in the directory qt, and just to reference from here. should make things more easy to handle

                CONFIG += ordered

                Already said.

                qtgui.subdir = qt/gui
                qtconsole.subdir = qt/console
                qtwebsockets.subdir = qt/websockets

                This will be the biggest problem, as the first part should be the one you add to the SUBDIRS list...

                qtgui.depends = libpovray platform
                qtconsole.depends = libpovray
                qtwebsockets.depends = libpovray

                ... which is why this one is not working. correctly.

                You can re-read about SUBDIRS here: https://wiki.qt.io/SUBDIRS_-_handling_dependencies

                Regards

                D Offline
                D Offline
                Dick Balaska
                wrote on last edited by
                #7

                @aha_1980 said in Fail to build .lib on Windows:

                You can re-read about SUBDIRS here: https://wiki.qt.io/SUBDIRS_-_handling_dependencies

                Thanks. I got it straightened out. Interesting that the first half of that article is about CONFIG += ordered ;)

                kshegunovK 1 Reply Last reply
                0
                • D Dick Balaska

                  @aha_1980 said in Fail to build .lib on Windows:

                  You can re-read about SUBDIRS here: https://wiki.qt.io/SUBDIRS_-_handling_dependencies

                  Thanks. I got it straightened out. Interesting that the first half of that article is about CONFIG += ordered ;)

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

                  @Dick-Balaska said in Fail to build .lib on Windows:

                  Interesting that the first half of that article is about CONFIG += ordered

                  Know thy enemy! ;)

                  Read and abide by the Qt Code of Conduct

                  1 Reply Last reply
                  0

                  • Login

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