I am trying to build Clang on Linux (Amazon's EC2). I am running the make as per the guide at:
http://clang.llvm.org/get_started.html
I am getting the following link error messages:
llvm[2]: Linking Debug+Asserts executable opt
/home/ec2-user/benchmark/build/tools/opt/Debug+Asserts/opt.o: In function `llvm::ParseIR(llvm::MemoryBuffer*, llvm::SMDiagnostic&, llvm::LLVMContext&)':
opt.cpp:(.text._ZN4llvm7ParseIREPNS_12MemoryBufferERNS_12SMDiagnosticERNS_11LLVMContextE[llvm::Pars eIR(llvm::MemoryBuffer*, llvm::SMDiagnostic&, llvm::LLVMContext&)]+0x5f): undefined reference to `llvm::ParseBitcodeFile(llvm::MemoryBuffer*, llvm::LLVMContext&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
collect2: ld returned 1 exit status
make[2]: *** [/home/ec2-user/benchmark/build/Debug+Asserts/bin/opt] Error 1
make[2]: Leaving directory `/home/ec2-user/benchmark/build/tools/opt'
make[1]: *** [opt/.makeall] Error 2
make[1]: Leaving directory `/home/ec2-user/benchmark/build/tools'
make: *** [all] Error 1
Does anyone know what this means?
Edit: I rebuilt the entire project from svn and now I am getting the following error:
COMPILE: clang_linux/asan-i386/i386: /home/ec2-user/benchmark/llvm/projects/compiler-rt/lib/asan/asan_rtl.cc
/home/ec2-user/benchmark/llvm/projects/compiler-rt/lib/asan/asan_rtl.cc:28:10: fatal error: 'new' file not found
#include <new>
^
1 error generated.
make[5]: *** [/home/ec2-user/benchmark/build/tools/clang/runtime/compiler-rt/clang_linux/asan-i386/i386/SubDir.lib__asan/asan_rtl.o] Error 1
make[5]: Leaving directory `/home/ec2-user/benchmark/llvm/projects/compiler-rt'
make[4]: *** [BuildRuntimeLibraries] Error 2
make[4]: Leaving directory `/home/ec2-user/benchmark/build/tools/clang/runtime/compiler-rt'
make[3]: *** [compiler-rt/.makeall] Error 2
make[3]: Leaving directory `/home/ec2-user/benchmark/build/tools/clang/runtime'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/home/ec2-user/benchmark/build/tools/clang'
make[1]: *** [clang/.makeall] Error 2
make[1]: Leaving directory `/home/ec2-user/benchmark/build/tools'
make: *** [all] Error 1
I followed this and I was able to build it successfully in the first shot itself.
I guess, you are hitting issues with your C++ standard library headers. So you need to follow the Step #6 in the above mentioned link!
Start a fresh build and please ensure that you satisfy this prerequisite.
Related
I have an error message while building my C program:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [../bin/hannimpeha] Error 1
make[2]: *** [CMakeFiles/hannimpeha.dir/all] Error 2
make[1]: *** [CMakeFiles/hannimpeha.dir/rule] Error 2
make: *** [hannimpeha] Error 2
My cmake file goes like
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/cmake-build-debug)
add_executable(hannimpeha ${PROJECT_SOURCE_DIR}/bin/OLED_main.c)
How can I make C compiler find the right path?
I am getting the following error while cross compiling Poppler package on Ubuntu
After configuring I gave command make
then while making the following error has come
GlobalParams.cc:81:35: fatal error: fontconfig/fontconfig.h: No such file or directory
compilation terminated.
make[3]: * [libpoppler_la-GlobalParams.lo] Error 1
make[3]: Leaving directory /media/COMMON/WorkSpace/Packages/poppler-0.41.0/poppler'
make[2]: *** [all] Error 2
make[2]: Leaving directory/media/COMMON/WorkSpace/Packages/poppler-0.41.0/poppler'
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory `/media/COMMON/WorkSpace/Packages/poppler-0.41.0'
make: *** [all] Error 2
I even check the includes which I had given while configuring it has the fontconfig/fontconfig.h but den still the error is coming.
It looks like you should cross-compile the fontconfig library,then include the headers and libs into Popper.
Download the latest fontconfig and excute the conmmand below:
PKG_CONFIG_PATH=/opt/poppLib/lib/pkgconfig ./configureCC=arm-linux-gcc --host=arm-linux --build=i386-linux --prefix=/opt/poppLib--with-arch=arm --enable-libxml2 --disable-docs
make && make install
then add the include and lib in your Popper ,try compile it again.
I got a stellaris board to explore the power of arm. I'm using arch linux. I want to setup a toolchain based on eclipse, but if I donwload the SW-LM3S-9453.exe, unzip it, and try to make it I got the following errors:
[root#vaio stellaris]# make
make[1]: Entering directory '/home/erbal/src/stellaris/driverlib'
make[2]: Entering directory '/home/erbal/src/stellaris/driverlib'
CC adc.c
as: unrecognized option '-mcpu=cortex-m3'
../makedefs:186: recipe for target 'gcc-cm3/adc.o' failed
make[2]: *** [gcc-cm3/adc.o] Error 1
make[2]: Leaving directory '/home/erbal/src/stellaris/driverlib'
Makefile:41: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/erbal/src/stellaris/driverlib'
Makefile:46: recipe for target 'all' failed
make: *** [all] Error 2
What am I missing?
Have you verified which toolchain is being used? That error would be appropriate if you are trying to use the host toolchain rather than a toolchain built for ARM.
I am building a software package using a custom built toolchain for the Raspberry Pi.
I've run into a C standard issue. When compiling, I get an error that says SIZE_MAX is required for C99.
See here:
make[2]: Leaving directory `/home/njackson/R-2.15.3/src/unix'
make[2]: Entering directory `/home/njackson/R-2.15.3/src/unix'
make[3]: Entering directory `/home/njackson/R-2.15.3/src/unix'
making dynload.d from dynload.c
In file included from dynload.c:33:0:
../../src/include/Defn.h:209:3: error: #error SIZE_MAX is required for C99
make[3]: *** [dynload.d] Error 1
make[3]: Leaving directory `/home/njackson/R-2.15.3/src/unix'
make[2]: *** [R] Error 2
make[2]: Leaving directory `/home/njackson/R-2.15.3/src/unix'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/home/njackson/R-2.15.3/src'
make: *** [R] Error 1
I get this error message. I tried to get the right things with CYGWIN, did I do something wrong? Do you need more information?
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c'
cygwin warning:
MS-DOS style path detected: build/Debug/Cygwin_4.x-Windows/hello\.d
Preferred POSIX equivalent is: build/Debug/Cygwin_4.x-Windows/hello/.d
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/playing_with_c.exe
make[2]: Entering directory `/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c'
mkdir -p dist/Debug/Cygwin_4.x-Windows
gcc -o dist/Debug/Cygwin_4.x-Windows/playing_with_c build/Debug/Cygwin_4.x-Windows/hello\ world.o build/Debug/Cygwin_4.x-Windows/main.o
nbproject/Makefile-Debug.mk:63: recipe for target `dist/Debug/Cygwin_4.x-Windows/playing_with_c.exe' failed
make[2]: Leaving directory `/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c'
nbproject/Makefile-Debug.mk:60: recipe for target `.build-conf' failed
make[1]: Leaving directory `/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed
build/Debug/Cygwin_4.x-Windows/main.o: In function `main':
/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c/main.c:14: multiple definition of `_main'
build/Debug/Cygwin_4.x-Windows/hello world.o:/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c/hello world.c:3: first defined here
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/Cygwin_4.x-Windows/playing_with_c.exe] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 3s)
You have defined the main method in multiple places: main.c:14 and at hello world.c:3.
A program can have only 1 main method.
Either remove one of those files from the project, or remove one of the main method definitions.