DLL file format not recognized - c

So I've been trying to install the luasql-mysql module for a while now and I keep running into problems. This time when I go to install it gives me this error:
luasql-mysql 2.5.0-1 depends on lua >= 5.1 (5.3-1 provided by VM)
mingw32-gcc -O2 -c -o src/luasql.o -IC:\Program Files\lua-5.3.5\src src/luasql.c -
Ic:/windows/system32/include
mingw32-gcc -O2 -c -o src/ls_mysql.o -IC:\Program Files\lua-5.3.5\src src/ls_mysql.c -
Ic:/windows/system32/include
mingw32-gcc -shared -o luasql/mysql.dll src/luasql.o src/ls_mysql.o -Lc:/windows/system32 -
lmysqlclient C:\Program Files\lua-5.3.5\src/lua53.dll -lm
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lmysqlclient
C:\Program Files\lua-5.3.5\src\lua53.dll: file not recognized: file format not recognized
collect2.exe: error: ld returned 1 exit status
Error: Build error: Failed compiling module luasql/mysql.dll
I'm going to try reinstalling everything and hopefully that works but if anyone knows why I'm getting this problem then I would appreciate the help.

Related

How to fix 'sincos##GLIBC_2.2.5' undefined reference for fftw3 library

I have been trying to install and execute a c-program using fftw3 library on Ubuntu machine but getting this error so many times.
How to fix the error? Help is much appreciated.
latest source code was downloaded: http://www.fftw.org/download.html
Install commands:
sudo -H ./configure --enable-float --enable-sse --enable-threads
sudo -H make
sudo -H make install
Trying to compile:
gcc -Wall -O3 -o jediconvolve jediconvolve.c -L /usr/local/lib -lm -lcfitsio -lfftw3f
Errors:
bhishan#jedisim_sources:gcc -Wall -O3 -o jediconvolve jediconvolve.c -L /usr/local/lib -lm -lcfitsio -lfftw3f
/usr/bin/ld: /usr/local/lib/libfftw3f.a(trig.o): undefined reference to symbol 'sincos##GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
file jediconvolve.c to test
https://pastebin.com/fHKwejj7

file not recognized: File format not recognized error in C

Hey I am currently learning C and tried to divide my code in multiple files. But when it comes to compile the project, I got this error :
mingw32-gcc.exe -Wall -g -c D:\IDE\CodeBlocks\Projects\Tuto\main.c -o obj\Debug\main.o
mingw32-g++.exe -o bin\Debug\Tuto.exe obj\Debug\dico.o dico.h.gch obj\Debug\main.o
dico.h.gch: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
I tried to clean and/or rebuild my project but nothing goes through this issue. Can anyone help me please ??
dico.h.gch is a precompiled header. You aren't supposed to link it with your objects. Remove it from the line that creates Tuto.exe.

How to solve the linking error in libwebsockets

I use libwebsockets for a client program in C. Therefore I build the library for the libwebsocktes locally on my machine (ubuntu). After I want to Build the Project in Eclipse, I get the following output:
14:58:40 **** Incremental Build of configuration Build (GNU) for project ClientA ****
make all
cc -o clientA ifaddrs.o mo.o misc.o dm.o ws.o -lcurl -lrt -lxml2 -ljson-c -lssl -lcrypto -lpthread -Wl,-Bstatic -L/home/vps/src/libwebsockets/build/lib -lwebsockets -Wl,-Bdynamic
/usr/bin/ld: /home/bla/libwebsockets/build/lib/libwebsockets.a(ssl.c.o): undefined reference to symbol 'SSL_get_fd##OPENSSL_1.0.0'
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libssl.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [clientA] Error 1
14:58:41 Build Finished (took 1s.223ms)
It seems to be a problem with the libwebsockets.a. But how I can solve it ?

Error while trying to create shared library

I am trying to create the shared library (.so) so that I can call it using .External command from R for the lassoshooting package:
https://cran.r-project.org/web/packages/lassoshooting/
Basically, I have downloaded the package source from the above website. However, when I go the the correct directory (.../lassoshooting/src) and use the command
R CMD SHLIB -o ccd_r.so ccd_r.c
I get the following error:
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined
dynamic_lookup -single_module -multiply_defined suppress
-L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o ccd_r.so ccd_r.o -L/Library/Frameworks/R.framework/Resources/lib
-lRblas -L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [ccd_r.so] Error 1
Why is this happening?

Error occurs when compiling with GCC

I am attempting to compile a C program with multiple files on window platform. However, when I make it, errors are occurred. I have already tried to modify command in makefile but still could not fix it.
This is my GCC command:
gcc -o "SYSMONTR" $(OBJPATH)/chkdsksp ../chkdsksp.c -g -I"$(DB2PATH)/include" -I"$(MYLIBDIR)" $(MYIQDIR)/iqclilib.a $(OBJPATH)/icrou.a -lc -ldb2 -lnsl -L"$(DB2PATH)/lib"
This is result:
gcc -o "SYSMONTR" ../../iLINKOBJ/chkdsksp ../chkdsksp.c -g -I"C:/Program Files/IBM/SQLLIB/include" -I"../../iLINKCLIB" ../../iLINKIQOBJ/iqclilib.a ../../iLINKOBJ/icrou.a -lc -ldb2 -lnsl -L"C:/Program Files/IBM/SQLLIB/lib"
../../iLINKOBJ/chkdsksp: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
makefile:49: recipe for target `SYSMONTR' failed
make: *** [SYSMONTR] Error 1
What could cause such error and what should I do with it? Using cygwin on Window (IDE: Eclipse).
Any supports will be appreciated.
If chkdsksp is an object file built by another team to run on AIX, you cannot expect it to function -- or even be recognized by your compiler -- on Cygwin. You must contact that team and get a) the source code or b) a version of the object file compiled for your platform (and tested).

Resources