问题标签 [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.
gcc - 如何编译和运行 GCC 4.9.x?
我正在运行 debian wheezy,想从 GCC 4.7.2 升级到 GCC 4.9.0。
根据这些说明,我安装了libgmp-dev
,libmpfr-dev
并且libmpc-dev
(我的包管理器分别给了我版本 2:5.0.5+dfsg-2、3.1.0-5 和 0.9-4)并运行以下命令来编译 gcc(请注意,在我的情况下它是 4.9.0 而不是 4.6.2):
我现在有一个objdir
充满东西的目录,但是 g++ 在哪里,我应该把这个目录放在哪里?
我猜我应该把它移到usr/local
我的变量中并添加一些东西PATH
,但我不知道究竟是什么,以及如何确保在我的旧 gcc 安装之前搜索它。
gcc - Why does gcc4.9 not display warning message -std=c++1y while using C++14 feature?
I installed gcc4.9 using the steps mentioned in the SO post here. I was using the latest feature std::exchange() utility function which is introduced in C++14.
I performed following steps to compile the above sample program and got the following compilation error. After sometime I realized that (as there is no warning/hint by compiler message) this feature has been added in the C++14 standard so I need to use -std=c++1y
here.
If we use the C++11 standard feature and does not provide -std=c++11
, then GCC gives warning message/hint that your program is using the feature which is introduced in the C++11 as below:
This message is great and lets the user distinguish between the actual compilation error message and not including -std=c++11
option.
However while using gcc4.9 for C++1y feature under -std=c++11
, there is no such warning message/hint? I wanted to know what could be the possible reason for this?.
c++ - 错误:使用 boost::serialisation 与 'operator<<' 不匹配
我正在尝试让一些(迄今为止)Windows 代码在 unix 机器上编译,但在以下方法中遇到了一些错误:
错误如下所示:
test.cpp:在成员函数'void EDIN::World::Save(const char*)'中:test.cpp:122:12:错误:'operator<<'不匹配(操作数类型是'boost::archive ::text_oarchive' 和 'EDIN::World*') oa << this << cellSequence << report; // 第 590 行:错误!^ test.cpp:122:12:注意:候选人是:在 /home/armanschwarz/lib/boost_1_55_0/boost/archive/detail/common_oarchive.hpp:22:0 包含的文件中,来自 /home/armanschwarz/lib/boost_1_55_0 /boost/archive/basic_text_oarchive.hpp:32,来自 /home/armanschwarz/lib/boost_1_55_0/boost/archive/text_oarchive.hpp:31,来自 test.cpp:1:/home/armanschwarz/lib/boost_1_55_0/boost/archive /detail/interface_oarchive.hpp:62:15: 注意:存档& boost::archive::detail::interface_oarchive::operator<<(T& ) [与 T = EDIN::World*; Archive = boost::archive::text_oarchive] Archive & operator<<(T & t){ ^ /home/armanschwarz/lib/boost_1_55_0/boost/archive/detail/interface_oarchive.hpp:62:15:注意:没有已知的转换对于从 'EDIN::World*' 到 'EDIN::World*&' 的参数 1</p>
我正在使用 boost 1.55.0(与我在 Visual Studio 上编译时相同)。谁能发现我在这里做错了什么?
这是一个来自 sehe 的独立示例:
它在这里使用 GCC 4.8.1 和 Boost 1.55.0 编译得很好。我正在使用 GCC 4.9.0 并提升 1.55.0。
编辑:我发现了一个似乎有效的黑客:
问题似乎是 G++ 4.9 不想World::this
从World*
to 转换为World*&
. 用以下方法替换该World::Save
方法可以解决问题:
GCC 4.8.1 和 GCC 4.9 之间的行为似乎存在差异,导致后者无法编译,除非我创建this
指针的副本。如果有人能指出为什么会发生这种情况,以及这是否是一个错误或预期的行为改变,那将不胜感激!
c++ - GCC-4.9 无法在 OS X 10.9.2 中使用 Rbenv 制作 Ruby 2.1.1
我在这里超出了我的深度,因为我不了解 Jack 关于 C 和此类编译器,除了根据 tut's 我读过 - 我已经自制安装了 gcc-4.9,链接它,并且在我的 .bash_profile 中有 cc =gcc-4.9 - 希望这能让我安装 Ruby 2.1.1,因为之前的尝试都失败了,抱怨以下内容:
我访问了 gcc 站点,发现 4.9 包含 c++11 支持,所以我很困惑为什么它无法按照上述错误生成 Ruby,以及下面的完整错误输出:
正如我所写的那样,我在这里真的超出了我的深度,所以如果能帮助解决这个问题,我将不胜感激,这样我就可以安装 Ruby 2.1.1。
我使用的 ./configure 命令是:
我通过自制软件安装了 Rbenv,所以它的 bin 不在 ~./rbenv 中,而是在我的 PATH 和自制软件链接的 sym 中:
我看不到任何对此的抱怨,这让我觉得我可能使用了错误的 C 编译器,但我没有看到其他人有同样的错误,他们对自制的 gcc-4.9 或 apple-gcc42 很满意,但老实说 - 我不知道如何确定使用哪个。
任何帮助表示赞赏,因为我在这方面浪费了太长时间,而不是实际开发 Web 应用程序。
谢谢
regex - GCC 4.9 支持正则表达式的哪一部分?
我不明白这个。GCC 应该支持但根据他们的 http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.tr1
状态页面“不支持 7 个正则表达式”。
但随后在“28 正则表达式” - 它们被检查为受支持
http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2011
您能否解释一下什么是实际标准,什么不是?
c++ - 未找到版本“CXXABI_1.3.8”(...要求)
当我在编译后运行我的程序时,我收到以下错误:
./prog: /usr/lib/x86_64-linux-gnu/libstdc++.so.6:
CXXABI_1.3.8' not found (required by ./prog) ./prog: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
找不到版本 GLIBCXX_3.4.19'(./prog 需要)./prog: /usr/lib/x86_64-linux-gnu/ libstdc++.so.6:未找到版本“GLIBCXX_3.4.20”(/home/arman/lib/boost_1_55_0/stage/lib/libboost_serialization.so.1.55.0 需要)
我分别安装了 boost 1.55.0 和 gcc 4.9.0 ~/lib/boost_1_55_0
,~/lib/gcc-4.9.0
我猜这就是我遇到问题的原因,但我不确定如何修复它。
my~/.profile
包含以下行:
导出 LD_LIBRARY_PATH=/home/user/lib/boost_1_55_0/stage/lib:$LD_LIBRARY_PATH
macos - opencv 用 clang 编译 ok,用 gcc 不 ok os x 10.9
我在 OS X 10.9 上,安装了 opencv-2.4.8.2。我正在尝试编译一个简单的代码:
并且可以使用 clang (/usr/bin/g++ -arch x86_64 pkg-config opencv --libs
test.cpp) 做到这一点,但不能使用 gcc 4.9 (/usr/local/bin/g++ -arch x86_64 pkg-config opencv --libs
test.cpp)。
这就是我使用 gcc 4.9 得到的:
谁能帮我弄清楚为什么?
关于我的编译器的信息:
$ /usr/bin/gcc -v 配置:--prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM 5.1 版(clang-503.0.40)(基于 LLVM 3.4svn)目标:x86_64-apple-darwin13.1.0 线程模型:posix
$ /usr/local/bin/gcc -v 使用内置规范。COLLECT_GCC=/usr/local/bin/gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin13.0.0/4.9.0/lto-wrapper 目标:x86_64-apple-darwin13.0.0 配置:.. /gcc-4.9-20131215/configure --enable-languages=c++,fortran 线程模型:posix gcc version 4.9.0 20131215 (experimental) (GCC)
gcc - 为什么 for 循环比预期多出 1 条指令?
我写了很多向量化循环,所以 1 个常见的成语是
但是生成的机器代码比我想要的多1条指令(使用gcc 4.9)
如果我将代码更改为for (int64_t i = 0; i <= argc - 16; i+= 16)
,那么“额外”指令就消失了:
但为什么会有差异?我在想可能是由于循环不变量,但太模糊了。然后我注意到在 5 指令情况下,增量是在加载之前完成的,由于 x86 的破坏性 2 操作数指令,这将需要额外的 mov。所以另一种解释可能是它是针对 1 条额外指令的交易指令并行性。
虽然看起来几乎没有任何性能差异,但有人可以解释这个谜团(最好谁知道编译器转换)?
理想情况下,我想保留 i + 16 <= size 形式,因为它具有更直观的含义(向量的最后一个元素不会超出范围)
c++ - OpenCV:为什么 SIFT 和 SURF 检测器会崩溃?
为什么 SIFT 和 SURF 检测器会崩溃?
错误是Segmentation fault (core dumped)
。我使用 OpenCV 2.4.8、gcc 4.9 和 Ubuntu。如果我使用其他类型的功能,它会正常运行。我错过了什么?
osx-mavericks - 链接 poco 时,出现正则表达式错误
我尝试以多种方式构建 poco (poco-1.4.6p4),似乎都构建得很好。但是,当链接它时,我尝试构建 poco 的所有不同方式都会在下面给出错误。无论我选择什么,似乎 poco 都是用 clang++ 构建的。
奇怪的是,在我从山狮升级到小牛之前,这一切都没有发生。
和
和
以上所有似乎都很好。
但是当我链接到它们中的任何一个时,它们在链接时都会给出以下错误。