Hello,

I have a C++ project (quite extensive, lots of sub-projects that produce 
libraries used in the final executable) which I can compile just fine with gcc 
5.1.0.
As an alternative, some preparations have been previously done to compile the 
project with clang (in this case 3.6.2), which we'd as a company like to 
transition to at some point.
However when compiling with clang, I get several undefined references when 
linking the final executable on some libraries in the project which I don't get 
when compiling with gcc.

First let me explain my build environment, which is custom:
I have an openSUSE 11.3 OS due to backwards compatibility reasons
Originally, gcc 4.5 is installed (located in /usr/bin)
I compiled gcc 5.1 myself (using gcc 4.5, located in /usr/local/bin, $PATH has 
been modified to search here first)
I compiled clang 3.6.2 myself (using gcc 5.1, located in /usr/local/bin)
Several other libraries (including mysql++ & boost) are compiled with gcc  
(located in /usr/local/lib, headers in /usr/local/include)
Codelite 8.0, compiled with gcc 5.1

Now when doing a clean clang build of my project I get 4 undefind reference 
linking errors:
/home/rohill/Projects/60ChannelSIP/bin/Clang/opt/swmi/lib/libSystem.so: 
undefined reference to `boost::program_options::arg'
/home/rohill/Projects/60ChannelSIP/bin/Clang/opt/swmi/lib/libMysql.so: 
undefined reference to `mysqlpp::Query::str(mysqlpp::SQLQueryParms&)'
/home/rohill/Projects/60ChannelSIP/bin/Clang/opt/swmi/lib/libTfc.so: undefined 
reference to `std::ios_base::failure::failure(char const*, std::error_code 
const&)'
/home/rohill/Projects/60ChannelSIP/bin/Clang/opt/swmi/lib/libTfc.so: undefined 
reference to `boost::gregorian::greg_month::get_month_map_ptr()'

I am able to resolve the issues with boost & mysqlpp by recompiling these with 
clang, but after that, I get 2 more undefined references to 
std::ios_base::failure::failure:
/home/rohill/Projects/60ChannelSIP/bin/Clang/opt/swmi/lib/libboost_iostreams.so:
 undefined reference to 
`std::ios_base::failure::failure(std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> > const&)'
/home/rohill/Projects/60ChannelSIP/bin/Clang/opt/swmi/lib/libboost_iostreams.so:
 undefined reference to `std::ios_base::failure::failure(char const*, 
std::error_code const&)'
/home/rohill/Projects/60ChannelSIP/bin/Clang/opt/swmi/lib/libTfc.so: undefined 
reference to `std::ios_base::failure::failure(char const*, std::error_code 
const&)'
But I don't know if I want to do this, because I am no longer able to compile 
the project with gcc after this.

Furthermore, I find it rather strange that clang produces these linking issues 
in the first place, as it can compile and link those specific libraries just 
fine earlier in the build.
All external libraries used to compile & link the projects libraries are also 
configured for the linking of the final executable.

I am at a loss for an answer, but I suspect it having to do something with gcc 
4.5 in some way, so I hope to get an answer via this.

Kind regards,

Roy Kleefman


[cid:[email protected]]
Rohill * Edisonstraat 12 * 7903 AN Hoogeveen * The Netherlands
Phone: +31-528-263355 * Fax: +31-528-271844 * 
www.rohill.com<http://www.rohill.com/>
Chamber of Commerce Meppel registration no. 09084362
This email, including any attached files, is confidential, may be legally 
privileged, and is solely for the intended recipient(s).
If you have received this email in error, please destroy it and notify Rohill 
immediately. Any unauthorized use, dissemination,
disclosure, copying or printing is strictly prohibited. Thank you.

_______________________________________________
cfe-users mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users

Reply via email to