clang “hello, world!” link errors in windows

前端 未结 5 2136
借酒劲吻你
借酒劲吻你 2021-02-14 03:40

I just downloaded the CLang sources, made a Visual C++ 10 IDE workspace by using CMake, and built everything from Visual C++ 10.0 (express).

Now I get a bunch of linker

5条回答
  •  甜味超标
    2021-02-14 04:17

    Unlike MinGW gcc, clang does not include the glibc library, so by default, it has no standard library or whatsoever. I don't know how to use the Visual C++ standard libary with it, but its pretty clear from what you post, that by default it produces symbols like gcc, so you need to use it with glibc or newlib...

    And either you specify the the libary path with -Ldirectory to the .lib files (or .a for glibc), or put them into one of default clang search pathes (run: clang -v -x c++ -fsyntax-only some file to see them.)

提交回复
热议问题