I am trying to link to my project some static libraries compiled with gcc-5.
In my project i use clang to build. I have following errors:
undefined reference to 'stderr'
undefined reference to '__fprintf_chk'
undefined reference to '__vfprintf_chk'
Related
undefined reference to `SSL_library_init' error during the compiling for C++ API
The OpenSSL version I used is 1.1.1, and the error is:
../bin/linux_x64/ABI0/libDolphinDBAPI.so: undefined reference to `SSL_library_init'
../bin/linux_x64/ABI0/libDolphinDBAPI.so: undefined reference to `OPENSSL_add_all_algorithms_noconf'
../bin/linux_x64/ABI0/libDolphinDBAPI.so: undefined reference to `SSL_load_error_strings'
What is the version of OpenSSL? There may be problems with OpenSSL 1.1 and above, and OpenSSL 1.0 is required .
This is an example of compiling and installing OpenSSL from source code :
https://github.com/dolphindb/api-cplusplus
my platform configure is:
win10 64bits
QT5.8 32位(QT Creator 4.21 + MinGW5.30 32bits + Cmake 3.81 64bits)
Cmake configured as this blog
and I am in trouble that:
../../3rdparty/lib/liblibprotobuf.a(strtod.cc.obj): In function `strtod':
D:/Qt/Qt5.8.0/Tools/mingw530_32/i686-w64-mingw32/include/stdlib.h:399: undefined reference to `__mingw_strtod'
D:/Qt/Qt5.8.0/Tools/mingw530_32/i686-w64-mingw32/include/stdlib.h:399: undefined reference to `__mingw_strtod'
../../3rdparty/lib/libzlib.a(gzlib.c.obj): In function `snprintf':
D:/Qt/Qt5.8.0/Tools/mingw530_32/i686-w64-mingw32/include/stdio.h:557: undefined reference to `__ms_vsnprintf'
../../3rdparty/lib/libzlib.a(gzwrite.c.obj): In function `vsnprintf':
D:/Qt/Qt5.8.0/Tools/mingw530_32/i686-w64-mingw32/include/stdio.h:545: undefined reference to `__ms_vsnprintf'
../../3rdparty/lib/liblibpng.a(pngwrite.c.obj): In function `gmtime':
D:/Qt/Qt5.8.0/Tools/mingw530_32/i686-w64-mingw32/include/time.h:219: undefined reference to `_gmtime32'
../../3rdparty/lib/liblibjasper.a(jas_stream.c.obj): In function `vsnprintf':
D:/Qt/Qt5.8.0/Tools/mingw530_32/i686-w64-mingw32/include/stdio.h:545: undefined reference to `__ms_vsnprintf'
I can not solve undefined reference to __mingw_vfscanf and undefined reference to __ms_vsnprintfproblem. someone say it should be too chain problem,but my tool chain is builted in QT except cmake.
Trying to compile a third party library on MinGW in Code::Blocks on Lubuntu, and despite my absolute best efforts to eliminate the following undefined references which I've spent ages on, nothing is fixing the issues:
undefined reference to `_sfwgl_ext_EXT_swap_control
undefined reference to `_sfwgl_ext_ARB_pixel_format
undefined reference to `_sf_ptrc_wglChoosePixelFormatARB
undefined reference to `_sf_ptrc_wglGetPixelFormatAttribivARB
undefined reference to `_sfwgl_ext_ARB_multisample
undefined reference to `_sf_ptrc_wglGetPixelFormatAttribivARB
undefined reference to `_sfwgl_ext_ARB_pixel_format
undefined reference to `_sfwgl_ext_ARB_create_context
undefined reference to `_sfwgl_ext_ARB_create_context_profile
undefined reference to `_sf_ptrc_wglCreateContextAttribsARB
undefined reference to `_sf_ptrc_wglCreateContextAttribsARB
undefined reference to `_sf_ptrc_wglGetPixelFormatAttribivARB
undefined reference to `_sfwgl_ext_ARB_multisample
undefined reference to `_sf_ptrc_wglGetPixelFormatAttribivARB
undefined reference to `_sfwgl_LoadFunctions
From what I can tell is it's possibly some sort of missing GL library or graphics library, however I already have opengl32, gdi32, glu32, glut32 and gle added to the link library which has left the following undefined references untouched.
How do I fix the above errors?
[If it is a missing library or libraries, could I be linked to the download page for the appropriate headers and .a files for MinGW on linux? Thanks.]
I am trying to make .lib file of ARPACK library to use with VS2012 Express Edition. Hence I am using the command in MSYS as :
dllwrap --export-all-symbols BLAS/.o LAPACK/.o SRC/.o UTIL/.o
-lgfortran --output-def arpack_win32.def -o arpack_win32.dll
This results in error:
real_write' UTIL/smout.o:smout.f:(.text+0x12cf): undefined reference
to _gfortran_transfer_ array_write'
UTIL/smout.o:smout.f:(.text+0x12f1): undefined reference to
_gfortran_transfer_ integer_write'
UTIL/smout.o:smout.f:(.text+0x13b4): undefined reference to
_gfortran_transfer_ integer_write'
UTIL/smout.o:smout.f:(.text+0x13ef): undefined reference to
_gfortran_transfer_ real_write' UTIL/smout.o:smout.f:(.text+0x1581):
undefined reference to _gfortran_transfer_ array_write'
UTIL/smout.o:smout.f:(.text+0x15a3): undefined reference to
_gfortran_transfer_ integer_write'
UTIL/smout.o:smout.f:(.text+0x1666): undefined reference to
_gfortran_transfer_ integer_write'
UTIL/smout.o:smout.f:(.text+0x16a1): undefined reference to
_gfortran_transfer_ real_write' UTIL/svout.o:svout.f:(.text+0xb4):
undefined reference to _gfortran_transfer_ch aracter_write'
UTIL/svout.o:svout.f:(.text+0xd2): undefined reference to
_gfortran_transfer_ch aracter_write'
UTIL/svout.o:svout.f:(.text+0x1b5): undefined reference to
_gfortran_transfer_i nteger_write'
UTIL/svout.o:svout.f:(.text+0x1cd): undefined reference to
_gfortran_transfer_i nteger_write'
Cant figure it out why this happens....Thanks..
Finally figured out what was wrong....I was using MinGW with gfortran..... Adding C:\MinGW\bin to PATH solved all the issues.....
I'm trying to build a little utility program that relies upon GraphicsMagick C++ library but I got the following error when linking to the library:
make all-recursive
make[1]: Entering directory `/home/ale/sample'
Making all in src
make[2]: Entering directory `/home/ale/sample/src'
g++ -g -O2 -o mysample mysample-a.o -L/usr/local/lib -lexiv2 -L/usr/local/lib -lGraphicsMagick++ -lGraphicsMagick
/usr/local/lib/libGraphicsMagick.a(magick_libGraphicsMagick_la-png.o): In function `png_put_data':
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:1171: undefined reference to `png_get_io_ptr'
/usr/local/lib/libGraphicsMagick.a(magick_libGraphicsMagick_la-png.o): In function `PNGWarningHandler':
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:1357: undefined reference to `png_error'
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:1361: undefined reference to `png_get_error_ptr'
/usr/local/lib/libGraphicsMagick.a(magick_libGraphicsMagick_la-png.o): In function `PNGErrorHandler':
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:1338: undefined reference to `png_get_error_ptr'
/usr/local/lib/libGraphicsMagick.a(magick_libGraphicsMagick_la-png.o): In function `png_get_data':
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:1060: undefined reference to `png_get_io_ptr'
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:1076: undefined reference to `png_warning'
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:1077: undefined reference to `png_error'
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:1067: undefined reference to `png_warning'
/usr/local/lib/libGraphicsMagick.a(magick_libGraphicsMagick_la-png.o): In function `png_write_raw_profile':
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:6243: undefined reference to `png_malloc'
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:6253: undefined reference to `png_malloc'
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:6254: undefined reference to `png_malloc'
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:6281: undefined reference to `png_set_text'
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:6282: undefined reference to `png_free'
/home/ale/Downloads/GraphicsMagick-1.3.18/coders/png.c:6283: undefined reference to `png_free'
Why does the library in /usr/local/lib refers to GraphicsMagick source code (that I've built and installed)?
Errors says that you need to link with libpng too.
You having very descriptive source-code related errors because you've built graphicsmagick with debugging symbols. In release build (or if you'll strip debugging symbols out of debug build) you'll see only undefined function names, without source code references of where they're being used.