Fix libgsoap linking in src/CMakeLists.txt #4175
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
libgsoap supplies both libgsoap++.a and libgsoapssl++.a however an application should link to one of those libraries not both.
An example from gsoap-2.8 samples:
With SSL:
/usr/bin/clang++ -DLINUX -g -O2 -o json-GitHub json_GitHub-json-GitHub.o json_GitHub-xml-rpc.o json_GitHub-json.o json_GitHub-soapC.o ../../../gsoap/libgsoapssl++.a -lm -lssl -lcrypto -lz
Without SSL:
/usr/bin/clang++ -DLINUX -g -O2 -o json-currentTimeServer json-currentTimeServer.o xml-rpc.o json.o soapC.o ../../../gsoap/libgsoap++.a -lm -lpthread
Right now src/CMakeLists.txt is try to link to both libgsoap++ and libgsoapssl++.
/usr/bin/ld: /lib/libgsoapssl++.a(libgsoapssl___a-stdsoap2_ssl_cpp.o): in function
soap_query': (.text+0x1880): multiple definition of
soap_query'; /lib/libgsoap++.a(libgsoap___a-stdsoap2_cpp.o):(.text+0x1890): first defined here/usr/bin/ld: /lib/libgsoapssl++.a(libgsoapssl___a-stdsoap2_ssl_cpp.o): in function
soap_query_decode': (.text+0x18a0): multiple definition of
soap_query_decode'; /lib/libgsoap++.a(libgsoap___a-stdsoap2_cpp.o):(.text+0x18b0): first defined here/usr/bin/ld: /lib/libgsoapssl++.a(libgsoapssl___a-stdsoap2_ssl_cpp.o): in function
soap_query_key': (.text+0x1a50): multiple definition of
soap_query_key'; /lib/libgsoap++.a(libgsoap___a-stdsoap2_cpp.o):(.text+0x1a60): first defined hereChange src/CMakeLists.txt so that
This means that if openssl is not detected libgsoap++ will be linked otherwise libgsoapssl++ will be linked.