I'm trying to build an unit test for a dll project (ArchiCAD addon, actual file extension is .apx btw). Test discovery failed and testing it in command prompt showed that the stuff required adding ArchiCAD's library to %PATH%. So I added to my test code:
struct SetPwd {
SetPwd() {boost::filesystem::current_path("C:\\Program Files\\GRAPHISOFT\\ArchiCAD SE 2016");}
~SetPwd() {}
};
BOOST_GLOBAL_FIXTURE(SetPwd);
(Idea came from here: boost unit test with visual studio test adapter - set working directory )
What it says:
LNK2019 unresolved external symbol "void __cdecl boost::filesystem::detail::current_path(class boost::filesystem::path const &,class boost::system::error_code *)" (?current_path@detail@filesystem@boost@@YAXAEBVpath@23@PEAVerror_code@system@3@@Z) referenced in function "void __cdecl boost::filesystem::current_path(class boost::filesystem::path const &)" (?current_path@filesystem@boost@@YAXAEBVpath@12@@Z)
LNK2019 boost::filesystem::path_traits::convert(char const *,char const *,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > &,class std::codecvt<unsigned short,char,int> const &)" (?convert@path_traits@filesystem@boost@@YAXPEBD0AEAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEBV?$codecvt@GDH@5@@Z) referenced in function "void __cdecl boost::filesystem::path_traits::convert(char const *,char const *,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > &)" (?convert@path_traits@filesystem@boost@@YAXPEBD0AEAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z)
LNK2019 unresolved external symbol "public: static class std::codecvt<unsigned short,char,int> const & __cdecl boost::filesystem::path::codecvt(void)" (?codecvt@path@filesystem@boost@@SAAEBV?$codecvt@GDH@std@@XZ) referenced in function "void __cdecl boost::filesystem::path_traits::convert(char const *,char const *,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > &)" (?convert@path_traits@filesystem@boost@@YAXPEBD0AEAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z)
So looks like parametrization of the functions don't match. Boost.test's own functions seem to link to other own functions that don't seem to extist.
Facts:
- I use Windows7.1SDK (kind of a must-have for this ArchiCAD version)
- I build boost.test with bootstrap.bat vc10 options (I think this toolset came with 7.1, but not 100% sure)
- Then b2.exe address-model=64 architecture=x86 runtime-link=static --with-filesystem
- This way the stuff will be named libboost_filesystem-vc100-mt-sgd-x64-1_80.lib which looks healthy. As far as I understand compilation was OK.
- I tried with boost 1.78.0 and 1.80.0 (plus 1.64.0, oldest available), no difference. I also tried it with a precompiled 1.80.0, with same results, so building might be OK.
- Visual Studio 2019 Community used
Any idea? Note that I'm not too experienced in C++
NOTE this not a question about how a LNK2019/missing signature error can be fixed in general but how it comes that some functions are not included in that specific boost test lib that itself references.
NOTE2 during bootstrapping, this is mentioned:
### Using 'vc143' toolset.
Dunno, whether this is important or not (For the tested project I use vc10)