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.
Related
im trying to complie some operating system example code and when i run make (in running the default debian eviroment on a chromebook lunix termial) it gives me the folowing error:
kuzai_longmane#penguin:/mnt/chromeos/removable/32GB/Operating systems (source code)/my_cool_os/my_cool_os$ make
gcc -m32 -nostdlib -nodefaultlibs -lgcc start.o libc/string/memcmp.o libc/string/memset.o libc/string/strcat.o libc/string/strchr.o libc/string/strcmp.o libc/string/strcpy.o libc/string/strlen.o libc/string/strncmp.o libc/string/strstr.o libc/string/strutil.o libc/string/ctos.o kernel/tty.o kernel/io.o kernel.o -T linker.ld -o myos
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
make: *** [Makefile:28: myos] Error 1
any sugestions or things i overlooked?
You're trying to generate and link 32-bit code (the -m32 option), but the linker can't find a 32-bit version of libgcc. The message says its is finding a 64-bit version, so the problem is probably just that you don't have 32-bit libs installed. I think on debian, you need to install the ia32-libs package for that.
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.
I am getting the below error during ./configure.
configure:3429: checking whether the C compiler works
configure:3451: gcc -m32 -D_FILE_OFFSET_BITS=64 -m32 conftest.c >&5
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
configure:3455: $? = 1
configure:3493: result: no
configure:3498: error: in `/root/cjk/1.x/src/externals/mecab':
configure:3500: error: C compiler cannot create executables
I have tried couple of solutions mentioned in internet but to no avail.
I have installed complete Developers package in the machine.
I have installed glibc-devel.i686 package as well.
I ran into the exact same issue (CentOS 6.5 x64, gcc 4.4.7). I made sure yum install glibc-devel.i686 was performed. A quick find / -name "libgcc_s.*" revealed:
/lib64/libgcc_s.so.1
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/32/libgcc_s.so
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/libgcc_s.so
So, perhaps you can try the workaround suggested here:
Add the absolute path to the gcc_s library on the link line, OR
(Recommended) If the library's filename has any major and minor version numbers appended to it, simply create a soft link to the library in the same location without the major and minor version numbers in the target filename.
I settled for compiling/linking my application statically by adding -static to my gcc invocation. So,
gcc -static -m32 ...
In that case make sure yum install glibc-static.i686 is done.
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 ?