Page 1 of 1

[SOLVED] Error when compiling with MSVC 2008

Posted: Fri Mar 29, 2013 9:41 pm
by misiak.mail
Hi,

I would like to try to develop a little, however I can't get past qBittorrent compilation on a Windows 8 (64-bit) machine using MSVC 2008.

I did everything, step-by-step, accordingly to this tutorial:
https://github.com/qbittorrent/qBittorr ... linkage%29

The message I get
LNK1181: cannot open input file 'C:/qBittorrent/boost_1_53_0/stage/lib/.obj'
File not found
I would be really grateful if you could give me any hints on what's wrong.

BTW. the structure of my folders containing the libraries is the same as in the tutorial:
https://github.com/qbittorrent/qBittorr ... linkage%29

Thanks in advance :D
misiak


EDIT

Some output from the compiler with more details

Code: Select all

23:01:46: Running steps for project qbittorrent...
23:01:46: Configuration unchanged, skipping qmake step.
23:01:46: Starting: "C:\Qt\qtcreator-2.5.2\bin\jom.exe" 
	cd src\ && C:\Qt\qtcreator-2.5.2\bin\jom.exe -f Makefile
Qt: Untested Windows version 6.2 detected!
	C:\Qt\qtcreator-2.5.2\bin\jom.exe -f Makefile.Release
Qt: Untested Windows version 6.2 detected!
Qt: Untested Windows version 6.2 detected!
	link /LIBPATH:"c:\qBittorrent\qt-everywhere-opensource-src-4.8.4\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /LTCG /DEBUG /INCREMENTAL:NO /NODEFAULTLIB:MSVCRT /MANIFEST /MANIFESTFILE:"release\qbittorrent.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:release\qbittorrent.exe @C:\Users\Admin~1\AppData\Local\Temp\qbittorrent.exe.11032.219.jom
LINK : fatal error LNK1181: cannot open input file 'C:/qBittorrent/boost_1_53_0/stage/lib/.obj'
jom: C:\qBittorrent\qbittorrent-build-desktop-Qt_4_8_4_-_MSVC2008_Release\src\Makefile.Release [release\qbittorrent.exe] Error 1181
jom: C:\qBittorrent\qbittorrent-build-desktop-Qt_4_8_4_-_MSVC2008_Release\src\Makefile [release] Error 2
jom: C:\qBittorrent\qbittorrent-build-desktop-Qt_4_8_4_-_MSVC2008_Release\Makefile [sub-src-make_default] Error 2
23:01:53: The process "C:\Qt\qtcreator-2.5.2\bin\jom.exe" exited with code 2.
Error while building/deploying project qbittorrent (target: Desktop)
When executing step 'Make'

Re: Error when compiling with MSVC 2008

Posted: Sat Mar 30, 2013 1:45 am
by sledgehammer_999
Can you post your winconf.pri file?
Sidenote: I am maintaining the wiki page since I am the Windows packager. Also I do my builds on Windows XP sp2 32bit. I just hope that the OS version doesn't matter.

Re: Error when compiling with MSVC 2008

Posted: Sat Mar 30, 2013 11:41 am
by misiak.mail
Thank you for the response.

Here is my winconf file:

Code: Select all

# Adapt these paths on Windows

#Point this to the boost include folder
INCLUDEPATH += $$quote(C:/qBittorrent/boost_1_53_0/)
#Point this to the libtorrent include folder
#INCLUDEPATH += $$quote(C:/qBittorrent/RC_0_16/include)
INCLUDEPATH += $$quote(C:/qBittorrent/libtorrent-rasterbar-0.16.9/include/)
#Point this to the zlib include folder
INCLUDEPATH += $$quote(C:/qBittorrent/zlib-1.2.7/)
#Point this to the openssl include folder
INCLUDEPATH += $$quote(C:/qBittorrent/openssl-1.0.1e/include/)

#Point this to the boost lib folder
LIBS += $$quote(C:/qBittorrent/boost_1_53_0/stage/lib/)
#Point this to the libtorrent lib folder
LIBS += $$quote(C:/qBittorrent/libtorrent-rasterbar-0.16.9/bin/msvc-9.0/release/boost-source/encryption-openssl/geoip-static/link-static/runtime-link-static/threading-multi/)
#Point this to the zlib lib folder
LIBS += $$quote(C:/qBittorrent/zlib-1.2.7/)
#Point this to the openssl lib folder
LIBS += $$quote(C:/qBittorrent/install/lib/)

