llvm-clang

Clang C++ Cross Compiler - Generating Windows Executable from Mac OS X

自古美人都是妖i 提交于 2019-11-27 11:55:42
I have created a C++ application using Xcode on my Mac using the Clang compiler. I want to compile my source files to create an executable that can be ran on a windows machine however I cant get Clang to generate me an executable. Here is what I've tried: clang++ -std=c++11 -stdlib=libc++ -arch x86_64 class1.cpp class2.cpp... -o executable.exe This creates an executable however this does not run (Windows gives me an error to do with the application being 16 bit -dont understand this- that cant run on 64 bit) clang++ -std=c++11 -stdlib=libc++ -target i386-pc-win32 class1.cpp class2.cpp For some

Is OpenMP available in High Sierra LLVM?

亡梦爱人 提交于 2019-11-27 08:28:50
In the default LLVM provided by Apple in macOS 10.13, High Sierra, is OpenMP finally available? It has been available in main LLVM for more than a year now. (another way to ask the question might be what version of LLVM is the new Apple LLVM based on) Standard Apple's clang supports OpenMP. They just disabled the driver option. But you can use the frontend option instead this way: clang -Xclang -fopenmp <you_program> -I <path to omp.h> -L <path to libomp.dylib> -lomp Also, you need to set DYLD_LIBRARY_PATH environmental variable: export DYLD_LIBRARY_PATH=<path to libomp.dylib> How to get/build

Objective-C naming conventions with ARC and possible caveats

隐身守侯 提交于 2019-11-27 06:11:35
问题 I have experience with pure ARC coding. As a compiler feature it honors Objctive-C method family putting right retain/release calls whenever neeeded. All methods that start with alloc , mutableCopy , copy and new create a new object. They increase the retain count. As a consequence, ARC will release any pointer (and hence the object associated with it) when I no longer need it. I think that problems could arise when I write methods that do not follow naming conventions. For example, if I

Integrate LLVM Clang 4.x.x / 5.x.x / 6.x.x into Visual Studio 2017

两盒软妹~` 提交于 2019-11-27 05:23:20
问题 The official LLVM 4.0 build for Windows integrates with Visual Studio up to Visual Studio 2015. Unfortunately it still doesn't support Visual Studio 2017. When you try to set the Platform Toolset of a project to LLVM-vs2014 , it pops up an error. Do you know any way to make it work? Update In 2018, LLVM 6.0 officially still doesn't support integration with Visual Studio 2017 (version 15.X.X), only with the Visual Studio 2015 (version 14.X.X) toolset. 回答1: It requires some msbuild targets that

Get Apple clang version and corresponding upstream LLVM version

只谈情不闲聊 提交于 2019-11-27 01:43:41
问题 I want to understand which version of clang Apple installed in my macbook, to see with c++11 and/or c++14 features are available. I typed this command: clang --version //----response Apple LLVM version 7.0.0 (clang-700.1.76) Target: x86_64-apple-darwin15.0.0 Thread model: posix But I am not able to understand what (clang-700.1.76) mean. How can I convert this code to a clang version? This is the site where you could check c++ features available in clang version http://clang.llvm.org/cxx

Clang C++ Cross Compiler - Generating Windows Executable from Mac OS X

自作多情 提交于 2019-11-26 15:44:13
问题 I have created a C++ application using Xcode on my Mac using the Clang compiler. I want to compile my source files to create an executable that can be ran on a windows machine however I cant get Clang to generate me an executable. Here is what I've tried: clang++ -std=c++11 -stdlib=libc++ -arch x86_64 class1.cpp class2.cpp... -o executable.exe This creates an executable however this does not run (Windows gives me an error to do with the application being 16 bit -dont understand this- that

Is OpenMP available in High Sierra LLVM?

这一生的挚爱 提交于 2019-11-26 14:09:17
问题 In the default LLVM provided by Apple in macOS 10.13, High Sierra, is OpenMP finally available? It has been available in main LLVM for more than a year now. (another way to ask the question might be what version of LLVM is the new Apple LLVM based on) 回答1: Standard Apple's clang supports OpenMP. They just disabled the driver option. But you can use the frontend option instead this way: clang -Xclang -fopenmp <you_program> -I <path to omp.h> -L <path to libomp.dylib> -lomp Also, you need to

clang: no out-of-line virtual method definitions (pure abstract C++ class)

孤街浪徒 提交于 2019-11-26 10:35:39
问题 I\'m trying to compile the following simple C++ code using Clang-3.5: test.h: class A { public: A(); virtual ~A() = 0; }; test.cc: #include \"test.h\" A::A() {;} A::~A() {;} The command that I use for compiling this (Linux, uname -r: 3.16.0-4-amd64): $clang-3.5 -Weverything -std=c++11 -c test.cc And the error that I get: ./test.h:1:7: warning: \'A\' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Wweak-vtables] Any hints why this is