Linker complains under Linux


#1

The linux-part of my CMakeLists.txt is:

add_executable(wof ${SA_SRC})
TARGET_LINK_LIBRARIES( wof gmp pthread /home/geom/repoWOF/dev/3rdParty/lex/libs/amd64/libLexActivator.a libcurl.a libnss3.so )

Is this correct? The linker complains:

/usr/bin/ld: ../3rdParty/lex/libs/amd64/libLexActivator.a(libcurl_la-nss.o): undefined reference to symbol 'PR_GMTParameters'
//usr/lib/x86_64-linux-gnu/libnspr4.so: error adding symbols: DSO aus der Kommandozeile fehlt
collect2: error: ld returned 1 exit status
CMakeFiles/wof.dir/build.make:552: recipe for target 'wof' failed
make[2]: *** [wof] Error 1
make[2]: Verzeichnis „/home/geom/repoWOF/dev/build“ wird verlassen
CMakeFiles/Makefile2:75: recipe for target 'CMakeFiles/wof.dir/all' failed
make[1]: *** [CMakeFiles/wof.dir/all] Error 2
make[1]: Verzeichnis „/home/geom/repoWOF/dev/build“ wird verlassen
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2

I*m running Ubuntu 18.04.


#2

Hi,

Libnss is the only dependency of Lexactivator. You need to ensure that libnss3 package is installed on the systems where you deploy the app.


#3

libnss3 is installed:

sudo apt-get install libnss3-dev libnss3
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
libnss3 ist schon die neueste Version (2:3.35-2ubuntu2.1).
libnss3-dev ist schon die neueste Version (2:3.35-2ubuntu2.1).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

…and I have removed curl:
TARGET_LINK_LIBRARIES( wof gmp pthread /home/geom/repoWOF/dev/3rdParty/lex/libs/amd64/libLexActivator.a libnss3.so )

but still

/usr/bin/ld: ../3rdParty/lex/libs/amd64/libLexActivator.a(libcurl_la-nss.o): undefined reference to symbol 'PR_GMTParameters'
//usr/lib/x86_64-linux-gnu/libnspr4.so: error adding symbols: DSO aus der Kommandozeile fehlt
collect2: error: ld returned 1 exit status
CMakeFiles/wof.dir/build.make:552: recipe for target 'wof' failed

#4

Hi,

In the fresh sample try running the make command.


#5

Thank you, it works. I just had trouble translating the Makefile options to CMake.