Wednesday, 15 September 2010

c++ - How to properly configure Clang? -


I have compiled the latest representatives of LLVM, Clag and Library +. Now though I do not know how to use the environment. I've added one for compiled gametrack in $ path and set

$ D_LIBRARY_PATH = $ (LLVM-config --libdir)

but Anyway, when I try to run 'Chunk' with the example file, it uses some '/ usr / bin / ld' linker which I do not know what it is (as I like it in 'g ++' Has been uninstalled because it was thought that this problem was used by 'some linker' and I have no other C ++ is not the compiler.)

So how can I now include the correct 'llvm-ld', libc ++ and how to do the library path? I do not want to pass some complex arguments all the time. Maybe I should set some environment variables

I am also using KDEwell with the same effect.

If it looks stupid, but this is my first time with Linux for the first time I am using the latest 'OpenSUSE' distribution.

Update - CodeLight's output window is used by the Klang compiler:

/ bin / sh -c 'Make-J 2-A-F Macfile' - --------- Building project: [ClangTest - debug] ---------- Make [1]: Directory '/ Run / Media / BS_LD / 8688602a-296d-40e1-bd37-c90e69f45769 / Workstation / CL_C ++ _ WP / ClangTest 'clunk ++ -c "/ run / media / bs_ld / 8688602a-296d-40e1-bd37-c90e69f45769 / workstation / CL_C ++ _ WP / ClangTest / main .cpp" -stdlib = Libc ++ -o ./Debug/main.cpp.o-i I / run / media / bs_ld / 8688602a-296d-40e1-bd37-c90e69f45769 / build / include / c ++ / V1 / ring ++ -o /./Debug/ClangTest @ "ClangTest.txt" L. L / run / media / bs_ld / 8688602a-296d-40e1-bd37-c90e69f45769 / build / lib / usr / bin / ld: crtbegin.o can not be found: such a file or directory / usr / bin / ld : Can not get -lstdc ++ / usr / bin / ld: -lgcc_s can not be found / usr / bin / ld: not found -lgcc jig-3.7: error: exit the linker command with code 1 ClangTest.mk:76: * [Debug / ClangTest] Error 1 makeup [1]: Excluding directory '/ run / media / bs_ld / 8688602a-296d-40e1-bd37- C90e69f45769 Recipe for target 'dib / ClangTest '[1] failed to create / workstation / CL_C ++ _ WP / ClangTest' makefile: 4: 'all' the recipe for the target failed: * [All] Error 2 errors, 0 Warnings

You might have an optional with DESTDIR = / .... should be enabled to run . so that your system files do not have to be stopped.

Since you are on OpenSUs, you can use the build services of your distribution, and you can install SLVN version of LLVM-C. Long you should meet Liby + and LLMM yourself.

Otherwise, installed DESTDIR = / opt / llvm should work, and then you can add / opt to / Llvm / bin / Use libc ++ by adding PATH and this collection and link option: -stdlib = libc ++ . You will need to find anything like libc ++ in the / opt / llvm / lib code like LD_LIBRARY_PATH .

This should work a lot from the box, but I have used only the packages of my distribution, not the self-made clang to do so.

Note that the clag still uses your system linker, ld , and it's okay. At present, LLV does not yet provide fully functional options for this program, however.

Edit : It seems that you uninstalled too much: The clag also uses the GCC crtbegin and crtend object files. Then just install GCC again with glibc and its dev package.


1 comment: