I’m trying to convert some old DLLs from 32 to 64 bit architecture. So far its been going pretty smoothly, these are pretty old and use Jam to compile. But pointing to the x64 compiler and switching some flags seems to do the trick.
Until I got to one that needs to link to fmt
I recompiled the above library with CMake as is provided in the repo, however when I try to link this to my code, I get an “unresolved symbols” error for all the implementations inside fmt.lib
When I turn on Verbose Linking, I can see that it finds nothing inside fmt.lib, I just see
Searching libraries
Searching fmtd.lib:
With nothing found inside, and then the link errors come in, here’s one example
convert_json.obj : error LNK2019: unresolved external symbol "void __cdecl fmt::v9::detail::assert_fail(char const *,int,char const *)" (?assert_fail@detail@v9@fmt@@YAXPEBDH0@Z) referenced in function "public: void __cdecl fmt::v9::detail::bigint::operator=<int>(int)" (??$?4H@bigint@detail@v9@fmt@@QEAAXH@Z
I can look inside the lib using dumpbin and I can see those symbols exist and are marked External
C:Homefmtbuild>dumpbin /symbols fmtd.lib | findstr assert_fail
4C6 00000000 UNDEF notype () External | ?assert_fail@detail@v11@fmt@@YAXPEBDH0@Z (void __cdecl fmt::v11::detail::assert_fail(char const *,int,char const *))
1456 00000000 SECT4 notype () External | ?assert_fail@detail@v11@fmt@@YAXPEBDH0@Z (void __cdecl fmt::v11::detail::assert_fail(char const *,int,char const *))
2341 00000000 SECTB43 notype Static | $unwind$?assert_fail@detail@v11@fmt@@YAXPEBDH0@Z
2344 00000000 SECTB44 notype Static | $pdata$?assert_fail@detail@v11@fmt@@YAXPEBDH0@Z
Are there any common reasons that cause this? I’m also seeing this with another open source json library so I think it is something I’m doing rather than anything to do with fmt itself.
I saw what was wrong as soon as I finished typing…
Linker is looking for v9 and I had fmt v11.
So when the verbose linking shows nothing under the library, that doesn’t necessarily mean it cant find anything, it just can’t find anything that’s used in your code.