clang++ - Fatal error: 'bits/c++config.h' file not found - clang

I'm using clang 2.9, compiled from source and when I try to compile a simple code like this:
#include <iostream>
int main (){
std::cout << "Hello\n";
}
I get the error:
/usr/include/c++/4.5/string:39:10: fatal error: 'bits/c++config.h' file not found
When I include /usr/include/c++/4.5/i686-linux-gnu, I get
/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 crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any ideas on how to solve this one?

Related

/usr/bin/ld: cannot find -lvtkRenderingOpenGL

Errors << apriltag_ros:make /home/ravinspect/catkin_ws/logs/apriltag_ros/build.make.001.log
/usr/bin/ld: cannot find -lvtkRenderingOpenGL
/usr/bin/ld: cannot find -lvtkImagingHybrid
/usr/bin/ld: cannot find -lvtkIOImage
/usr/bin/ld: cannot find -lvtkCommonTransforms
/usr/bin/ld: cannot find -lvtkCommonExecutionModel
/usr/bin/ld: cannot find -lvtkDICOMParser
/usr/bin/ld: cannot find -lvtkIOCore
/usr/bin/ld: cannot find -lvtkImagingColor
/usr/bin/ld: cannot find -lvtkRenderingContext2D
/usr/bin/ld: cannot find -lvtkRenderingGL2PS
/usr/bin/ld: cannot find -lvtkRenderingContextOpenGL
/usr/bin/ld: cannot find -lvtkRenderingLabel
collect2: error: ld returned 1 exit status
make[2]: ***
[/home/ravinspect/catkin_ws/devel/.private/apriltag_ros/lib/libapriltag_ros_common.so]
Error 1
make[1]: *** [CMakeFiles/apriltag_ros_common.dir/all] Error 2
I want to build a workspace with catkin build but i am taking this error while building workspace. I tried bunch of solutions but still i am taking this error.
Can anyone help me with this?
First install
sudo apt install libvtk5-dev
and then remove opencv and reinstall will solve the issue

hplip-3.20.9 - make faled with Error 1: cannot find -lImageProcessor

I am trying to manually build hplip-3.20.9 on Raspbian Buster OS.
Unfortunately the build fails due to the following error:
"
/usr/bin/ld: skipping incompatible ./prnt/hpcups//libImageProcessor.so when searching for -lImageProcessor
/usr/bin/ld: cannot find -lImageProcessor
collect2: error: ld returned 1 exit status
make: *** [Makefile:5512: hpcups] Error 1
"
More specifically:
"
libtool: link: g++ -DAPDK_LITTLE_ENDIAN -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -g -O2 -DCONFDIR="/etc/hp" -o hpcups hpcups-HPCupsFilter.o hpcups-dbuscomm.o hpcups-Compressor.o hpcups-Mode2.o hpcups-Mode3.o hpcups-Mode9.o hpcups-Mode10.o hpcups-ModeDeltaPlus.o hpcups-ModeJbig.o hpcups-ErnieFilter.o hpcups-EncapsulatorFactory.o hpcups-Encapsulator.o hpcups-Pcl3.o hpcups-Pcl3Gui.o hpcups-Pcl3Gui2.o hpcups-LJMono.o hpcups-LJColor.o hpcups-LJFastRaster.o hpcups-LJJetReady.o hpcups-LJZjStream.o hpcups-LJZxStream.o hpcups-Job.o hpcups-Pipeline.o hpcups-Processor.o hpcups-RasterSender.o hpcups-ColorMatcher.o hpcups-Halftoner.o hpcups-Scaler.o hpcups-dj400ColorMaps.o hpcups-dj600ColorMaps.o hpcups-dj970ColorMaps.o hpcups-dj8xxColorMaps.o hpcups-dj4100ColorMaps.o hpcups-BreakTables.o hpcups-Utils.o hpcups-SystemServices.o hpcups-QuickConnect.o hpcups-ModeJpeg.o jccolor.o jdatadbf.o hpcups-Lidil.o hpcups-LidilCompress.o hpcups-dj3320ColorMaps.o hpcups-dj3600ColorMaps.o hpcups-Hbpl1.o utils.o hpcups-Hbpl1_Wrapper.o hpcups-genPCLm.o hpcups-genJPEGStrips.o hpcups-RunLenEncoding.o -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz -ldbus-1 -lcrypto
/usr/bin/ld: skipping incompatible ./prnt/hpcups//libImageProcessor.so when searching for -lImageProcessor
/usr/bin/ld: cannot find -lImageProcessor
collect2: error: ld returned 1 exit status
make: *** [Makefile:5512: hpcups] Error 1
"
-What's wrong?
-Any ideas on how can i fix it?
Thanks to all!

