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

Won't compile on Windows due to several missing DLL exports #216

Closed
GoogleCodeExporter opened this issue Mar 30, 2015 · 10 comments
Closed

Won't compile on Windows due to several missing DLL exports #216

GoogleCodeExporter opened this issue Mar 30, 2015 · 10 comments

Comments

@GoogleCodeExporter
Copy link

@GoogleCodeExporter GoogleCodeExporter commented Mar 30, 2015

What steps will reproduce the problem?
1. Generate Visual Studio 2010 x64 build files using CMake
2. Compile from within Visual Studio 2010

What is the expected output? What do you see instead?
Expected output is a successful build, instead get multiple "undefined external 
symbol" linker errors.

What version of the product are you using? On what operating system?
v. 0.5.1 on Windows 8 x64 with Visual Studio 2010

Please provide any additional information below.
Attached diff (against release 0.5.1) fixes all but two of the errors. Due to 
time constraints, I can't look into this any further at the moment.

Original issue reported on code.google.com by WadeA...@gmail.com on 2 Aug 2013 at 12:24

Attachments:

@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Mar 30, 2015

Forgot to mention that this only for the shared library build, not the static 
one.

Original comment by WadeA...@gmail.com on 2 Aug 2013 at 12:25

  • Added labels: ****
  • Removed labels: ****
@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Mar 30, 2015

Thanks!

Original comment by jbe...@gmail.com on 2 Aug 2013 at 1:06

  • Changed state: Accepted
  • Added labels: Component-New-API
  • Removed labels: ****
@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Mar 30, 2015

[deleted comment]
@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Mar 30, 2015

Thanks for pointing me to this. I got it to work by adding YAML_CPP_API to all 
the new API stuff. However I also had to get rid of 
"detail::node_data::empty_scalar", since static members don't get exported 
properly and it was needed by two inline functions (see: 
http://stackoverflow.com/questions/2479784/exporting-static-data-in-a-dll ), so 
consider this more of a "quick fix" than a "proper solution".

Edit: Updated patch

Original comment by supsu...@gmail.com on 16 Aug 2013 at 2:25

  • Added labels: ****
  • Removed labels: ****

Attachments:

@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Mar 30, 2015

This issue is still present. Compile as a static lib as a work around.

Original comment by markstah...@gmail.com on 14 Nov 2013 at 2:52

  • Added labels: ****
  • Removed labels: ****
@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Mar 30, 2015

I fixed most of the issues, re0b6d8095fce2a149d81e7d6aa72314e2a7ccb1e, but 
there are still the following errors:

3>load_node_test.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) private: static bool __cdecl 
YAML::detail::node_data::equals(class YAML::detail::node &,char const *,class 
boost::shared_ptr<class YAML::detail::memory_holder>)" 
(__imp_?equals@node_data@detail@YAML@@CA_NAAVnode@23@PBDV?$shared_ptr@Vmemory_ho
lder@detail@YAML@@@boost@@@Z) referenced in function "public: class 
YAML::detail::node & __thiscall YAML::detail::node_data::get<char const 
[4]>(char const (&)[4],class boost::shared_ptr<class 
YAML::detail::memory_holder>)" 
(??$get@$$BY03$$CBD@node_data@detail@YAML@@QAEAAVnode@12@AAY03$$CBDV?$shared_ptr
@Vmemory_holder@detail@YAML@@@boost@@@Z)
3>node_spec_test.obj : error LNK2001: unresolved external symbol 
"__declspec(dllimport) private: static bool __cdecl 
YAML::detail::node_data::equals(class YAML::detail::node &,char const *,class 
boost::shared_ptr<class YAML::detail::memory_holder>)" 
(__imp_?equals@node_data@detail@YAML@@CA_NAAVnode@23@PBDV?$shared_ptr@Vmemory_ho
lder@detail@YAML@@@boost@@@Z)
3>node_test.obj : error LNK2001: unresolved external symbol 
"__declspec(dllimport) private: static bool __cdecl 
YAML::detail::node_data::equals(class YAML::detail::node &,char const *,class 
boost::shared_ptr<class YAML::detail::memory_holder>)" 
(__imp_?equals@node_data@detail@YAML@@CA_NAAVnode@23@PBDV?$shared_ptr@Vmemory_ho
lder@detail@YAML@@@boost@@@Z)

I don't understand why these symbols are missing, given that the method in 
question is inlined in a header file.

If anyone has a workaround, please let me know.

Original comment by jbe...@gmail.com on 24 Mar 2014 at 5:36

  • Changed state: Started
  • Added labels: ****
  • Removed labels: ****
@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Mar 30, 2015

Maybe since "public detail::node_data::get" is exported regardless of being 
inline (since it's part of an exported class), and it depends on "private 
detail::node_data::equals", then "private detail::node_data::equals" needs to 
be exported too regardless of being inline?

See this regarding exporting inline functions: 
http://blogs.msdn.com/b/oldnewthing/archive/2014/01/09/10488192.aspx

Original comment by supsu...@gmail.com on 3 Apr 2014 at 4:56

  • Added labels: ****
  • Removed labels: ****
@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Mar 30, 2015

I have the same problems. What is the status on the issue?

Original comment by mikhail....@gmail.com on 16 Nov 2014 at 11:06

  • Added labels: ****
  • Removed labels: ****
@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Mar 30, 2015

Original comment by jbe...@gmail.com on 29 Mar 2015 at 7:45

  • Added labels: Milestone-Release0.5.2
  • Removed labels: ****
@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented Mar 30, 2015

Fixed, r0c6888b72c45.

Original comment by jbe...@gmail.com on 30 Mar 2015 at 2:18

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant