Linker errors in libqt5network.so - c++

Hello dear stack overflow users,
lately I tried to compile a qt5 project on my suse machine.
It seems that my linker refuses to link the libqt5network.so against openssl.
And I fail to understand why:
/usr/lib64/libQt5Network.so:-1: error: undefined reference to `TLSv1_1_server_method'
/usr/lib64/libQt5Network.so:-1: error: undefined reference to `SSL_set_psk_client_callback'
/usr/lib64/libQt5Network.so:-1: error: undefined reference to `TLSv1_1_client_method'
/usr/lib64/libQt5Network.so:-1: error: undefined reference to `SSL_select_next_proto'
/usr/lib64/libQt5Network.so:-1: error: undefined reference to `SSL_get0_next_proto_negotiated'
/usr/lib64/libQt5Network.so:-1: error: undefined reference to `TLSv1_2_client_method'
/usr/lib64/libQt5Network.so:-1: error: undefined reference to `SSL_CTX_set_next_proto_select_cb'
/usr/lib64/libQt5Network.so:-1: error: undefined reference to `TLSv1_2_server_method'
/usr/lib64/libQt5Network.so:-1: error: undefined reference to `EC_curve_nist2nid'
This Method seems the culprit, which shall download some information of a book frome the worldcat book database by its public api:
void Worldcat::search(QString searchTerm){
if(book1!=NULL){
setIsbn(searchTerm);
QNetworkRequest request(apiUri+getIsbn()+QString("?method=getMetadata&format=json&fl=*"));
networkManager = new QNetworkAccessManager(this);
connect(networkManager,SIGNAL(finished(QNetworkReply*)),
this,SLOT(replyFinished(QNetworkReply*)));
networkManager->get(request);
}
}
qmake.pro file
http://pastebin.com/Qk83kLaQ
The Generated make file, it is huge therefore paste bin:
http://pastebin.com/KuF9Y0JS

I will answer it myself since I found the solution when my mongodb also refused to start, maybe it is usefeull to someone the following does help:
zypper in libopenssl-devel
rpm -e --nodeps libopenssl0_9_8
cd /usr/lib64/
ln -s libssl.so libssl.so.0.9.8
ln -s libcrypto.so libcrypto.so.0.9.8
Seems that tumble weed has a mess with its openssl librarys.
Where I found the solution:
https://stackoverflow.com/a/32406299/4958693
Original source:
https://jira.mongodb.org/browse/SERVER-20259

Related

Undefined reference to nlopt_... symbols

I am fairly new to Fortran and this may sound like a silly question. I encounter an error when compiling the Fortran code that is posted as an example in the NLOPT Wiki.
I compile in Ubuntu 18.04 LTS using the following command:
gfortran example-nlopt.f90 -o example-nlopt -I/usr/local/include/
The following error is produced in the terminal:
/tmp/ccbAim6b.o: In function `MAIN__':
example-nlopt.f90:(.text+0x26): undefined reference to `nlo_create_'
example-nlopt.f90:(.text+0x42): undefined reference to `nlo_get_lower_bounds_'
example-nlopt.f90:(.text+0x67): undefined reference to `nlo_set_lower_bounds_'
example-nlopt.f90:(.text+0x8a): undefined reference to `nlo_set_min_objective_'
example-nlopt.f90:(.text+0xca): undefined reference to `nlo_add_inequality_constraint_'
example-nlopt.f90:(.text+0x10e): undefined reference to `nlo_add_inequality_constraint_'
example-nlopt.f90:(.text+0x12d): undefined reference to `nlo_set_xtol_rel_'
example-nlopt.f90:(.text+0x164): undefined reference to `nlo_optimize_'
example-nlopt.f90:(.text+0x305): undefined reference to `nlo_destroy_'
collect2: error: ld returned 1 exit status
Based on what I saw in nlopt's documentation (https://nlopt.readthedocs.io/en/latest/NLopt_Installation/#changing-the-installation-directory) it looks like you just need to specify the library to link against. Maybe try this:
gfortran -I/usr/local/include/ -L/usr/local/lib example-nlopt.f90 -o example-nlopt -lnlopt -lm
This assumes you have the libnlopt.so in /usr/local/lib, if not then point to its location with the -L option.

How to build sml3d from svn?

I'm trying to build the sml3d from the SVN source (is there an another way?).
First, checked out the source with the following command like below:
$svn co --username anonsvn \
https://smlnj-gforge.cs.uchicago.edu/svn/sml3d/trunk sml3d
Then, I read sml3d/README 'BUILDING FROM SVN' section and tried like ...
$autoheader -Iconfig
$autoconf -Iconfig
$./configure
At this point, I got these many errors...
(snip)
make[1]: Entering directory `/home/eldesh/work/sml3d/sml3d/gen/fi-gen'
cc gen-sdl-offsets.c -o gen-sdl-offsets
/tmp/ccmu83YP.o: In function `main':
gen-sdl-offsets.c:(.text+0xb1): undefined reference to `prField'
gen-sdl-offsets.c:(.text+0xcd): undefined reference to `prField'
gen-sdl-offsets.c:(.text+0xe9): undefined reference to `prField'
gen-sdl-offsets.c:(.text+0x105): undefined reference to `prField'
gen-sdl-offsets.c:(.text+0x121): undefined reference to `prField'
/tmp/ccmu83YP.o:gen-sdl-offsets.c:(.text+0x13d): more undefined references to `prField' follow
/tmp/ccmu83YP.o: In function `main':
gen-sdl-offsets.c:(.text+0x1a9): undefined reference to `prConst'
blah blah blah...
Next, I guess the correct building protocol like below:
$autoheader -Iconfig
$autoconf -Iconfig
$./configure --enable-dev
$mkdir -p src/sml3d/opengl/c-abi
$cd gen/gen-from-xml/specs
$make
$../../../bin/glgen targets.json
$../../../bin/grpgen targets.json
But I got not-exists and Undefined errors yet:
~/sml3d/sml3d$ make
(snip)
make[2]: Entering directory `/home/eldesh/work/sml3d/sml3d/src/sml3d'
/home/eldesh/lcl/bin/mlton -mlb-path-var 'GL_DIR gl32' -stop tc sml3d.mlb
Error: opengl/opengl-32.mlb 45.3.
File gl-object-fn.sml does not exist.
Error: gl32/gl32-types.sml 8.26.
Undefined functor GLObjectFn.
(snip)
Error: gl32/frame-buffer.sml 11.14.
Undefined structure FramebufObj.
Error: gl32/frame-buffer.sml 13.25.
Undefined structure RenderbufObj.
(snip)
Error: gl32/frame-buffer.sml 7.27.
Type texture_id in signature but not in structure.
Error: gl32/frame-buffer.sml 60.14.
...
How to build sml3d correctly ?
environment
I use runtime/systems...
smlnj 110.77
mlton 20130715
linux x86

Error in linking external libraries

I downloaded TripleBit's source code from http://grid.hust.edu.cn/triplebit/TripleBit.tar.gz.
It required me to install two libraries:
i) boost-1.39.0.tar.gz
ii) raptor-1.4.21.tar.gz
I installed them using :
sudo apt-get install libboost-dev
sudo apt-get install libraptor-dev
However, after I entered into TripleBit's directory and ran "make". I go the following errors:
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:38: undefined reference to `raptor_init'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:39: undefined reference to `raptor_new_parser'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:40: undefined reference to `raptor_set_statement_handler'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:42: undefined reference to `raptor_uri_filename_to_uri_string'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:43: undefined reference to `raptor_new_uri'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:44: undefined reference to `raptor_uri_copy'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:45: undefined reference to `raptor_parse_file'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:47: undefined reference to `raptor_free_parser'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:48: undefined reference to `raptor_free_uri'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:49: undefined reference to `raptor_free_uri'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:50: undefined reference to `raptor_free_memory'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:52: undefined reference to `raptor_finish'
collect2: ld returned 1 exit status
make: *** [bin/lrelease/buildTripleBitFromRDF] Error 1
The library files which reside within /usr/local/lib are:
libboost_filesystem.so, libraptor.a, libraptor.la, libraptor.so, libraptor.so.1
and libraptor.so.1.2.0
Also the files which reside within /usr/lib are:
libraptor.a, libraptor.la, libraptor.so, libraptor.so.1, libraptor.so.1.2.0,
libraptor2.so.0, libraptor2.so.0.0.0, librasqal.so.3, librasqal.so.3.0.0, librdf.so.0,
librdf.so.0.0.0, librest-0.7.so.0, librest-0.7.so.0.0.0.
Can someone please help me in finding out the error.
I ran it on ubuntu 12.04
Look into TripleBit Makefile. You are missing -lraptor linker option. This entry should be returned by raptor-config --libs.
You can also run nm tool against libraptor.a file and check if it wasn't compiled with RAPTOR_DISABLE_V1 option.
Look into TripleBit Makefile, you can remove the "BuildTripleBitFromRDF" in line 82(modules := ..), so that you can escape the errors, but the "BuildTripleBitFromRDF" will not build into the executables. So when the dataset you download is a RDF dataset, You can use raptor to convert RDF dataset into N3 dataset, and then use the buildTripleBitFromN3 tool to go on.
The probable problem is the wrong installing in raptor.

Undefined references in png++

I am new to C++ on linux enviroment and am trying to use the png++ library for a project. The problem I am facing is that that a simple program I write using png++ incudes does not work and shows me the following errors
AProg.o: In function `png::info_base::info_base(png::io_base&, png_struct_def*)':
AProg.cpp:(.text._ZN3png9info_baseC2ERNS_7io_baseEP14png_struct_def[_ZN3png9info_baseC5ERNS_7io_baseEP14png_struct_def]+0x21): undefined reference to `png_create_info_struct'
AProg.o: In function `png::info::write() const':
AProg.cpp:(.text._ZNK3png4info5writeEv[png::info::write() const]+0xd4): undefined reference to `png_set_PLTE'
AProg.cpp:(.text._ZNK3png4info5writeEv[png::info::write() const]+0x137): undefined reference to `png_set_tRNS'
AProg.cpp:(.text._ZNK3png4info5writeEv[png::info::write() const]+0x14f): undefined reference to `png_write_info'
AProg.o: In function `png::info::sync_ihdr() const':
AProg.cpp:(.text._ZNK3png4info9sync_ihdrEv[png::info::sync_ihdr() const]+0x79): undefined reference to `png_set_IHDR'
AProg.o: In function `png::end_info::destroy()':
AProg.cpp:(.text._ZN3png8end_info7destroyEv[png::end_info::destroy()]+0x48): undefined reference to `png_destroy_info_struct'
AProg.o: In function `png::end_info::write() const':
AProg.cpp:(.text._ZNK3png8end_info5writeEv[png::end_info::write() const]+0x1a): undefined reference to `png_write_end'
AProg.o: In function `png::io_base::set_swap() const':
AProg.cpp:(.text._ZNK3png7io_base8set_swapEv[png::io_base::set_swap() const]+0x1b): undefined reference to `png_set_swap'
.............. (and it goes on).
The background of what I have done so far.
1 : I have gcc/g++ configured correctly.
2 : I have correctly installed libpng-1.2.50. The result seems to be correct.
This is how my usr/local folder looks now
:/usr/local/include$ ls
libpng12 libpng15 png++ pngconf.h png.h pnglibconf.h
:/usr/local/lib$ ls
libpng12.a libpng12.so libpng12.so.0.50.0 libpng15.la libpng15.so.15 libpng.a libpng.so libpng.so.3.50.0 python2.7
libpng12.la libpng12.so.0 libpng15.a libpng15.so libpng15.so.15.12.0 libpng.la libpng.so.3 pkgconfig
:/usr/local/bin$ ls
eclipse libpng-1.2.50 libpng12-config libpng-1.5.12 libpng15-config libpng-config png++-0.2.5
3 : After that I followed the following ( http://www.nongnu.org/pngpp/doc/0.2.5/ ) to install the png++-0.2.5 and all the five steps didnt gave any error.
But after that when I tried to compile a simple program (with the instructions given at the same site : http://www.nongnu.org/pngpp/doc/0.2.5/ ) it would not compile.
:~/workspace/AProg$ g++ -o AProg AProg.o 'libpng-config --ldflags'
g++: error: libpng-config --ldflags: No such file or directory
Then I tried to solve the problem and google it and gave this command which seems to work fine at compile but when I tried to run it. I got the error as mentioned at the top of the post
:~/workspace/AProg$ g++ -c AProg.cpp -I/usr/local/include/libpng12 -L/usr/local/lib -lpng -I/usr/local/include/png++
:~/workspace/AProg$
I am sorry for such a long post. But I just wanted to explain anything /everything related to my problem. Hope somebody helps me here.
It seems that the quotes you use in the linker command line is not the correct ones, it should be the single back quote:
$ g++ -o AProg AProg.o `libpng-config --ldflags`

Problems compiling an external library on linux

So I am trying to compile the libssh2 library on linux, but when I try to compile the
example it comes up with a lot of errors, and even though I include the headerfile it asks for, it still asks for it.
Here are the error messages and the resulting messages:
~/ gcc -include /home/Roosevelt/libssh2-1.2.5/src/libssh2_config.h -o lolbaise /home/Roosevelt/libssh2-1.2.5/example/scp.c
/home/Roosevelt/libssh2-1.2.5/example/scp.c:7:28: error: libssh2_config.h: No such file or directory
/home/Roosevelt/libssh2-1.2.5/example/scp.c: In function 'main':
/home/Roosevelt/libssh2-1.2.5/example/scp.c:39: error: storage size of 'sin' isn't known
/home/Roosevelt/libssh2-1.2.5/example/scp.c:81: error: 'AF_INET' undeclared (first use in this function)
/home/Roosevelt/libssh2-1.2.5/example/scp.c:81: error: (Each undeclared identifier is reported only once
/home/Roosevelt/libssh2-1.2.5/example/scp.c:81: error: for each function it appears in.)
/home/Roosevelt/libssh2-1.2.5/example/scp.c:81: error: 'SOCK_STREAM' undeclared (first use in this function)
/home/Roosevelt/libssh2-1.2.5/example/scp.c:87: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
Here is the new errors:
scp.c:(.text+0x106): undefined reference to `libssh2_init'
scp.c:(.text+0x1fe): undefined reference to `libssh2_session_init_ex'
scp.c:(.text+0x234): undefined reference to `libssh2_session_startup'
scp.c:(.text+0x288): undefined reference to `libssh2_hostkey_hash'
scp.c:(.text+0x36f): undefined reference to `libssh2_userauth_password_ex'
scp.c:(.text+0x3e7): undefined reference to `libssh2_userauth_publickey_fromfile_ex'
scp.c:(.text+0x437): undefined reference to `libssh2_scp_recv'
scp.c:(.text+0x531): undefined reference to `libssh2_channel_read_ex'
scp.c:(.text+0x5f8): undefined reference to `libssh2_channel_free'
scp.c:(.text+0x628): undefined reference to `libssh2_session_disconnect_ex'
scp.c:(.text+0x636): undefined reference to `libssh2_session_free'
scp.c:(.text+0x66e): undefined reference to `libssh2_exit'
collect2: ld returned 1 exit status
The header file is not included: libssh2_config.h
There is an inclusion directive in the source code, so you have to indicate the path to the header with the -I option: gcc -I/home/Roosevelt/libssh2-1.2.5/src
The -include option shall be used to include a header file which is not explicitly included in the source code with a #include directive.
I just cloned the current git build and went into the 1.2.5 relase but I'm unable to reproduce your problem.
./buildconf
./configure
make
works fine. What are you trying to do exactly?