Fail to build .lib on Windows
-
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.
-
@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 havePRE_TARGETDEPS
? -
@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 havePRE_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_1980 said in Fail to build .lib on Windows:
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. -
That is, because the toplevel pro file is already messed up.
SUBDIRS = qt/libpovray
qt/platform
qt/vfe
qt/guiI'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/websocketsThis 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
-
@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
;) -
@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! ;)