Compile a 32-bit libfuzzer application on the 64-bit linux

Recently, I've been familiar with libfuzzer and want to give it a go. Well, as far you know for using Sanitizer it's better to compile the binary in 32bit mode because it on 64bit system requests a lot of memory.
So, when I'm trying to compile my fuzzer in 32bit mode (-m32) with clang-6.0, I get the following error :
CC="clang-6.0 -O2 -fno-omit-frame-pointer -g -fsanitize=address,fuzzer -fsanitize-coverage=trace-pc-guard,trace-cmp,trace-gep,trace-div -m32 "
...............................
/usr/bin/ld: skipping incompatible /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have libstdc++.so 32bit version then I use this command to make the compile easier:
cp /usr/lib32/libstdc++.so{.6,}
But after that the error message is changed to this :
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/llvm-6.0/lib/clang/6.0.1/lib/linux/libclang_rt.fuzzer-i386.a(FuzzerClangCounters.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/llvm-6.0/lib/clang/6.0.1/lib/linux/libclang_rt.fuzzer-i386.a(FuzzerCrossOver.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/llvm-6.0/lib/clang/6.0.1/lib/linux/libclang_rt.fuzzer-i386.a(FuzzerDriver.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/llvm-6.0/lib/clang/6.0.1/lib/linux/libclang_rt.fuzzer-i386.a(FuzzerExtFunctionsDlsym.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/llvm-6.0/lib/clang/6.0.1/lib/linux/libclang_rt.fuzzer-i386.a(FuzzerExtFunctionsDlsymWin.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/llvm-6.0/lib/clang/6.0.1/lib/linux/libclang_rt.fuzzer-i386.a(FuzzerExtFunctionsWeak.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/llvm-6.0/lib/clang/6.0.1/lib/linux/libclang_rt.fuzzer-i386.a(FuzzerExtFunctionsWeakAlias.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/llvm-6.0/lib/clang/6.0.1/lib/linux/libclang_rt.fuzzer-i386.a(FuzzerExtraCounters.o)' is incompatible with i386 output
..............
..............
..............
Do you have any idea what the root cause of the problem is and how I can solve it?

skipping incompatible xxx.a when searching for -l

When compiling my project I get the following error:
/usr/bin/ld: skipping incompatible ../../Build/qtpropertybrowser/Linux/Develop/libqtpropertybrowser.a when searching for -lqtpropertybrowser
/usr/bin/ld: cannot find -lqtpropertybrowser
/usr/bin/ld: skipping incompatible ../../Build/libqxt/Linux/Develop/libqxt.a when searching for -lqxt
/usr/bin/ld: cannot find -lqxt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I assume that if anything, the files it should be searching for should be qtpropertybrowser and qxt. Is this correct? And if so, how do I change this?
New to Linux by the way.

adding linker to command line

I am trying to compile a project and you can find the makefile at this link here https://dl.dropbox.com/u/95042389/Makefile
I have installed ANN and OpenCV 2.3.1.
When I type make, it is returning the errors given below.
sai#sai-HP-EliteBook-8460w:~/workspace/4pcs$ make
g++ -L/home/sai/workspace/OpenCV-2.4.1/lib -L/home/sai/workspace/ann_1.1.2/lib -L/usr/lib 4pcs.o 4pcs_test.o -o 4pcs -lopencv_highgui -lANN -o 4pcs
/usr/bin/ld: 4pcs.o: undefined reference to symbol 'cv::operator*(cv::Mat const&, cv::Mat const&)'
/usr/bin/ld: note: 'cv::operator*(cv::Mat const&, cv::Mat const&)' is defined in DSO /usr/lib/libopencv_core.so.2.3 so try adding it to the linker command line
/usr/lib/libopencv_core.so.2.3: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: * [4pcs] Error 1
Then I tried this
sai#sai-HP-EliteBook-8460w:~/workspace/4pcs$ echo $LD_LIBRARY_PATH
/usr/lib:/opt/ros/fuerte/lib:/opt/ros/fuerte/lib:/usr/lib/libopencv_core.2.3
Still the same errors..
Any suggestions?
It was solved by adding
-lopencv_core and then it worked with no errors.

Resources