Boost 1.56 with QT creator, “LNK1104: cannot open file 'libboost_unit_test_framework-vc100-mt-gd-1_56.lib'”
Hello, I am working on a project of boost unit testing framework using QT creator. I have written a small test program and trying to link "libboost_unit_test_framework-vc100-mt-gd-1_56.lib". This library is present at specified path. But program fails to compile giving said linking error. I searched on net and found that, error should go with "#define BOOST_ALL_NO_LIB". But then, I am getting below error: main.obj:-1: error: LNK2019: unresolved external symbol "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z) referenced in function _main The above function is a part of "libboost_unit_test_framework-vc100-mt-gd-1_56.lib". I have written same unit tests using VS 2010 and with the same boost libraries. The program worked properly with expected behavior. What could be possibly going wrong with the usage of boost on QT ? Please help ! -Thanks
Hi,
you say are using QtCreator, but you do not state which OS you are using.
So I guess you are still on windows, and I also guess QtCreator uses mingw
as the compiler instead of Visual Studio.
If this is true, then you need to compile boost using mingw in order to be
able to properly link against the boost libraries.
Bye
Manuel
2014-10-17 15:22 GMT+02:00 Kavita
Hello,
I am working on a project of boost unit testing framework using QT creator. I have written a small test program and trying to link "libboost_unit_test_framework-vc100-mt-gd-1_56.lib". This library is present at specified path. But program fails to compile giving said linking error.
I searched on net and found that, error should go with "#define BOOST_ALL_NO_LIB". But then, I am getting below error:
main.obj:-1: error: LNK2019: unresolved external symbol "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z) referenced in function _main
The above function is a part of "libboost_unit_test_framework-vc100-mt-gd-1_56.lib".
I have written same unit tests using VS 2010 and with the same boost libraries. The program worked properly with expected behavior.
What could be possibly going wrong with the usage of boost on QT ? Please help !
-Thanks
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Fri, Oct 17, 2014 at 04:04:36PM +0200, Manuel Schiller wrote:
Hi,
you say are using QtCreator, but you do not state which OS you are using. So I guess you are still on windows, and I also guess QtCreator uses mingw as the compiler instead of Visual Studio.
Qt Creator can, and in his case does, support using MSVC as the compiler and CDB as the debugger. The error shown is from the MS link.exe. The underlying cause is likely a difference in the flags passed to the compiler and/or linker by his build system, which may differ from what you get when building with MSBuild solutions.
If this is true, then you need to compile boost using mingw in order to be able to properly link against the boost libraries.
Boost list policy mandates in-line bottom-post replies, btw.
2014-10-17 15:22 GMT+02:00 Kavita
: Hello,
I am working on a project of boost unit testing framework using QT creator. I have written a small test program and trying to link "libboost_unit_test_framework-vc100-mt-gd-1_56.lib". This library is present at specified path. But program fails to compile giving said linking error.
I searched on net and found that, error should go with "#define BOOST_ALL_NO_LIB". But then, I am getting below error:
main.obj:-1: error: LNK2019: unresolved external symbol "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z) referenced in function _main
The above function is a part of "libboost_unit_test_framework-vc100-mt-gd-1_56.lib".
I have written same unit tests using VS 2010 and with the same boost libraries. The program worked properly with expected behavior.
What could be possibly going wrong with the usage of boost on QT ? Please help !
-Thanks
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Lars Viklund | zao@acc.umu.se
Hello,
Thanks for the all the replies and very sorry for my late reply.
I am using Windows 7, QT creator uses compiler of Visual Studio 2010. Do I
still require MingW ?
Also, I have downloaded binaries of Boost, so should I download a complete
version of it and then build using bjam ?
-Thanks
On Fri, Oct 17, 2014 at 7:34 PM, Manuel Schiller
Hi,
you say are using QtCreator, but you do not state which OS you are using. So I guess you are still on windows, and I also guess QtCreator uses mingw as the compiler instead of Visual Studio.
If this is true, then you need to compile boost using mingw in order to be able to properly link against the boost libraries.
Bye Manuel
2014-10-17 15:22 GMT+02:00 Kavita
: Hello,
I am working on a project of boost unit testing framework using QT creator. I have written a small test program and trying to link "libboost_unit_test_framework-vc100-mt-gd-1_56.lib". This library is present at specified path. But program fails to compile giving said linking error.
I searched on net and found that, error should go with "#define BOOST_ALL_NO_LIB". But then, I am getting below error:
main.obj:-1: error: LNK2019: unresolved external symbol "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z) referenced in function _main
The above function is a part of "libboost_unit_test_framework-vc100-mt-gd-1_56.lib".
I have written same unit tests using VS 2010 and with the same boost libraries. The program worked properly with expected behavior.
What could be possibly going wrong with the usage of boost on QT ? Please help !
-Thanks
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi Manuel, please do not top quote. Thanks! Am Montag, 20. Oktober 2014, 12:55:40 schrieb Kavita:
Thanks for the all the replies and very sorry for my late reply.
I am using Windows 7, QT creator uses compiler of Visual Studio 2010. Do I still require MingW ?
No, this is a valid combination.
Also, I have downloaded binaries of Boost, so should I download a complete version of it and then build using bjam ?
The binaries are usually sufficient for standard builds.
2014-10-17 15:22 GMT+02:00 Kavita
: Hello,
I am working on a project of boost unit testing framework using QT creator. I have written a small test program and trying to link "libboost_unit_test_framework-vc100-mt-gd-1_56.lib". This library is present at specified path. But program fails to compile giving said linking error. I searched on net and found that, error should go with "#define BOOST_ALL_NO_LIB".
BOOST_ALL_NO_LIB disables autolinking support. Autolinking support usually works fine on Windows. Please take a look at http://www.boost.org/doc/libs/1_56_0/more/getting_started/windows.html for decoding the information in the library file name. Please attach the complete linker output next time. Partial information is not helpfull at all.
But then, I am getting below error:
main.obj:-1: error: LNK2019: unresolved external symbol "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z) referenced in function _main
The above function is a part of "libboost_unit_test_framework-vc100-mt-gd-1_56.lib".
I have written same unit tests using VS 2010 and with the same boost libraries. The program worked properly with expected behavior.
Then you have different compiler settings. Please compare the generated commandline of Visual Studio and QtCreator. Both should use the same set of flags and link against the same libraries. If this fails, make a minimal test case of your QtCreator project. Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! * voice: ++49 4257 300 ! Fährstraße 1 * fax : ++49 4257 300 ! 31609 Balge/Sebbenhausen * jhunold@gmx.eu ! Germany
Hello Kavita,
2014-10-17 15:22 GMT+02:00 Kavita
: Hello, I am working on a project of boost unit testing framework using QT creator. I have written a small test program and trying to link "libboost_unit_test_framework-vc100-mt-gd-1_56.lib". This library is present at specified path. But program fails to compile giving said linking error.
I searched on net and found that, error should go with "#define BOOST_ALL_NO_LIB". But then, I am getting below error:
main.obj:-1: error: LNK2019: unresolved external symbol "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z) referenced in function _main
I worked on a similar problem last week. You probably have conflicting settings for wchar_t. Apparently, Qt's binaries all have the built-in wchar_t type disabled. You can see this if you use dumpbin on any of their binaries. No wchar_t anywhere. Everything will be const char*. What you need to do is invoke Boost jam with the cxxflags=-Zc:wchar_t- parameter. By default, Boost has Zc:wchar_t set, and setting this flag will override that setting. You can also modify the jamfile to change it to the Zc:wchar_t- version. Best regards, M. Scott Mueller
I am working on a project of boost unit testing framework using QT creator. I have written a small test program and trying to link "libboost_unit_test_framework-vc100-mt-gd-1_56.lib". This library is present at specified path. But program fails to compile giving said linking error.
I searched on net and found that, error should go with "#define BOOST_ALL_NO_LIB". But then, I am getting below error:
Please don't do that - that option is for expert users only and is cunningly designed to allow you to shoot yourself in the foot ;-) There are two possibilities here: 1) You have files with similar names to libboost_unit_test_framework-vc100-mt-gd-1_56.lib, but not *exactly* that one - and yes you really do need the file with exactly that name as different MSVC build options produce binary-incompatible libraries. In this case, please rebuild Boost using "bjam --build-type=complete --with-test" to make sure you get all the possible binaries. And yes this will take a while. 2) You have that file but it's not in your linker's search path - there should be a /LIBPATH=path-to-library-file on the linkers command line. If you're not using the Visual Studio IDE then you will need to check your IDE's documentation for help in setting that. HTH, john.
participants (6)
-
John Maddock
-
Jürgen Hunold
-
Kavita
-
Lars Viklund
-
Manuel Schiller
-
Scott Mueller