Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to link with dynamic library in Windows for 3.0.1 #516

Closed
memsharded opened this issue Jun 4, 2017 · 1 comment
Closed

Failed to link with dynamic library in Windows for 3.0.1 #516

memsharded opened this issue Jun 4, 2017 · 1 comment

Comments

@memsharded
Copy link

Hi!

I am able to link as static in Win, Linux, OSX (many different versions), and all but Windows as shared libraries. I am trying to create conan packages, so I have the infrastructure for building and linking from a test project easily. So the steps to reproduce would be:

$ git clone https://github.com/memsharded/conan-fmt
$ cd conan-fmt
$ git checkout master
$ conan test_package -s compiler="Visual Studio" -s compiler.version=14 -o fmt:shared=True
...
 example.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl fmt::FormatError::~FormatError(void)" (??1F ormatError@fmt@@UEAA@XZ) referenced in function "public: virtual void * __cdecl fmt::FormatError::`scalar deleting destructor' (unsigned int)" (??_GFormatError@fmt@@UEAAPEAXI@Z) [C:\Users\memsharded\conanws\packages\conan-fmt\test_package\build\47ccd3369735 3124695963bca523d13fcb88e0b8\example.vcxproj]
 example.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int __cdecl fmt::internal::Cha rTraits<char>::format_float<long double>(char *,unsigned __int64,char const *,unsigned int,int,long double)" (__imp_??$format_ float@O@?$CharTraits@D@internal@fmt@@SAHPEAD_KPEBDIHO@Z) referenced in function "private: void __cdecl fmt::BasicWriter<char>: :write_double<long double>(long double,struct fmt::FormatSpec const &)" (??$write_double@O@?$BasicWriter@D@fmt@@AEAAXOAEBUForm atSpec@1@@Z) [C:\Users\memsharded\conanws\packages\conan-fmt\test_package\build\47ccd33697353124695963bca523d13fcb88e0b8\example.v cxproj]
 example.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int __cdecl fmt::internal::Cha rTraits<char>::format_float<double>(char *,unsigned __int64,char const *,unsigned int,int,double)" (__imp_??$format_float@N@?$ CharTraits@D@internal@fmt@@SAHPEAD_KPEBDIHN@Z) referenced in function "private: void __cdecl fmt::BasicWriter<char>::write_dou ble<double>(double,struct fmt::FormatSpec const &)" (??$write_double@N@?$BasicWriter@D@fmt@@AEAAXNAEBUFormatSpec@1@@Z) [C:\Use rs\memsharded\conanws\packages\conan-fmt\test_package\build\47ccd33697353124695963bca523d13fcb88e0b8\example.vcxproj]
 C:\Users\memsharded\conanws\packages\conan-fmt\test_package\build\47ccd33697353124695963bca523d13fcb88e0b8\bin\example.exe : fat al error LNK1120: 3 unresolved externals [C:\Users\memsharded\conanws\packages\conan-fmt\test_package\build\47ccd33697353124695963 bca523d13fcb88e0b8\example.vcxproj]

For static linking the output is:

$ conan test_package -s compiler="Visual Studio" -s compiler.version=14
...
> The answer is 42

The builds in appveyor and travis are:

I am already adding the FMT_SHARED definition, and the problem seems to be the same in Debug mode too.

Please tell me if I can provide more information. Thanks very much!

@vitaut
Copy link
Contributor

vitaut commented Jun 17, 2017

This has been fixed in #469 (included in version 3.0.2).

@vitaut vitaut closed this as completed Jun 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants