gcc4.9

opencv compile with clang ok, with gcc not ok os x 10.9

夙愿已清 提交于 2021-02-17 02:06:44
问题 I am on OS X 10.9, with opencv-2.4.8.2 installed. I am trying to compile a simple code: #include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { if ( argc != 2 ) { printf("usage: DisplayImage.out <Image_Path>\n"); return -1; } Mat image; image = imread( argv[1], 1 ); if ( !image.data ) { printf("No image data \n"); return -1; } namedWindow("Display Image", WINDOW_AUTOSIZE ); imshow("Display Image", image); waitKey(0); return 0; } and can do that

opencv compile with clang ok, with gcc not ok os x 10.9

一曲冷凌霜 提交于 2021-02-17 02:06:42
问题 I am on OS X 10.9, with opencv-2.4.8.2 installed. I am trying to compile a simple code: #include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { if ( argc != 2 ) { printf("usage: DisplayImage.out <Image_Path>\n"); return -1; } Mat image; image = imread( argv[1], 1 ); if ( !image.data ) { printf("No image data \n"); return -1; } namedWindow("Display Image", WINDOW_AUTOSIZE ); imshow("Display Image", image); waitKey(0); return 0; } and can do that

“C compiler cannot create executables” in libssh2 during npm install

寵の児 提交于 2020-01-15 03:59:30
问题 I got the following error during npm install of nodegit: > nodegit@0.15.1 preinstall /home/mhu/nodegit > node lifecycleScripts/preinstall [nodegit] Running pre-install script [nodegit] npm@2 installed, pre-loading required packages [nodegit] Configuring libssh2. { [Error: Command failed: /bin/sh -c /home/mhu/nodegit/vendor/libssh2/configure --with-libssl-prefix=/home/mhu/nodegit/vendor/openssl/openssl configure: error: in `/home/mhu/nodegit/vendor/libssh2': configure: error: C compiler cannot

MinGW GCC 4.9.1 and floating-point determinism

早过忘川 提交于 2020-01-01 04:33:48
问题 I wrote a small program to compute the Euclidean norm of a 3-coordinate vector. Here it is: #include <array> #include <cmath> #include <iostream> template<typename T, std::size_t N> auto norm(const std::array<T, N>& arr) -> T { T res{}; for (auto value: arr) { res += value * value; } return std::sqrt(res); } int main() { std::array<double, 3u> arr = { 4.0, -2.0, 6.0 }; std::cout << norm(arr) - norm(arr) << '\n'; } On my computer, it prints -1.12323e-016 . I know that floating point types

How to install g++ 4.9 on Debian Wheezy armel?

不羁岁月 提交于 2020-01-01 04:30:12
问题 My Debian 7 armel embedded system currently has g++ 4.6, and I'd like to upgrade to g++ 4.9 to use new C++11 features. How do I do that? My current sources.list contents is: deb http://security.debian.org/ wheezy/updates main deb-src http://security.debian.org/ wheezy/updates main deb http://ftp.us.debian.org/debian wheezy main non-free deb-src http://ftp.us.debian.org/debian wheezy main non-free A simple apt-get install of the package does not work: root@arm:~# apt-get install g++-4.9

Why using __attribute__ (section) for some memory allocation?

試著忘記壹切 提交于 2019-12-25 04:43:20
问题 I have foo[NUMBYTES] __attribute__((section(".bar"))); Why using this attribute .bar section? Because foo[] provides already some memory space. Is this for easy memory management? 回答1: For bare metal code that run without an operating system, the section attribute , __attribute__((section(".bar"))) , is often used to: Place symbols (data or functions) in a special memory space, such as RAM, FLASH or EEPROMs built into microcontrollers. Place symbols at a special address, e.g. placing the

Why using __attribute__ (section) for some memory allocation?

那年仲夏 提交于 2019-12-25 04:43:03
问题 I have foo[NUMBYTES] __attribute__((section(".bar"))); Why using this attribute .bar section? Because foo[] provides already some memory space. Is this for easy memory management? 回答1: For bare metal code that run without an operating system, the section attribute , __attribute__((section(".bar"))) , is often used to: Place symbols (data or functions) in a special memory space, such as RAM, FLASH or EEPROMs built into microcontrollers. Place symbols at a special address, e.g. placing the

Runtime error [abi:cxx11] when compile with g++-4.9 on Ubuntu 15.10

妖精的绣舞 提交于 2019-12-24 17:29:49
问题 I recently updated Ubuntu from 15.04 to 15.10. One of the major differences between these versions is the update of the default gcc version from gcc-4.9 -> gcc-5. The library I'm developing has been written and compiled for gcc-4.9, and relies on other libraries which only work in gcc-4.9. I have installed gcc-4.9 onto my computer, and I can successfully compile both the library and my source file. However, when I tried to run the resultant program I get this error: terminate called after

Can you mix c++ compiled with different versions of the same compiler

烂漫一生 提交于 2019-12-18 10:47:25
问题 For example could I mix a set of libraries that have been compiled in say GCC-4.6 with GCC-4.9. I'm aware different compilers "breeds" such as VS cannot be with MinGW but can different generations of the same compiler? Are issues likely to occur? If so what? 回答1: Different generations of the same compiler sometimes can be compatible with each other, but not always. For example, GCC 4.7.0 changed its C/C++ ABI, meaning libraries compiled with 4.7.0+ and 4.7.0- are not likely to be compatible

What part of regex is supported by GCC 4.9?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 09:24:51
问题 I don't get this. GCC is supposed to support but accoriding to their http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.tr1 Status page "7 Regular Expressions are not supported". But then at "28 Regular expressions" - they are checked as supported http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2011 Could you please explain what is actually the standard and what is not? 回答1: GCC 4.9 does indeed support the C++11 <regex> functionality but not the tr1