问题标签 [gcc4.9]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
226 浏览

c++ - GCC -I breaks standard library compilation

Note: This question sorted itself out while I was writing it. I had trouble finding information on this problem, so I feel it would be useful to post it anyway. Advice welcome.


Hello everyone. I've recently installed GCC 4.9.1 on my Linux Mint, have been compiling some projects of mine, and everything has gone smoothly.

Now I want to get working on one such project again, beginning with some source files sorting. So I created a new folder and moved a couple .h and .tpp files inside. The structure looks like this :

main.cpp is just #include "clip/Clip.h", and will later contain some template instantiations for testing purposes. clip/Clip.h includes clip/Mask.h, which needs vect.h.

Note that the latter include is not satisfied, so the compiler rightly complains. Now, I would like all my #includes to be relative to the project's root, and not the file they are made from. Alright, I edit my Makefile :

And then... Boom ??

I've searched for a good bit, and actually found out what was going on while writing this very sentence.

0 投票
0 回答
1826 浏览

gcc - GCC 4.9.1 找不到可用的 ISL

尝试在CentOS6.5 (x86_64)上从源代码配置/build gcc 4.9.1

./config看起来像:

但它因以下原因而失败:

  • 检查 gmp/mpfr/mpc 库的正确版本...是的
  • 检查 ISL 0.10 版...否
  • 检查 ISL 0.11 版...否
  • 检查 ISL 0.12 版...否
  • 配置:错误:找不到可用的 ISL。有关详细信息,请参阅 config.log。

不确定如何声明 ISL 路径,它也在我的LD_LIBRARY_PATH中。

0 投票
1 回答
787 浏览

macos - mac osx 10.8.5、gcc4.9 AVX 支持的编译问题

我的系统是 mac osx 10.8.5。这台机器上的默认 gcc 是 4.2 (i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)) 我已经在 / 上安装了 gcc 4.9本地/本地。

我有一个使用 AVX2 内在函数的代码。已附上带有消息的代码。

现在如果我用 gcc 4.9 编译这段代码,

gcc-4.9 -O3 -march=core-avx2 a7.c,我收到以下错误消息,

我想当我使用 gcc-4.9 时需要更新汇编程序?还是看起来像其他一些问题......任何指针都会有所帮助......

0 投票
2 回答
21140 浏览

c++ - std::regex_match 和 std::regex_search 之间的区别?

下面的程序已编写为使用 C++11 std::regex_matchstd::regex_search获取“Day”信息。但是,使用第一种方法返回false,第二种方法返回true(预期)。我阅读了与此相关的文档和已经存在的 SO 问题,但我不明白这两种方法之间的区别以及我们何时应该使用它们中的任何一种?对于任何常见问题,它们可以互换使用吗?

regex_match 和 regex_search 之间的区别?

输出

为什么false在这种情况下第一个正则表达式方法返回?regex似乎是正确的,所以理想情况下两者都应该被退回true。我通过更改std::regex_match(input,match,r)to运行了上面的程序std::regex_match(input,r),发现它仍然返回false.

有人可以解释上面的例子,以及这些方法的一般用例吗?

0 投票
2 回答
238 浏览

c++ - basic_ifstream<...>::read() 不读取任何内容

从此代码构建的程序:

... 返回 1。

因此std::basic_ifstream<ZenLib::int8u>::read()无法从中提取任何字节/proc/cpuinfo

我做错什么了吗?

0 投票
1 回答
1225 浏览

macos - OpenMP 在带有 gcc 4.9 的 mac 上不可用

OpenMP 网站说:“GCC 4.9 支持 C/C++ 的 OpenMP 4.0”。

我正在使用 brew 中的 gcc 4.9.1,但是当我尝试编译 liblinear: 时看到此错误omp.h file not found

具体来说:

这是用于编译 liblinear 的 matlab 代码,其中包含一个文件,该文件包含#include <omp.h>

更新

我在 mexopts.sh 中更改了 gcc 版本(旁注:我将它从复制/Applications/MATLAB_R2013a_Student.app/bin/mexopts.sh~/.matlab/R2013a)。具体来说,我CC=xcrun -sdk macosx10.9 clang改为CC='gcc-4.9'.

我认为 Matlab 确实使用了这个编译器,因为当我运行这段代码时:

Matlab 打印:

然而,当我尝试编译 liblinear 时,我得到了与往常一样的错误消息。

0 投票
1 回答
2148 浏览

gcc - RHEL6 上的 gcc 4.9.2 构建错误

我正在尝试在 RHEL6 上构建 gcc 4.9.2,如下所示:

解压源代码压缩包(到 ~/gcc-4.9.2)

在源目录中:

创建一个单独的构建目录 ~/gcc-4.9.2-build

在构建目录中:

这失败了:


一点谷歌搜索指出我在 --disable-shared 选项,这有点帮助,但现在:

在构建目录中:

产生了一个稍微不同的错误:


添加 --enable-static 选项没有任何区别。


关于什么可能是错的任何建议?

顺便说一句,gcc 4.9.1 给出了同样的错误。


系统:Linux 2.6.32-431.29.2.el6.x86_64 #1 SMP Sun Jul 27 15:55:46 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

系统是 RHEL6,通过 Redhat 进行了全面更新,并且没有我所知道的自定义 RPM。

0 投票
1 回答
1169 浏览

c++11 - 使用 gcc 4.9.2 提升 1.57 文件系统/系统链接器错误

我正在构建一个 api 库并将其用作 unittest 项目的共享库。api正在通过以下方式进行一些调用

然后单元测试只是调用该函数,但由于链接器错误,我无法构建它

但是我的 CMakeList.txt 已正确设置

并且使 VERBOSE=1 也是正确的

在开始使用 boost::filesystem 之前我没有遇到任何问题。这在 VS2013 上工作得很好,但在使用 GCC 4.9.2 的 linux 上我似乎不知道为什么。起初我以为 boost 版本可能是错误的(ubuntu 只提供 1.55,而我在 windows 上使用的是 1.57)所以我也在 linux 上构建了 1.57,但错误仍然存​​在。还有一个与 c++11 相关的boost 错误,但它已在 1.57 中修复

我看过关于这个主题的类似问题,但人们大多忘记链接到 boost_system 而我没有。

0 投票
0 回答
346 浏览

c++ - clang中函数作用域静态__thread变量的动态初始化

我的大部分 c++ 编译都使用 gcc-4.9。最近我决定尝试使用 clang 来编译我的项目。我的项目大量使用 gcc 的 __thread 存储。

所以,我决定测试下面的代码

当用 g++4.9 编译时,代码编译得很好(这是预期的,因为 gcc 支持 __thread 的动态初始化,如果它们是函数作用域的静态。)

但是当我使用 clang++3.5 编译时,我得到了这个错误

那么这个功能是否缺少clang++3.5?

我已经尝试寻找这个问题的答案(我的搜索技巧不好),还没有找到一个令人满意的答案,所以如果我错过了或者这是一个重复的问题,请引导我找到原来的问题。

0 投票
1 回答
3630 浏览

opensuse - 在 suse 上安装 gcc g++ 4.7 从未找到“rpmlib(PayloadIsLzma)

我通过谷歌http://rpm.pbone.net/index.php3/stat/4/idpl/20369594/dir/opensuse_12.x/ ​​com/gcc47-c++-4.7.2_20130108-2.1.6.x86_64 找到了 rpm 。 rpm.html

一个个找到rpm,但一直没有找到“rpmlib(PayloadIsLzma) <= 4.4.6-1”所以我尝试用另一种方法安装GCC g++ 4.7