gcc4.9

How do I do I run gcc-49 with just 'gcc' on OSX?

邮差的信 提交于 2019-12-14 03:16:15
问题 I recently installed gcc 4.9, with a previous version of gcc that was installed by default before. When I type gcc, the previous version of gcc runs. How could I make my newly installed gcc 4.9 run when I type gcc? 回答1: You should do this: cd /usr/bin mv gcc gcc-old ln -s gcc-4.9 gcc Or you should have a look to gcc_select 来源: https://stackoverflow.com/questions/23280834/how-do-i-do-i-run-gcc-49-with-just-gcc-on-osx

Clang++ --gcc-toolchain and gcc 4.9.3 linking issues

随声附和 提交于 2019-12-12 10:57:18
问题 (Ubuntu 16.04.1) By default on 16.04.1 clang is picking the gcc tool chain for 5.4. Unfortunately I have a library that requires pre-5.0 ABI and I do NOT have access to the source, nor has the implementer released a new version. I've been trying to use the --gcc-toolchain option, but I can NOT get it to work. (ctrbegin.o and crtend.o don't get the proper prefix at link.) $ clang++-3.8 -v -print-search-dirs clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) Target: x86_64-pc-linux-gnu

Static linking with dylib ld: library not found for -lcrt0.o collect2: error: ld returned 1 exit status

一笑奈何 提交于 2019-12-12 02:39:35
问题 I'm compiling a qt5 c++ project with gnu49 compile while linking with few other dylibs (armadillo,boost libs etc.) on Mac OSX El Captitan with c++11 flag and usual qt framework flags. The project compiles fine but to make it more portable on few other machines I'm trying to statically link few dynamic libraries. I added -static flag before the (to be statically linked) library (e.g -static -lboost_thread ) as described here. https://gcc.gnu.org/ml/gcc/2000-05/msg00517.html However, I get the

Glibc - error in ucontext.h, but only with -std=c11

自古美人都是妖i 提交于 2019-12-11 11:33:41
问题 I have this minimal helloworld, extended with an include of ucontext.h : #include <ucontext.h> #include <stdio.h> int main(int argc, char** argv) { printf ("hello world!\n"); return 0; } It compiles without warning with gcc-4.9 ( gcc -c hw.c -Wall ). But if I switch to the c11 standard ( gcc -std=c11 -c hw.c -Wall ), I get the following error: $ gcc -std=c11 -c hw.c -Wall In file included from /usr/include/ucontext.h:26:0, from hw.c:1: /usr/include/x86_64-linux-gnu/sys/ucontext.h:137:5: error

OpenCV: Why SIFT and SURF detectors crashes?

青春壹個敷衍的年華 提交于 2019-12-11 02:43:00
问题 Why do the SIFT and SURF detectors crash? using namespace std; using namespace cv; int main(int argc, char *argv[]) { Mat image = imread("TestImage.jpg"); // Create smart pointer for SIFT feature detector. Ptr<FeatureDetector> featureDetector = FeatureDetector::create("SIFT"); vector<KeyPoint> keypoints; // Detect the keypoints featureDetector->detect(image, keypoints); // here crash // ... } The error is Segmentation fault (core dumped) . I use OpenCV 2.4.8, gcc 4.9 and Ubuntu. If I use the

Adding gcc 4.9 as a compiler option in Xcode

醉酒当歌 提交于 2019-12-10 21:28:31
问题 I just installed gcc 4.9 (with C11 support), and want to add it to Xcode 4.6.3's build options as a compiler option. I ran make and make install , and the packages are all there (under /usr/bin/gcc . Running gcc --version confirms that gcc 4.9 is installed rather than an older version. When I go into an existing Xcode project's build settings, the only compiler options available are Apple LLVM compiler 4.2 LLVM GCC 4.2 Other... Clearly, GCC 4.9 would have to be added using the "Other..."

“Assume” clause in gcc

霸气de小男生 提交于 2019-12-06 19:33:16
问题 Does gcc (latest versions: 4.8, 4.9) have an "assume" clause similar to __assume() built-in supported by icc? E.g., __assume( n % 8 == 0 ); 回答1: In your example you want to inform the compiler that N is a multiple of 8. You can do this simply by inserting the line N = N & 0xFFFFFFF8; in your code (if N is a 32-bit integer). This doesn't change N , because N is a multiple of 8, but since GCC 4.9 the compiler seems to understand that N is a multiple of 8, after this line. This is shown by the

Determine cause of segfault when using -O3?

我只是一个虾纸丫 提交于 2019-12-06 02:51:21
问题 I'm having trouble determining the cause of a segfault when a program is compiled with -O3 with GCC 4.8/4.9/5.1. For GCC 4.9.x, I've seen it on Cygwin, Debian 8 (x64) and Fedora 21 (x64). Others have experienced it on GCC 4.8 and 5.1. The program is fine under -O2 , fine with other versions of GCC, and fine under other compilers (like MSVC, ICC and Clang). Below is the crash under GDB, but nothing is jumping out at me. The source code from misc.cpp:26 is below, but its a simple XOR: ((word64*

Unpacking parameter packs in template aliases

本小妞迷上赌 提交于 2019-12-05 13:15:43
问题 I run into a problem with unpacking variadic templates into a template alias. The following code works with Clang 3.4 and GCC 4.8 but fails with GCC 4.9: template <typename T, typename...> using front_type = T; template <typename... Ts> struct foo { using front = front_type<Ts...>; }; GCC 4.9 complains: test.cc:7:37: error: pack expansion argument for non-pack parameter 'T' of alias template 'template<class T, class ...> using front_type = T' using front = front_type<Ts...>; ^ test.cc:1:15:

“Assume” clause in gcc

眉间皱痕 提交于 2019-12-05 01:40:03
Does gcc (latest versions: 4.8, 4.9) have an "assume" clause similar to __assume() built-in supported by icc? E.g., __assume( n % 8 == 0 ); In your example you want to inform the compiler that N is a multiple of 8. You can do this simply by inserting the line N = N & 0xFFFFFFF8; in your code (if N is a 32-bit integer). This doesn't change N , because N is a multiple of 8, but since GCC 4.9 the compiler seems to understand that N is a multiple of 8, after this line. This is shown by the next example, in which two float vectors are added: int add_a(float * restrict a, float * restrict b, int N)