tatsuhiro-t / spdylay

The experimental SPDY protocol version 2, 3 and 3.1 implementation in C
http://tatsuhiro-t.github.io/spdylay/
MIT License
604 stars 102 forks source link

Does not compile with gcc49 on FreeBSD 9 #139

Closed oparoz closed 8 years ago

oparoz commented 8 years ago

Any idea on how to solve this?

libtool: link: g++49 -O2 -pipe -fPIE -march=native -march=native -fstack-protector-strong --param ssp-buffer-size=4 -fno-strict-aliasing -std=c++11 -pthread -Wl,-rpath -Wl,/usr/local/lib -fstack-protector -o .libs/spdycat util.o timegm.o spdylay_ssl.o spdycat.o HtmlParser.o http-parser/http_parser.o  -L/usr/local/lib -lssl -lcrypto -lxml2 -liconv -lm -levent_openssl -levent ../lib/.libs/libspdylay.so -L/usr/lib -lz -pthread -Wl,-rpath -Wl,/usr/local/lib
spdylay_ssl.o: In function `spdylay::connect_to(std::string const&, unsigned short)':
spdylay_ssl.cc:(.text+0x365): undefined reference to `std::ctype<char>::_M_widen_init() const'
spdylay_ssl.o: In function `spdylay::make_listen_socket(std::string const&, unsigned short, int)':
spdylay_ssl.cc:(.text+0x5c5): undefined reference to `std::ctype<char>::_M_widen_init() const'
spdylay_ssl.o: In function `spdylay::ssl_handshake(ssl_st*, int)':
spdylay_ssl.cc:(.text+0xaf5): undefined reference to `std::ctype<char>::_M_widen_init() const'
spdylay_ssl.cc:(.text+0xb92): undefined reference to `std::ctype<char>::_M_widen_init() const'
spdylay_ssl.o: In function `spdylay::nonblock_connect_to(std::string const&, unsigned short, int)':
spdylay_ssl.cc:(.text+0x114e): undefined reference to `std::ctype<char>::_M_widen_init() const'
spdylay_ssl.o:spdylay_ssl.cc:(.text+0x1376): more undefined references to `std::ctype<char>::_M_widen_init() const' follow
collect2: error: ld returned 1 exit status
*** [spdycat] Error code 1

Stop in /usr/ports/www/spdylay/work/spdylay-1.3.2/src.
*** [all-recursive] Error code 1

Stop in /usr/ports/www/spdylay/work/spdylay-1.3.2.
*** [all] Error code 1

Stop in /usr/ports/www/spdylay/work/spdylay-1.3.2.
*** [do-build] Error code 1

Stop in /usr/ports/www/spdylay..
tatsuhiro-t commented 8 years ago

I has similar error before, but I have not remembered what I did to fix this. It looks like standard library version related issue: http://stackoverflow.com/questions/4035445/linker-error-undefined-reference-to-stdctypechar-m-widen-init http://stackoverflow.com/questions/2643738/elf-linking-why-do-i-get-undefined-references-in-so-files

oparoz commented 8 years ago

It turns out it's a problem with the FreeBSD build system. So for people having trouble, just add this to your Makefile:

USE_GCC=    4.9

Sorry for the noise :)