Note that there are some explanatory texts on larger screens.

plurals
  1. POundefined reference linking yaml-cpp program with mingw-w64 + cmake
    primarykey
    data
    text
    <p>I'm using mingw-w64 (4.8.0) + cmake to build shared libraries for yaml-cpp (0.5.1). The project has a few build targets in the CMakeLists.txt that comes with it: the main library <code>yaml-cpp</code> and some test programs e.g. <code>parse</code>, which links the library.</p> <p>The library target <code>yaml-cpp</code> itself built without error but it is followed by this error when <code>parse</code> is built:</p> <pre><code>Linking CXX executable parse.exe CMakeFiles\parse.dir/objects.a(parse.cpp.obj):parse.cpp:(.text+0x1a3): undefined reference to `YAML::Load(std::istream&amp;)' CMakeFiles\parse.dir/objects.a(parse.cpp.obj):parse.cpp:(.text+0x1b2): undefined reference to `YAML::operator&lt;&lt;(std::ostream&amp;, YAML::Node const&amp;)' c:/work/mingw64-4.8/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\parse.dir/objects.a(parse.cpp.obj): bad reloc address 0x0 in section `.data' collect2.exe: error: ld returned 1 exit status util\CMakeFiles\parse.dir\build.make:90: recipe for target 'util/parse.exe' failed mingw32-make[3]: *** [util/parse.exe] Error 1 CMakeFiles\Makefile2:228: recipe for target 'util/CMakeFiles/parse.dir/all' failed mingw32-make[2]: *** [util/CMakeFiles/parse.dir/all] Error 2 CMakeFiles\Makefile2:240: recipe for target 'util/CMakeFiles/parse.dir/rule' failed mingw32-make[1]: *** [util/CMakeFiles/parse.dir/rule] Error 2 makefile:211: recipe for target 'parse' failed mingw32-make: *** [parse] Error 2 </code></pre> <p>I run into similar errors when I try to write small test programs using the library, and I don't know what is wrong. What might be the issue here?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload