Crt1.o no such file C ++ compilation error on linux x64

I am taking the first steps on the linux platform. I installed Centos x64. I am trying to create a small program with several functions and several unit tests.

I am using Netbeans 7.1.2 as a development environment.

Here is the result of the build process:

CLEAN SUCCESSFUL (total time: 671ms) "/usr/bin/gmake" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf gmake[1]: Entering directory `/home/john/Dev/GoatsCheese' "/usr/bin/gmake" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/goatscheese gmake[2]: Entering directory `/home/john/Dev/GoatsCheese' mkdir -p build/Debug/GNU-Linux-x86 rm -f build/Debug/GNU-Linux-x86/main.od g++ -m32 -c -g -I/usr/include/cppunit -MMD -MP -MF build/Debug/GNU-Linux-x86/main.od -o build/Debug/GNU-Linux-x86/main.o main.cpp mkdir -p dist/Debug/GNU-Linux-x86 g++ -m32 -o dist/Debug/GNU-Linux-x86/goatscheese build/Debug/GNU-Linux-x86/main.o /usr/bin/ld: crt1.o: No such file: No such file or directory collect2: ld returned 1 exit status 

The compiler is set up to create a 32-bit executable, but I should not think that this will be a problem (32-bit executables can be created on the x64 platform in Windows - a platform I am familiar with).

Find find the crt1.o file in the following places:

 locate crt1.o /usr/lib64/Mcrt1.o /usr/lib64/Scrt1.o /usr/lib64/crt1.o /usr/lib64/gcrt1.o 

I'm not sure if I am missing a package or if I need to create a symbolic link.

+4
source share
3 answers

You need to install the 32-bit standard C library development package. He probably named something like libc6-dev-i386 .

+11
source

I think ld was looking for a 32-bit crt1.o, but you only have a 64-bit version.

+2
source

The problem you cannot find crt1.o is probably because you are missing one of the library specifier options. I am not familiar with Netbeans, but you should add / usr / lib 64. Somewhere on the g ++ command line it should look like this: "-L / usr / lib64".

NB: This is an erroneous conclusion, suggesting that since it runs on Windows in this way, other platforms with the same processor will behave the same. It doesn’t sound like that.

I would suggest you create 32-bit binaries with a 32-bit library and build 64-bit binaries associated with a 64-bit library.

0
source

Source: https://habr.com/ru/post/1414701/


All Articles