# LIBTORRENT DEFINES
DEFINES += BOOST_ALL_NO_LIB
DEFINES += BOOST_ASIO_HASH_MAP_BUCKETS=1021
DEFINES += BOOST_ASIO_SEPARATE_COMPILATION
DEFINES += BOOST_EXCEPTION_DISABLE
DEFINES += BOOST_SYSTEM_STATIC_LINK=1
DEFINES += TORRENT_USE_OPENSSL
DEFINES += UNICODE
DEFINES += _UNICODE
DEFINES += WIN32
DEFINES += _WIN32
DEFINES += WIN32_LEAN_AND_MEAN
DEFINES += _WIN32_WINNT=0x0500
DEFINES += _WIN32_IE=0x0500
DEFINES += _CRT_SECURE_NO_DEPRECATE
DEFINES += _SCL_SECURE_NO_DEPRECATE
DEFINES += __USE_W32_SOCKETS
DEFINES += _FILE_OFFSET_BITS=64
DEFINES += WITH_SHIPPED_GEOIP_H

CONFIG(debug, debug_and_release) {
  DEFINES += TORRENT_DEBUG
} else {
  DEFINES += NDEBUG
}

#Enable backtrace support
CONFIG += strace_win

strace_win:{
  DEFINES += STACKTRACE_WIN
  FORMS += stacktrace_win_dlg.ui
  HEADERS += stacktrace_win.h \
             stacktrace_win_dlg.h
}

win32-g++ {
  include(winconf-mingw.pri)
}
else {
  include(winconf-msvc.pri)
}

DEFINES += WITH_GEOIP_EMBEDDED
message("On Windows, GeoIP database must be embedded.")

and my winconf-msvc file:

Code: Select all

strace_win:{
  contains(QMAKE_HOST.arch, x86):{
    # i686 arch requires frame pointer preservation
    QMAKE_CXXFLAGS_RELEASE += -Oy-
    QMAKE_CXXFLAGS_DEBUG += -Oy-
  }
  release:{
    QMAKE_CXXFLAGS_RELEASE += -Zi
    QMAKE_LFLAGS += "/DEBUG"
  }
  LIBS += dbghelp.lib
}

RC_FILE = qbittorrent.rc

# Enable Wide characters
DEFINES += TORRENT_USE_WPATH

#Adapt the lib names/versions accordingly
CONFIG(debug, debug_and_release) {
  LIBS += libtorrentd.lib \
          libboost_system-vc90-mt-s-1_53.lib
} else {
  LIBS += libtorrent.lib \
          libboost_system-vc90-mt-s-1_53.lib
}

LIBS += advapi32.lib shell32.lib crypt32.lib
LIBS += libeay32.lib ssleay32.lib
LIBS += PowrProf.lib
LIBS += zlib.lib

Also another matter was that when I first tried compiling I was getting a bunch of errors saying that variables were not declared or could not be identified. However I realized that all of the errors occurred because Qt Creator had a problem with files in the C:\qBittorrent\openssl-1.0.1e\include\openssl catalog.
It was saying that there is a syntax error in these kind of files:

Code: Select all

../../crypto/bn/bn.h
And it could not get to the headers located outside the include/openssl catalog as it wanted to.
This is why i changed all of the files correspondingly:

Code: Select all

#include "../../crypto/bn/bn.h"
After the change I was left only with one error that I mentioned earlier in my first post.

Once more. Big thanks :D

Re: Error when compiling with MSVC 2008

Posted: Sat Mar 30, 2013 12:49 pm
by misiak.mail
Solved the mystery!
When you asked me for the winconf file I decided to investigate the files once more and what has actually happened was that in paths to the lib folders I had forgotten the "-L" in front of the path.
So I had e.g.

Code: Select all

LIBS += $$quote(C:/qBittorrent/boost_1_53_0/stage/lib/)
instead of the correct

Code: Select all

LIBS += $$quote(-LC:/qBittorrent/boost_1_53_0/stage/lib/)
Now the application compiles!
But two things leave me wondering.
What's the "-L"? What does it do?
And why are the files in the C:\qBittorrent\openssl-1.0.1e\include\openssl catalog without the #include headers?

Cheers
misiak