Project

General

Profile

Actions

Bug #3566

closed

Linker does complain about undefined reference to Wt::Ssl::x509ToWSslCertificate(x509_st*)

Added by Sebastian Freitag over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
09/07/2014
Due date:
% Done:

0%

Estimated time:

Description

This is the output:

/usr/local/lib/libwthttp.a(Request.o): In function `http::server::Request::sslInfo() const':

/usr/src/wt-3.3.3/src/http/Request.C:249: undefined reference to `Wt::Ssl::x509ToWSslCertificate(x509_st*)'

/usr/src/wt-3.3.3/src/http/Request.C:258: undefined reference to `Wt::Ssl::x509ToWSslCertificate(x509_st*)'

/usr/src/wt-3.3.3/src/http/Request.C:276: undefined reference to `Wt::WSslInfo::WSslInfo(Wt::WSslCertificate const&, std::vector<Wt::WSslCertificate, std::allocatorWt::WSslCertificate > const&, Wt::WValidator::Result)'

collect2: error: ld returned 1 exit status

make: * [compile] Error 1

I am trying to do a static build of the ChartsApplication Example like this:

g ChartsApplication.C ChartConfig.C ChartsExample.C CsvUtil.C PanelList.C -std=c++11 \

-lboost_signals-gcc47-mt-d-1_55 \

-lwt \

-lwthttp \

-lboost_program_options-gcc47-mt-d-1_55 \

-lhpdf \

-lssl \

-lboost_filesystem-gcc47-mt-d-1_55 \

-lboost_regex-gcc47-mt-d-1_55 \

-lboost_random-gcc47-mt-d-1_55 \

-lboost_date_time-gcc47-mt-d-1_55 \

-lpng12 \

-lcrypto \

-lboost_thread-gcc47-mt-d-1_55 \

-ldl \

-lz \

-lrt \

-lboost_system-gcc47-mt-d-1_55 \

-lpthread \

-static

What is wrong here? ld ---verbose shows that it has /usr/lib/x86_64-linux-gnu/ in its search dir and libssl.a resides there happily.

/proc/version is: Linux version 3.2.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.60-1+deb7u3

Someone has an idea?

Actions #1

Updated by Sebastian Freitag over 9 years ago

I just found http://redmine.emweb.be/issues/1745. I do not know if this is a duplicate or if he did not have -lssl

Actions #2

Updated by Wim Dumon over 9 years ago

  • Status changed from New to Feedback

Hey Sebastian,

Looking back at the errors, it rather looks to me as if Wt itself was not properly compiled with SSL support and thus my response to #1745 was probably wrong. Can you check WConfig.h in your install directory and check if 'WT_WITH_SSL' is defined?

Currently it looks to me as if your build is a weird combination of some files that think that SSL is enabled in the Wt build, and other think it's not enabled. I can't immediately see what could have caused this. Could you try a clean rebuild of Wt? Any idea of what could have gone wrong?

Wim.

Actions #3

Updated by Sebastian Freitag over 9 years ago

Found the error. I thought that lwt depends on symbols defined in either lwthttp or lwtfcgi so I had -lwt before -lwthttp. But as it turns out it is the other way around.

This should be one correct order for linking all the stuff (it works for me now):

-lboost_signals -lwthttp -lwt -lboost_program_options -lhpdf -lssl -lboost_filesystem -lboost_regex -lboost_random -lboost_date_time -lpng12 -lcrypto -lboost_thread -ldl -lz -lrt -lboost_system -lpthread

Thanks for your comment Wim, it brought me on the right track.

Actions #4

Updated by Wim Dumon over 9 years ago

  • Status changed from Feedback to Closed

Great! This library order thing in Linux is quite weird. With this being the cause, one would expect more undefined symbols than just the ones related to SSL.

Wim.

Actions

Also available in: Atom PDF