majintao0131 / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

Linkage problems with a dll in Visual Studio #152

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Create a dll with yaml-cpp 0.3.0 under Visual Studio 8 2005.

2. Try to link "run_tests"

This gives the linker errors

Error 1 error LNK2019: unresolved external symbol "void __cdecl 
YAML::operator>>(class YAML::Node const &,class YAML::Binary &)" 
(??5YAML@@YAXABVNode@0@AAVBinary@0@@Z) referenced in function "public: class 
YAML::Binary const __thiscall YAML::Node::to(void)const " 
(??$to@VBinary@YAML@@@Node@YAML@@QBE?BVBinary@1@XZ) parsertests.obj

Error 2 fatal error LNK1120: 1 unresolved externals 
....\yaml-cpp_dll\build\test\Debug\run-tests.exe 1

This looks like just not exporting the symbols, a la issue 88.

Original issue reported on code.google.com by jbe...@gmail.com on 28 Feb 2012 at 12:50

GoogleCodeExporter commented 9 years ago
I fixed it. In include/yaml-cpp/binary.h:

@@ +10,1 @@
+#include "yaml-cpp/dll.h"

@@ -64,1 +64,1 @@
-    void operator >> (const Node& node, Binary& binary);
+    YAML_CPP_API void operator >> (const Node& node, Binary& binary);

Original comment by supsu...@gmail.com on 10 Feb 2013 at 11:35

GoogleCodeExporter commented 9 years ago

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