问题标签 [gcc4.8]

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 回答
75 浏览

c++11 - 继承构造函数应该如何表现?

这个简单的代码会产生一些意想不到的结果。至少对我来说...

我希望输出是: cls1() 作为 cls2 的默认构造函数被删除,但是代码没有输出任何内容,尽管它编译并运行良好。我正在使用 GCC 版本。4.8.2. 编译:

问题是:它应该如何表现?

谢谢!

0 投票
0 回答
1029 浏览

macos - 在 Mac 10.6.8 上使用 brew 安装 gcc4.8

因此,我尝试在运行 10.6.8 的 Mac 上通过自制软件安装 gcc4.8。

我尝试遵循本指南 https://apple.stackexchange.com/questions/38222/how-do-i-install-gcc-via-homebrew 但我似乎无法让它工作。

首先我跑了

它下载文件,但它确实

我得到

如果有人有任何想法,我将非常感谢一些帮助:)

0 投票
1 回答
921 浏览

gcc4.8 - 使用 Xcode 5.1 安装 GCC 4.8

昨天我已经为 Xcode 安装了更新 5.1,并且在使用此处的方法(适用于 X5.0)重新安装 gcc 4.8 后不再工作。

你有什么解决办法吗?

0 投票
1 回答
117 浏览

c - 这是 GCC/链接器错误吗?(共享库中名为“错误”的变量)

我可能在 GCC 或链接器中遇到了一个错误,当在运行时加载的共享库中有一个名为“错误”的全局变量时,就会发生这种错误。乍一看,在名为“error”的文本段中似乎有其他东西隐藏了这个变量。

富.c:

主.c:

编译和运行输出:

这是一个工具链错误吗?如果是这样,什么可能导致这种情况以及应该在哪里报告?

0 投票
2 回答
217 浏览

c++ - extern C unresolved symbol with gcc 4.8?

I have the following piece of code, that works with gcc 4.3 compiler, but when I compiled with gcc 4.8, got resolved symbol error ( linking time)

// test.h

in the same test.h file itself, I have defined the getCPULimit() function inline

The above code worked with 4.3 compiler, with 4.8 got unresolved symbol error.

moving extern ULONG CPULimit outside the function, will work but it exposes the global variable. now I wrapped the function with extern "C" like this

and surprisingly it worked, 1) I'm not sure how it worked , could anyone shed some light? Is this the right way of doing it?

2) what does it mean to have two externs (one extern C and one extern)

0 投票
7 回答
27221 浏览

gcc - 未知类型名称“off64_t”

我在带有 GCC 4.8.1 的 Ubuntu 上使用 Apache Portable Runtime 时遇到问题

问题是off64_t使用. (当一切正常编译时)<sys/types.h>gccg++

有人知道使用哪个编译器开关来启用off64_t吗?(我知道定义_LARGEFILE_SOURCE _LARGEFILE64_SOURCE可以避免这个问题,但想知道这是否是正确的方法)

要重现错误,可以简单地尝试编译以下代码:

0 投票
1 回答
7355 浏览

c++ - thread_local 成员变量构造

我在使用 thread_local 时遇到了一些奇怪的行为,不确定是我做错了什么还是 GCC 错误。我有以下最小重现场景:

使用上面的注释行,输出看起来像这样:

爱迪生

没有注释,它变成了这样:

爱迪生

我只是在这里错过了一些愚蠢的东西吗?

更新:

这也提供了意想不到的结果:

结果:

0 投票
1 回答
2032 浏览

gcc - Upgrading from GCC 4.8.2 to GCC 4.9.0 without a complete rebuild

I installed the GCC 4.8.2 a couple of weeks ago. The installation process went well and I have GCC 4.8.2 at my Ubuntu system (12.04 64 bits). Now GNU just released the newer version 4.9.0.

My question is: Is there any way to upgrade my GCC to 4.9.0 without doing all process: configuration, building, checking and installation from scratch? Also, please tell me what is the benefit/purpose of gcc-4.8.2-4.9.0.diff.gz file? Is it like script/patch file to upgrade my compiler?

FYI, I don't have any plan to have two different versions of GCC at my system.

0 投票
2 回答
3731 浏览

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::thisWorld*to 转换为World*&. 用以下方法替换该World::Save方法可以解决问题:

GCC 4.8.1 和 GCC 4.9 之间的行为似乎存在差异,导致后者无法编译,除非我创建this指针的副本。如果有人能指出为什么会发生这种情况,以及这是否是一个错误或预期的行为改变,那将不胜感激!

0 投票
1 回答
402 浏览

c++ - libstdc++ 是否实现 C++11 双端队列接口?

我对 GCC 和 libstdc++ 的经验很少。尝试在 C++11 中编译一个非常简单的程序,我发现编译器错误看起来 STL 没有为双端队列实现新的 C++11 接口。

示例程序:

运行以下命令行,我在注释行中得到编译错误:

(安装的 gcc/libstdc++ 版本为 4.8.1)

看起来 STL 没有实现:

http://en.cppreference.com/w/cpp/container/deque/insert,或标准 C+11 23.3.3.4 deque 修饰符)

我知道 libstdc++ 还没有完全实现 C++11,但状态页面(http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2011)仅建议分配器和传播要求还没有完成。

所以我的问题:

  • 实际上 libstdc++ 中没有完整的 C++std::deque接口实现,还是我遗漏了什么?(也许我没有使用正确的库版本,或者我在命令行中缺少一些参数;我对 gcc/g++ 没有太多经验)。
  • 如果这是我的错误,我该如何解决?