clang

Compiling with LLVM/Clang causes crash, not GCC 4.2

筅森魡賤 提交于 2019-12-25 04:53:28
问题 I'm working on an iPhone app, and I'm having some compiler trouble. Here's the low-down: I am compiling using Xcode 3.2.3, targeting iOS 4.0: my device is a 2nd Gen. iPod touch running iOS 4.0. Compiling with GCC 4.2: works on both the simulator and the device Compiling with LLVM compiler 1.5: works on simulator, but not on device. Compiling with LLVM GCC 4.2: same problem as with LLVM compiler 1.5. When it fails, the app never even finishes loading. This is what the log looks like: run

Error enabling openmp - “ld: library not found for -lgomp” and Clang errors

笑着哭i 提交于 2019-12-25 04:47:14
问题 I'm trying to get openmp to run in my program on Mavericks, however when I try to compile using the flag -fopenmp I get the following error: ld: library not found for -lgomp clang: error: linker command failed with exit code 1 (use -v to see invocation) The command I am running is: gcc myProgram.cpp -fopenmp -o myProgram Also, when I run gcc I get Clang warnings which I find to be very strange. And looking into /usr/bin/gcc it does not appear to link to Clang. Any suggestions on how to fix my

clang - linking a static library with a pch file causes error with __STATIC__ disabled

狂风中的少年 提交于 2019-12-25 04:15:59
问题 Am currently trying to link a bunch of Objective C modules into a static library. I am getting the following error and am unable to locate any information on how the __STATIC__ can not be disabled when building a PCH file. error: __STATIC__ predefined macro (as opposed to __DYNAMIC__) was disabled in PCH file but is currently enabled The command to build the PCH file is: clang -cc1 -target-cpu x86-64 -g -fno-validate-pch -emit-pch -x objective-c-header afile.pch -o afile.pch.bin -O0 -fmath

C++ Resolving conflicts with legacy unnamed namespaces

房东的猫 提交于 2019-12-25 03:17:15
问题 I have a large body of legacy code which declares a number of important types. For example: typedef uint32 EventId; I'm currently integrating an excellent new version of 3rd party code (Scaleform) which has namespaces, but has conflicting definitions: namespace Scaleform { namespace GFx { class EventId ... }} There is code where both definitions are encountered, and I of course get errors: error: reference to 'EventId' is ambiguous note: candidate found by name lookup is 'EventId' note:

clang API for parsing C++ code

旧街凉风 提交于 2019-12-25 02:25:39
问题 I need clang API to do parsing of C++ programs. I installed clang 2.9 (along with llvm. The installation went fine, now i figured out that i need to install libc++ also. The thing is I get errors following while i try to 'make' libc++ from source. [ 4%] Building CXX object lib/CMakeFiles/cxx.dir/__/src/iostream.cpp.o In file included from /home/vmplanet/usr/libcxx/include/typeinfo:61:0, from /home/vmplanet/usr/libcxx/include/memory:590, from /home/vmplanet/usr/libcxx/include/algorithm:594,

Incomplete types with Clang compiling c++11 code

南楼画角 提交于 2019-12-25 02:24:48
问题 As this website shows, following code will not be supported in Clang using C++11: class Node { vertex<Node> children; }; An error will occur: field has incomplete type 'Node' But such code is supported in C++98 and other compilers such as gcc in C++11. I know I can use vertex<Node*> instead, but at present I have some incompatibility issue with old code in C++98. My question is, (1) can I compile such code using Clang in C++11? (2) I think a tree structure does inevitably need definition like

Clang errors when trying to archive an iOS app in Xcode 10.1

烂漫一生 提交于 2019-12-25 01:43:13
问题 I've installed an iOS app on my iPhone using Xcode 10.1 and when hitting Product -> Archive , the following two errors come up: Several times cleaned the project in Xcode and neither New nor Legacy Build System has an impact on the result. How to solve these errors, please? 来源: https://stackoverflow.com/questions/55198638/clang-errors-when-trying-to-archive-an-ios-app-in-xcode-10-1

Error inclunding <libavformat/avformat.h> in FFMPEG project on a Mac using clang

跟風遠走 提交于 2019-12-24 21:42:35
问题 I'm having trouble running the remuxing.c example code. I get the following error. I have confirmed that the files can be found in /usr/local/include . I am running macOS Sierra 10.12.6. $ cc -v playground/remuxing.c Apple LLVM version 9.0.0 (clang-900.0.39.2) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.12.0 -Wdeprecat ed-objc-isa-usage

SFINAE not working on llvm/clang

此生再无相见时 提交于 2019-12-24 20:34:21
问题 In the following code I'm trying to call a functor with whatever it takes as its parameters, "whatever" being a limited set of options (the two here are not the only ones in my code). #include <memory> #include <iostream> template<class T> struct call_with_pointer { // last resort: T* template<class Callable> static auto call(Callable &callable, const std::shared_ptr<T> &param) -> decltype(callable(param.get())) { return callable(param.get()); } }; template<class T> struct call_with_shared :

case of template member function specialization that compiles on msvc, not others

谁都会走 提交于 2019-12-24 16:22:24
问题 [ EDIT ] I changed the title from works to compiles since it turns out that it doesn't truly work after all (thanks @bogdan for the comments). I added code at the end of the post showing why and how. The second part of the question still stands - is there a way to " fix " it? The crux of the matter is having a virtual function Observe in a base template<int N> class X be rerouted to a templated function Observe<N> in classes derived from X<N> , without requiring any supporting code in X . For