GSoap QT undefined reference to `soap_new'? - gsoap

I'm trying to use gSoap in QT. When I compile my project I get:
undefined reference to `soap_new'
undefined reference to `soap_delete'
undefined reference to `soap_end'
undefined reference to `soap_free'
undefined reference to `soap_delete'
undefined reference to `soap_end'
undefined reference to `soap_free'
My sample pro contains:
INCLUDEPATH += ../../gsoap-2.8/gsoap/
LIBS += -lwsock32
Any idea what's wrong?
I produced file with:
soapcpp2 -I ../../gsoap-2.8/gsoap/import -i quote.h
soapcpp2 -I ../../gsoap-2.8/gsoap/import quote.h

Those functions are defined in sdtsoap2.c or stdsoap2.cpp (depending if you are using C or C++; for Qt I infer C++).
You must either include stdsoap2.cpp in your project or link against libsoap++.
If you need to pass different flags like WITH_NONAMESPACES, use the first.If you have no special configuration for GSOAP, use the later.
Look at GSOAP docs for more info.

Related

FFmpeg libraries on Windows - Undefined References

I am trying to use FFmpeg libraries available from here under Windows 10 (64 bits). I downloaded version=20181126-90ac0e5, architecture=Windows-64, Linking=Dev. There are 3 folders inside that FFmpeg folder: examples, lib and include.
To use these libraries I copied the contents of the "include" folder to the "include" folder of my MinGW installation. I also copied the contents of the "lib" folder to the "lib" folder of MinGW.
I try to compile the decode_video.c example that comes inside the examples folder with the following way:
gcc decode_video.c -o decode_video.exe -lavcodec -lavutil -lavformat -lm
The compiler gives me these undefined references:
undefined reference to `avcodec_send_packet'
undefined reference to `avcodec_receive_frame'
undefined reference to `av_packet_alloc'
undefined reference to `avcodec_find_decoder'
undefined reference to `av_parser_init'
undefined reference to `avcodec_alloc_context3'
undefined reference to `avcodec_open2'
undefined reference to `av_frame_alloc'
undefined reference to `av_parser_parse2'
undefined reference to `av_parser_close'
undefined reference to `avcodec_free_context'
undefined reference to `av_frame_free'
undefined reference to `av_packet_free'
I would like to know what I am doing wrong here. Any guidance is very welcome.

GCC ICU 57 static linking

I am trying to link ICU 57 to my binary file. That does not work even thought (I think at least) I am linking the static lib files.
Here is a blunt example:
gcc -static /usr/lib/libicui18n.a /usr/lib/libicuuc.a /usr/lib/libicudata.a /usr/lib/libicule.a /usr/lib/libiculx.a /usr/lib/libicutu.a /usr/lib/libicuuc.a /usr/lib/libicuio.a obj/ex.o obj/msg.o -o bin/ex
This is the error message that I get:
src/msg.c:5: undefined reference to `u_fopen_57'
src/msg.c:9: undefined reference to `u_fgetfile_57'
src/msg.c:10: undefined reference to `u_fgetfile_57'
src/msg.c:11: undefined reference to `u_frewind_57'
src/msg.c:18: undefined reference to `u_fgetc_57'
src/msg.c:17: undefined reference to `u_feof_57'
src/msg.c:25: undefined reference to `u_fclose_57'
Linking the dynamic libs works fine though.
If you can, I'd recommend using pkg-config as I recommended here,
specifically with pkg-config --static … as explained here

Can't compile and link library

I try to use a library compiled with gcc called matlisp based on fortran code. After specifyng the f77 compiler, I could performed the autoreconf, configure and make command to obtain the file libmatlisp.so.
But when I try to use it i get a:
Error opening shared object ".../libmatlisp.so":
/usr/lib/libf2c.so.2: undefined symbol: MAIN__.
And when i perform the command ld libmatlisp.so i get:
...
libmatlisp.so: undefined reference to `idamax_'
libmatlisp.so: undefined reference to `dger_'
/usr/lib/libf2c.so.2: undefined reference to `MAIN__'
libmatlisp.so: undefined reference to `zscal_'
libmatlisp.so: undefined reference to `dscal_'
....
Is there a way to improve the situation?
I already try this solution but it does not work.
I also try to change the compiler to gfortran but i get some some run time error messages mentionning missing libraries that are part of libf2c.
Ok. I move to a more recent source of matlisp 2012 instead of 2003, and it run properly in my environment now.

Blackberry 10 undefined reference to `__sync_fetch_and_add_4

On Blackberry 10 using C++ I am getting the following link errors
undefined reference to __sync_fetch_and_add_4
undefined reference to __sync_fetch_and_sub_4
undefined reference to__sync_bool_compare_and_swap_4
Anyone know which library I am missing. The Momentics IDE is using GCC 4.6.3
Thanks
Wild stab in the dark but is it the 'math' library which can be added by including LIBS += -lm in your .pro file.

Cross-compiling with OpenSSL for Windows

I'm trying to compile the oauth-utils
http://mir.dnsalias.com/oss/oauth/start
for Windows from Ubuntu. I have compiled it on Windows before
(a few months back), but wanted to try cross-compiling.
I got openssl build using mingw32 ok, and put
libssl.a and libcrypto.a in the right place. The linker is now
finding the libraries (yay!) but I get the following error:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xaac): undefined reference to `_CreateDCA#16'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xab9): undefined reference to `_CreateCompatibleDC#4'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xacc): undefined reference to `_GetDeviceCaps#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xadc): undefined reference to `_GetDeviceCaps#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xaf4): undefined reference to `_CreateCompatibleBitmap#12'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb04): undefined reference to `_SelectObject#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb18): undefined reference to `_GetObjectA#12'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb81): undefined reference to `_BitBlt#36'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb8c): undefined reference to `_GetBitmapBits#12'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbe5): undefined reference to `_SelectObject#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbec): undefined reference to `_DeleteObject#4'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbf6): undefined reference to `_DeleteDC#4'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xc00): undefined reference to `_DeleteDC#4'
Any ideas what could be causing this?
Thanks.
Link with Gdi32.lib
Which version of OpenSSL are you trying to compile?
In general, I have found version 1.0 and newer with MinGW-w64 to work great.
See for example the OpenSSL cross-compilation for Windows tutorial.
It seems that if one remove everything between
static void readscreen(void)
{
#if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN)
and
#endif /* !OPENSSL_SYS_WINCE */
}
in rand_win.c, that building works. I'm not 100% sure how safe removing this is.
Are you adding -mwindows to your link command?

Resources