I am trying to compile a plugin for my game server(more exectly this: click).
So, when I am trying to compile the plugin in my linux VM(who uses centos 7+) with make command line, I get these errors:
Compiling plugin..
Compiling plugin SDK..
Linking (dynamic)..
/usr/bin/ld: cannot find -lmysqlclient_r
/usr/bin/ld: skipping incompatible //usr/local/lib/libboost_thread.a when searching for -lboost_thread
/usr/bin/ld: cannot find -lboost_thread
/usr/bin/ld: skipping incompatible //usr/local/lib/libboost_chrono.a when searching for -lboost_chrono
/usr/bin/ld: cannot find -lboost_chrono
/usr/bin/ld: skipping incompatible //usr/local/lib/libboost_date_time.a when searching for -lboost_date_time
/usr/bin/ld: cannot find -lboost_date_time
/usr/bin/ld: skipping incompatible //usr/local/lib/libboost_system.a when searching for -lboost_system
/usr/bin/ld: cannot find -lboost_system
/usr/bin/ld: skipping incompatible //usr/local/lib/libboost_atomic.a when searching for -lboost_atomic
/usr/bin/ld: cannot find -lboost_atomic
collect2: error: ld returned 1 exit status
make: *** [dynamic_link] Error 1
My question is how to avoid these errors?
Important note: the tutorial for compiling this plugin(on the main page on github for this plugin) is working for the newer versions for this plugin, but I need the R37 one.
The plugin is write in C and it has a makefile inside.
Thank you.
Install the libboost that goes with the distribution. Whatever you have in /usr/local/lib is bad.
Makefile uses -m32 compilation option for some reason causing 32 bit executable to be produced. So this executable will require 32 bit libraries. So you should either remove -m32 option or install required 32-bit dependencies.
Related
Im trying to compile a nasm x86 assembly program that uses the c library. The code is
section .text
global main
extern printf
main:
push msg
mov eax, 0
call printf
add esp, 4
ret
section .data
msg db "Hello", 0xa, 0
Its a simple program that should print "Hello". Im trying to compile this with 2 commands
nasm -f elf main.asm
gcc -m32 -o main main.o
However, running gcc -m32 -o main main.o gives some errors.
The errors are:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/bin/ld: cannot find libgcc_s.so.1
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for libgcc_s.so.1
collect2: error: ld returned 1 exit status
I tried to install gcc-multilib because I heard that it helps but I kept getting the same error. Ive also tried updating gcc but that also did not help anything.
EDIT: I fixed the errors! I had to install a 32 bit gcc library called lib32-gcc-libs and then it got fixed. However I still have 2 warnings.
main.o: warning: relocation in read-only section '.text'
warning: creating DT_TEXTREL in a PIE
What do these warnings mean and how do I fix them?
I was googling but I don't find a solution, I want to compile a C program with gcc in 32 bits on a x64 bits Debian system. I use the following command to compile:
gcc -m32 -o programExecutable -L/usr/lib/i386-linux-gnu/ -I/home/secnok/polarssl-
1.3.5/include/ -I/usr/local/include/libusb-1.0 main.c /home/secnok/polarssl-
1.3.5/library/libpolarssl.a /usr/local/lib/libusb-1.0.a -lpthread -ludev
and I obtain this output:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux gnu/4.7
/../../../libudev.so when searching for -ludev /usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../libudev.a when searching for -ludev
/usr/bin/ld: skipping incompatible /usr/lib/libudev.so when searching for -ludev
/usr/bin/ld: skipping incompatible /usr/lib/libudev.a when searching for -ludev
/usr/bin/ld: cannot find -ludev
I have installed the libraries gcc++cmultilib and ia32-libs. In the same way, I have exported the path:
export LD_LIBRARY_PATH="/lib32:/usr/lib32:$LD_LIBRARY_PATH"
and it still doesn't compile. This code compiles in x64 without errors, I just want to compile the same code for 32 bits.
Finally, I found the solution to compile it directly on 32bits statically and now it works. I think in this way, I don't need to worry about libraries compatibility between x64 and x86
I am currently trying to use the libssh.dll library to implement a c program that shall connect to remote computers.I am using gcc to compile the program. When compiling this program, I received this error:
i386 architecture of input file 'libssh/bin/libssh.ddl' is incompatible with i386:x86-64 output
I tried compiling the program with the -m32 flag, but then i receive these errors:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/4.8.2//libgcc_s.dll.a when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/4.8.2//libgcc.a when searching for -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../libcygwin.a when searching for -lcygwin
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/libgcc_s.dll.a when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-cygwin/4.8.2//libgcc.a when searching for -lgcc
Any ideas how to fix this issue?
You need to install the 32-bit version of the C library.
The 32-bit libraries are required if you want to be able to compile and link with the -m32 option.
Have you installed cygwin32 ?
Trying to link, I get this error:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../libmqic.so when searching for -lmqic
/usr/bin/ld: skipping incompatible /usr/lib/libmqic.so when searching for -lmqic
/usr/bin/ld: cannot find -lmqic
Turns out ld defaults to /usr/lib for the mqm library which contains 32bit libs, when it should fetch the 64bit libs in /usr/lib64
Is there any way to configure ld to default to /usr/lib64 so I can keep using -lmqic and not have to hardcode the path?
I have been given an assignment in school, and my lecture has stated that we need to use his pre compiled C library which contains an important function definition.
I have tried removing all current *.o files from the dir, there isn't any there currently.
The problem i have currently is as follows:
i386:x86-64 architecture of input file `libnavigation.a(great_circle.o)' is incompatible with i386 output
where libnavigation.a is the library name which contains the great_circle function.
uname -ma
Linux chris-SATELLITE-PRO-C850 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:19:42 UTC 2013 i686 i686 i686 GNU/Linux
I have tried adding the several command options to gcc
-m32 results in the same error error:
-m64 results in the error:
gcc -o dist/Debug/GNU-Linux-x86/c_assignment build/Debug/GNU-Linux-
x86/line_counter.o build/Debug/GNU-Linux-x86/main.o build/Debug/GNU-Linux-
x86/mayday.o
build/Debug/GNU-Linux-x86/rescue_assets.o build/Debug/GNU-Linux-x86/ship.o
build/Debug/GNU-
Linux-x86/system_handler.o libnavigation.a -lm -m64
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.a when
searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so when
searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.a when
searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so when
searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find crtn.o: No such file or directory
i am not sure how to progress from here, i've asked the teacher but no response as of yet.
Thanks,
Chris.
There are two ways to go from here
Ask the teacher to compile a 32-bit library
Use 64-bit linux
64-bit libraries are for 64-bit computers, 32-bit libraries are for 32-bit computers.
That's why software writers go through some additional effort to make 64-bit software, since 64-bit hardware has come into common use.
It looks like you are using a Toshiba SATELLITE PRO C850. All of the laptops of this family are fitted with a 64 bit CPU.
I would recommend to reinstall your OS selecting the 64 bit version. Note that a 64 bit OS can run 32 bit code.
If you don't want or aren't allowed to reinstall and your CPU is an Intel i3 or i5. You still have the possibility to install VirtualBox and create a 64 bit VM in it where you'll be able to use the 64 bit library.