-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot build on ubuntu12.04 using clang3.4 #14
Comments
You need to install |
I do have libc++ (which is called libstdc++ in ubuntu) |
If there is no libc++, then gcc cannot compile maloader. The fact is, i can compile with gcc/g++, but not clang. |
You should do a little research, Take a look at: http://libcxx.llvm.org/ However, why do you even export |
I have installed libc++ and it compiles well, thanks. |
how to installed libc++ ...help me !!! |
I am trying to compile maloader using clang-3.4 on Ubuntu 12.04 (precise) amd64. Previously, when I compile maloader using gcc-4.6, all went well. The clang-3.4 were installed by apt as instructed http://llvm.org/apt/. Here is my building process.
$ git clone https://github.com/shinh/maloader.git
$ cd maloader
$ export USE_LIBCXX=1
$ make
clang -g -Iinclude -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -fPIC -c -o libmac/mac.o libmac/mac.c
clang: warning: argument unused during compilation: '-stdlib=libc++'
clang -shared libmac/mac.o libmac/strmode.c -g -Iinclude -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -fPIC -o libmac.so -m64
clang: warning: argument unused during compilation: '-stdlib=libc++'
clang++ -g -Iinclude -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -W -Werror -c -o extract.o extract.cc
extract.cc:38:10: fatal error: 'map' file not found
include
1 error generated.
make: *** [extract.o] Error 1
I have installed gcc-4.8, which has the correspondent header at /usr/include/c++/4.8/profile/map.h
But when I modified the CFLAGS from
GCCFLAGS+=-g -Iinclude -Wall -MMD -fno-omit-frame-pointer -O $(GCC_EXTRA_FLAGS)
to
GCCFLAGS+=-g -Iinclude -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -Wall -MMD -fno-omit-frame-pointer -O $(GCC_EXTRA_FLAGS)
It cannot be linked:
$ make clean
rm -f .o *.d */.o /.d libmac.so extract macho2elf ld-mac
$ make
clang -g -Iinclude -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -fPIC -c -o libmac/mac.o libmac/mac.c
clang: warning: argument unused during compilation: '-stdlib=libc++'
clang -shared libmac/mac.o libmac/strmode.c -g -Iinclude -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -fPIC -o libmac.so -m64
clang: warning: argument unused during compilation: '-stdlib=libc++'
clang++ -g -Iinclude -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -W -Werror -c -o extract.o extract.cc
clang++ -g -Iinclude -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -W -Werror -c -o fat.o fat.cc
clang++ extract.o fat.o -o extract -g -I. -W -Wall -m64 -lc++ -lsupc++
/usr/bin/ld: cannot find -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [extract] Error 1
So I wander what had happened and how should I specify LDFLAGS
The text was updated successfully, but these errors were encountered: