libc++

Macports on OSX 10.9 - compile opencv with libstdc++

我是研究僧i 提交于 2019-12-08 12:46:37
问题 My situation is very similar to what's discussed in this thread. The reason I want to do this is that I am using OpenCV with CUDA 6.0, but CUDA is currently linked against libstdc++. I followed the answer that suggested putting the flag -stdlib=libstdc++ as well as the other approach where we set CXX and CXXFLAGS but as it was being commented: Macports did not seem to acknowledge the flags and still built with libc++ instead of intended libstdc++. I would like to comment on that thread to ask

Taking pointer to member std::string::size fails to link with libc++ but works with libstdc++

烈酒焚心 提交于 2019-12-07 17:20:43
问题 I'm on a project where I need to use libc++. I'm come up with the following problem: When I try to compile the following code: #include <string> int main() { std::string::size_type (std::string::*function)() const = &std::string::size; return 0; } I get the following error: ld: symbol(s) not found for architecture x86_64 If I use the libstdc++ instead of libc++ I get no errors so the issue should to be related with libc++. Full output below: clang++ --stdlib=libc++ -v main.cpp Apple LLVM

std::cerr on linux with clang++ and libc++ causes SIGABRT

怎甘沉沦 提交于 2019-12-07 16:18:23
问题 I'm trying to get a simple program running on Ubuntu 12.04 x64 compiled with clang++ 3.3 libc++ libc++abi . Program: #include <iostream> int main(int argc, char **argv) { try { std::cerr << "Test cerr \n"; } catch (...) { std::cout << "catch exception"; } return 0; } Writing to std::cerr prints the message, but results in SIGABRT. However, writing to std::cout works fine. Here the ldd output of the executable: $ldd cerr_test linux-vdso.so.1 => (0x00007fffce5ff000) libc++abi.so.1 => /usr/local

How I do compile a application against a static library compiled with libc++ in xcode/clang/macos?

不想你离开。 提交于 2019-12-07 11:19:48
问题 When I try to compile a test console application to test some functionality on a static library on the same workspace, i run into problems in the linking stage of the binary, it only happen when I choose to use libc++ standard library. The missing symbols error is the follow : Undefined symbols for architecture x86_64: "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::empty() const", referenced from: libtorrent::torrent::replace_trackers(std::__1::vector

Link OSX Homebrew Gfortran against libc++

穿精又带淫゛_ 提交于 2019-12-07 05:59:48
问题 I have a project with a large C++ component that I was able to successfully compile with clang on OSX (Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn). Since OSX does not provide a Fortran compiler I installed gfortran via Homebrew. Compilation works fine, however I can not link the compiled Fortran code against the C++ code compiled earlier: I get the following error: $ make fortran Undefined symbols for architecture x86_64: "std::__1::basic_string<char, std::__1::char

C++11 standard libraries in libstdc++ on Mac

北战南征 提交于 2019-12-06 14:59:24
In a Xcode project which I currently work on, I am using C++11 with Apple LLVM 4.2 (clang) compiler, and using libstdc++ as my standard library, because I am using a library (NTL) which was not compiled with libc++ and so I must use libstdc++. When writing the following code: #include <regex> int main() { return 0; } It doesn't compile, by saying: 'regex' file not found And so I can't use any C++11 library with my libstdc++ (Tried <mutex> , <thread> aswell). Another I tried to take is to recompile NTL with cc and libc++, but that doesn't seem much to work. The following is some of the errors

Making a SFML2 Applcation with Clang, libc++ and c++11. Undefined Reference to SFML Library

╄→гoц情女王★ 提交于 2019-12-06 13:20:30
I'm having a weird problem with making an SFML2 application. I'm using Clang++ from the Repositories as well as libc++ (both updated today). SFML2 was also updated from the SVN repo. I'm using the latest version of Kubuntu. I also had the same problem when I last tried about a month ago with the then up-to-date repositories. The parameters I'm passing through to the compiler for c++11 and stdlib are: -std=c++11 -stdlib=libc++ Here's the full version of what I'm calling: clang++ -std=c++11 -stdlib=libc++ main2.cpp -o main -L/home/jonathan/OpenSource/sfml/SFML-Build/lib/ -I/home/jonathan

How to build OpenCV for Android using libc++ STL library?

断了今生、忘了曾经 提交于 2019-12-06 07:17:36
I would like to build a OpenCV from source using a libc++ STL library, instead of default GNU STL. LibC++ offers better C++11 and C++14 support. Is it possible to do that? I've tested this with OpenCV 2.4.7 and Android NDK r10d. First, you need to download OpenCV source . Unpack the source and replace the platforms/android/android.toolchain.cmake with version that suppports libc++ . Now, open modules/core/include/opencv2/core/operations.hpp and change line 69 from (defined __GNUC__ && defined _STLPORT_MAJOR) to (defined __GNUC__ && (defined _STLPORT_MAJOR || defined _LIBCPP_VERSION)) Next, in

LLVM 与 Clang 及其关系

拥有回忆 提交于 2019-12-05 22:53:55
随着 Android P 的逐步应用,越来越多的客户要求编译库时用 libc++ 来代替 libstdc++。libc++ 和 libstdc++ 这两个库有关系呢?它们两个都是 C++ 标准库,libc++ 是针对 Clang 编译器特别重写的 C++ 标准库,而 libstdc++ 则是 GCC 的对应 C++ 标准库了。从 Android 市场来说,Android NDK 已在具体应用中放弃了 GCC,全面转向 Clang,正如很早前 Android NDK 在 Changelog 中提到的那样: Everyone should be switching to Clang. GCC in the NDK is now deprecated. Android NDK 从 r11 开始建议大家切换到 Clang,并且把 GCC 标记为 deprecated,将 GCC 版本锁定在 GCC 4.9 不再更新; Android NDK 从 r13 起,默认使用 Clang 进行编译,但是暂时也没有把 GCC 删掉,Google 会一直等到 libc++ 足够稳定后再删掉 GCC; Android NDK 在 r17 中宣称不再支持 GCC 并在后续的 r18 中删掉 GCC,具体可见 NDK 的 版本历史 。 接下来,简要的介绍一下 Clang。Clang 是一个 C、C++

Undefined reference with clang++ with O2

血红的双手。 提交于 2019-12-05 20:50:12
问题 I'm trying CLang 3.4 and libc++ on a project and I get strange linking errors in release mode: /home/wichtounet/dev/eddic/src/ast/Operator.cpp:17: error: undefined reference to 'std::__1::basic_ostream<char, std::__1::char_traits<char>>& std::__1::operator<< <char, std::__1::char_traits<char>, std::__1::allocator<char>>( std::__1::basic_ostream<char, std::__1::char_traits<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const& )' clang: error: