Compiling Error /usr/bin/ld: cannot find -lboost - linux

Im trying to compile something in Ubuntu 14.04 and get this error message while libboost package is already installed.
/usr/bin/ld: cannot find -lboost_system
/usr/bin/ld: cannot find -lboost_filesystem
/usr/bin/ld: cannot find -lboost_program_options
/usr/bin/ld: cannot find -lboost_thread
collect2: error: ld returned 1 exit status
I hope somebody can help me fast to resolve this error.
Many thanks!

You need to install libboost-all-dev package.

Related

/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libQtCore.so when searching for -lQtCore

When I try to build a new project using Qt Creator, I get these errors:
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libQtGui.so when searching for -lQtGui
/usr/bin/ld: cannot find -lQtGui
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libQtCore.so when searching for -lQtCore
/usr/bin/ld: cannot find -lQtCore
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpthread.a when searching for -lpthread
collect2: error: ld returned 1 exit status
make: *** [untitled] Error 1
This is the command line from Compile Output:
g++ -m32 -o untitled main.o mainwindow.o moc_mainwindow.o -L/usr/lib/x86_64-linux-gnu -lQtGui -lQtCore -lpthread
It seems it is trying to build in 32-bit mode even though I'm on Ubuntu 64-bit.
I found the problem - my Qt Kits were all wrong. I had reinstalled Ubuntu recently, switching from 32-bit to 64-bit, but I had preserved my home folder, and I had a stale configuration at ~/.config/QtProject/. Deleting that folder fixed my problem and now Qt Creator builds projects fine.

Compiling for 32 bit on a 64 bit DMD

I am using xubuntu 16.04 amd64, and use the D Language. I used to use DMD i386 on a 32 bit machine (ubuntu 14.04), but now, for some reason, I can't (or don't want to) install DMD_i386 on my system, so I installed the one for amd64. All of my projects were written on a 32 bit machine, and I used the int type instead of the long type that's available on 64bit. Now whenever I try to compile something that I wrote earlier, that looks something like this, gives an error;
void someFunction(){
string[] someArray;
uint ln = someArray.length;//This compiled perfectly on 32 bit, but now it says that someArray.length is ulong, and ln is uint.
}
I know that changing ln's type to ulong will fx it, but I wan't to compile this for 32 bit, and not 64 bit, and on 32 bit, the long/ulong type isn't available, since it uses 64 bits.
What I've tried:
I've tried using the -m32 switch to make DMD produce 32 bit output. The error mentioned above is fixed by this, but a linker (ld) error shows up:
/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 -lpthread
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lrt
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5/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/x86_64-linux-gnu/5/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5/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
collect2: error: ld returned 1 exit status
--- errorlevel 1
How do I get DMD to produce 32 bit output on a 64 bit DMD?
Solved the problem myself. Turns out, I was missing some packages needed by the linker. This solved the problem:
sudo apt install gcc-multilib

/usr/bin/ld: cannot find -lxxx

I'm trying to install caffe in Ubuntu 15.04, but get stuck in the make execution. Here is my command and the results. Can anybody help me out?
chauvet#chauvet:~/caffe-master$ make all -j8
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld: cannot find -lcudart
/usr/bin/ld: cannot find -lcublas
/usr/bin/ld: cannot find -lcurand
/usr/bin/ld: cannot find -lcudnn
collect2: error: ld returned 1 exit status
Makefile:563: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
It seems like cuDNN is not installed in your system.
Try commenting out the line USE_CUDNN := 1 in Makefile.config. Do a make clean and build the project again.

gfortran: compiling 32-bit executable in 64-bit system

I'm running Ubuntu 12.10 (64-bit), with Linux kernel 3.5.0-51-generic, on an AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ ×2. I have GNU Fortran (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2.
I'm trying to compile some code into a 32-bit executable. I've checked that all the needed libraries are installed on my system (I ran ldd on a program previously compiled on a 32-bit computer, and downloaded the missing packages). I tried running $ gfortran foo.f -m32 -L/lib/i386-linux-gnu, but I get the following errors:
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgfortran.so when searching for -lgfortran
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgfortran.a when searching for -lgfortran
/usr/bin/ld: cannot find -lgfortran
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libquadmath.so when searching for -lquadmath
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libquadmath.a when searching for -lquadmath
/usr/bin/ld: cannot find -lquadmath
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: returned 1 exit status
I checked the /usr/lib/gcc/i686-linux-gnu/4.7 and /usr/lib/gcc/i686-linux-gnu/4.7.2 directories, and they are both empty.
Can you please help me solve this problem? I did my research but this was as far as I could get.
Thank you in advance!
The 64-bit libraries /usr/lib/gcc/x86_64-linux-gnu/... don't apply to your 32-bit compile. You need to install the multilib compiler packages (see https://help.ubuntu.com/community/InstallingCompilers). For example:
sudo apt-get install gfortran-multilib
Now gfortran -m32 foo.f should work.

using gcc -m32 flag cannot find -lgcc and -lgcc_s

I'm trying to compile a 32 bit assembly code(NASM) on my 64 bit Linux, but I can't, I have tried others tutorials about it and I installed ia32-libs...
When I try run it as:
gcc asm1.o -o asm1
i386 of the file input `asm1.o' is incompatible with the output i386:x86-64
And when I try run it as:
gcc -m32 asm1.o -o asm1
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: connot find -lgcc_s
collect2: error: ld returned 1 exit status
Thanks for helps.
OBS: Sorry for my english, I'm not from US.
Need to install gcc-multilib.

Resources