Discussion:
[Quantlib-users] Error LNK1104 - cannot open file 'QuantLib-vc140-mt-s.lib'
pgopalk
2017-04-27 22:00:29 UTC
Permalink
Hi

I get the below error when i tried to build QuantLibXL_basic_vc12.sln using
VisualStudio2017 on a Windows10 machine.

Error LNK1104 cannot open file 'QuantLib-vc140-mt-s.lib' QuantLibXLStatic
C:\local\QuantLib\QuantLibXL\qlxl\LINK 1

Below is the information from the last build state. I got a pop-up to do an
auto upgrade to v141 toolset when i first loaded the solution. I see a lib
file 'QuantLib--mt-s.lib' generated but it is missing the 'vc140' string
which the linker is looking for. Can someone please help resolve this
error?

#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
Release (static runtime)|Win32|C:\local\QuantLib\QuantLibXL\|

Thanks,



--
View this message in context: http://quantlib.10058.n7.nabble.com/Error-LNK1104-cannot-open-file-QuantLib-vc140-mt-s-lib-tp18229.html
Sent from the quantlib-users mailing list archive at Nabble.com.
Mario Marra
2017-04-28 07:07:09 UTC
Permalink
It might not be an optimal solution but have you tried to rename the library
to 'QuantLib-vc140-mt-s.lib'?

Mario



--
View this message in context: http://quantlib.10058.n7.nabble.com/Error-LNK1104-cannot-open-file-QuantLib-vc140-mt-s-lib-tp18229p18230.html
Sent from the quantlib-users mailing list archive at Nabble.com.
Luigi Ballabio
2017-04-28 07:37:49 UTC
Permalink
Yes, that would work. The library was named incorrectly because your
QuantLib version doesn't support VS2017 yet, but you can rename it manually.

Luigi
Post by Mario Marra
It might not be an optimal solution but have you tried to rename the library
to 'QuantLib-vc140-mt-s.lib'?
Mario
--
http://quantlib.10058.n7.nabble.com/Error-LNK1104-cannot-open-file-QuantLib-vc140-mt-s-lib-tp18229p18230.html
Sent from the quantlib-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
https://lists.sourceforge.net/lists/listinfo/quantlib-users
ponram
2017-04-28 21:51:31 UTC
Permalink
Thanks Mario & Luigi

I tried after renaming the file to QuantLib-vc140-mt-s.lib and this time the
linker gave the same error looking for QuantLib--mt-s.lib. So i made a copy
of it to the original QuantLib--mt-s.lib and tried to build with both the
lib files. This time I didn't get that error.

However, i got a whole bunch of linking errors related to Boost library such
as below. All of my boost library files have *-vc141-mt-gd-1_64.lib such as
boost_coroutine-vc141-mt-gd-1_64.lib.

Error LNK2001 unresolved external symbol "public: static void __cdecl
boost::archive::detail::archive_serializer_map<class
boost::archive::xml_iarchive>::erase(class
boost::archive::detail::basic_serializer const *)"
(?erase@?$***@Vxml_iarchive@***@boost@@@***@archive@boost@@***@234@@Z)
QuantLibXLStatic
C:\local\QuantLib\QuantLibXL\qlxl\QuantLibObjects-vc120-mt-s-1_8_0.lib(serialization_oh.obj)
1

I am going to try using an older version of boost libraries and see if it
works. Hope i am on the right track.

Thanks in advance for your help.



--
View this message in context: http://quantlib.10058.n7.nabble.com/Error-LNK1104-cannot-open-file-QuantLib-vc140-mt-s-lib-tp18229p18234.html
Sent from the quantlib-users mailing list archive at Nabble.com.
William Capra
2017-05-03 17:40:54 UTC
Permalink
Hi all,

I guess I had the same problem, therefore I use this loop. Sorry in advance
if I'm wrong.
While opening QuantLib_vc14.sln the first time, VS suggested to upgrade sdk
from 8.1 to 10.x and platform to v141. I agreed.
I built QuantLib 1.9.2 in Visual Studio 2017. Boost 1.63.
Library built correctly but test cases failed due to the link error in the
subject of this thread.
I modified QuantLib files accordingly to commit:
https://github.com/lballabio/QuantLib/commit/5c5eaba5359bc0d946ee3e8f05a9f1e401211176
(except
for gitignore).

QuantLib 1.9.2 built successfully in VS 2017 and all test cases passed.
Hope this could help.

Best,

William
Post by ponram
Thanks Mario & Luigi
I tried after renaming the file to QuantLib-vc140-mt-s.lib and this time the
linker gave the same error looking for QuantLib--mt-s.lib. So i made a copy
of it to the original QuantLib--mt-s.lib and tried to build with both the
lib files. This time I didn't get that error.
However, i got a whole bunch of linking errors related to Boost library such
as below. All of my boost library files have *-vc141-mt-gd-1_64.lib such as
boost_coroutine-vc141-mt-gd-1_64.lib.
Error LNK2001 unresolved external symbol "public: static void __cdecl
boost::archive::detail::archive_serializer_map<class
boost::archive::xml_iarchive>::erase(class
boost::archive::detail::basic_serializer const *)"
@@@***@archive@boost@@***@234@@Z)
QuantLibXLStatic
C:\local\QuantLib\QuantLibXL\qlxl\QuantLibObjects-vc120-mt-s-1_8_0.lib(serialization_oh.obj)
1
I am going to try using an older version of boost libraries and see if it
works. Hope i am on the right track.
Thanks in advance for your help.
--
http://quantlib.10058.n7.nabble.com/Error-LNK1104-cannot-open-file-QuantLib-vc140-mt-s-lib-tp18229p18234.html
Sent from the quantlib-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
https://lists.sourceforge.net/lists/listinfo/quantlib-users
ponram
2017-05-05 01:57:49 UTC
Permalink
Hi William,

I incorporated your changes and it produced QuantLib-vc141-mt-gd.lib file.
However, the linker gave me the following error:

2>libboost_unit_test_framework-vc141-mt-gd-1_64.lib(test_tree.obj) : fatal
error LNK1112: module machine type 'x64' conflicts with target machine type
'X86'
2>Done building project "testsuite.vcxproj" -- FAILED.

Do i need to do any separate build for boost binaries? I used the installer
for boost_1_64_0.

Thanks



--
View this message in context: http://quantlib.10058.n7.nabble.com/Error-LNK1104-cannot-open-file-QuantLib-vc140-mt-s-lib-tp18229p18250.html
Sent from the quantlib-users mailing list archive at Nabble.com.
Luigi Ballabio
2017-05-10 14:21:16 UTC
Permalink
Visual Studio 2017 will be supported in QuantLib 1.10, out shortly. If you
want to try it before release, you can check it out from the v1.10.x branch
on GitHub.

Luigi
Post by ponram
Hi William,
I incorporated your changes and it produced QuantLib-vc141-mt-gd.lib file.
2>libboost_unit_test_framework-vc141-mt-gd-1_64.lib(test_tree.obj) : fatal
error LNK1112: module machine type 'x64' conflicts with target machine type
'X86'
2>Done building project "testsuite.vcxproj" -- FAILED.
Do i need to do any separate build for boost binaries? I used the installer
for boost_1_64_0.
Thanks
--
http://quantlib.10058.n7.nabble.com/Error-LNK1104-cannot-open-file-QuantLib-vc140-mt-s-lib-tp18229p18250.html
Sent from the quantlib-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Loading...