Skip to content
This repository was archived by the owner on Jul 1, 2021. It is now read-only.

undefined reference errors when setting Poco:enable_data_odbc=True #31

Open
bmulder-innoseis opened this issue Sep 28, 2018 · 2 comments

Comments

@bmulder-innoseis
Copy link

bmulder-innoseis commented Sep 28, 2018

When setting the option Poco:enable_data_odbc=True in conanfile.txt, I get a lot of undefined reference errors when compiling an application that uses the Poco ODBC libs.

The errors all look like this:
/home/boris/.conan/data/Poco/1.9.0/pocoproject/stable/package/8ff847771efbee842b91e2e6c0d9a317b218c63c/lib/libPocoDataODBC.a(Parameter.cpp.o): In function 'Poco::Data::ODBC::Parameter::init()': Parameter.cpp:(.text+0x3b): undefined reference to 'SQLDescribeParam' collect2: error: ld returned 1 exit status

When setting Poco:shared=True , this does not happen.
I would like to link Poco statically to my program and use ODBC. Any ideas what could cause this?

@bmulder-innoseis
Copy link
Author

By the way, I am building with stdc++11 and I have set compiler.libcxx=libstdc++11 in .conan/profiles/default. Perhaps there could be an ABI incompatibility issue?

@bmulder-innoseis
Copy link
Author

It seems this is a linking order problem again.
To solve it, you need to:

  1. Apply the fix here: Linking order #28
  2. Link odbc after linking Poco (i.e. in cmakefile, you say `target_link_libraries(mytarget ${CONAN_LIBS} odbc)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant