question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

undefined reference to Poco::DigestEngine

See original GitHub issue

first, git clone https://github.com/conan-io/examples.git and then cd into libraries/poco/md5 run ./build.sh

got error like that:

+ cmake --build .
Scanning dependencies of target md5
[ 50%] Building CXX object CMakeFiles/md5.dir/md5.cpp.o
[100%] Linking CXX executable bin/md5
CMakeFiles/md5.dir/md5.cpp.o: In function `main':

md5.cpp:(.text.startup+0x9b): undefined reference to `Poco::DigestEngine::digestToHex[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&)’ collect2: error: ld returned 1 exit status CMakeFiles/md5.dir/build.make:83: recipe for target ‘bin/md5’ failed make[2]: *** [bin/md5] Error 1 CMakeFiles/Makefile2:72: recipe for target ‘CMakeFiles/md5.dir/all’ failed make[1]: *** [CMakeFiles/md5.dir/all] Error 2 Makefile:83: recipe for target ‘all’ failed make: *** [all] Error 2

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
memshardedcommented, May 7, 2020

HI @bill-luu

Glad that you fixed it. We will be fixing this for Conan 2.0 (now it will be breaking). To summarize:

  • Conan by default uses compiler.libcxx=libstdc++ for wider compatibility in all distros and gcc versions
  • If you are running a modern distro and gcc >= 5 you need to change it to libstdc++11
  • But if you are running an older distro (even with gcc >= 5) or gcc < 5, then you need to keep the libstdc++
1reaction
bill-luucommented, May 7, 2020

I had the same issues as the other two, using Elementary OS 5.0 Juno (Based on Ubuntu 18.04.2)

As suggested, I fixed it by editing ~/.conan/profiles/default and editing the line compilter.libcxx line to compiler.libcxx=libstdc++11

The entire file:

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=7
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
Read more comments on GitHub >

github_iconTop Results From Across the Web

undefined reference to (function) c++ [duplicate] - Stack Overflow
This is true in general case, but first thing you think about when somebody asks about undefined reference in C++ should be "does...
Read more >
Numerous linking errors "undefined reference to `libXX_YY"
I've been trying to compile an open-source C++ project Typesense, which has this list of dependencies: Snappy; zlib; OpenSSL (>=1.0.2); curl ...
Read more >
C compilation Error: undefined reference to - YouTube
C compilation Error: undefined reference to. Watch later. Share. Copy link. Info. Shopping. Tap to unmute. If playback doesn't begin shortly ...
Read more >
How to fix "undefined reference" error? - NXP Community
Solved: Hello I'm developing code for evkmimxrt1060 using the mcuxpressoide IDE. I added unity (https://github.com/ ThrowTheSwitch/Unity) testcode in.
Read more >
Undefined references problem when compiling c++ test code
Hello. I have been experiencing multiple undefined reference problems when trying to compile a very simple c++ source code. In fact, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found