编译c++源码问题
Issue compiling c++ source
我在编译c++程序时遇到了问题,我试图找到问题并解决它,但目前我无法找到问题的根源。如果有人能帮我一把,我会很感激的。
给出的错误是:(在Centos 6.3与gcc 4.4.7下编译)
In file included from /home/server/Sources/MOP/MistCore/src/server/scripts/PrecompiledHeaders/ScriptPCH.h:25,
from /home/server/Sources/MOP/MistCore/src/server/game/Anticheat/AnticheatMgr.h:7,
from /home/server/Sources/MOP/MistCore/src/server/game/Anticheat/AnticheatData.h:4,
from /home/server/Sources/MOP/MistCore/src/server/game/Anticheat/AnticheatData.cpp:1:
/home/server/Sources/MOP/MistCore/src/server/game/Spells/SpellScript.h: In constructor ‘AuraScript::AuraScript()’:
/home/server/Sources/MOP/MistCore/src/server/game/Spells/SpellScript.h:619: error: no matching function for call to ‘std::shared_ptr<Aura>::shared_ptr(NULL)’
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/shared_ptr.h:1263: note: candidates are: std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Tp>&&) [with _Tp = Aura]
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/shared_ptr.h:1238: note: std::shared_ptr<_Tp>::shared_ptr() [with _Tp = Aura]
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/shared_ptr.h:1236: note: std::shared_ptr<Aura>::shared_ptr(const std::shared_ptr<Aura>&)
make[2]: *** [src/server/game/CMakeFiles/game.dir/Anticheat/AnticheatData.cpp.o] Error 1
make[1]: *** [src/server/game/CMakeFiles/game.dir/all] Error 2
make: *** [all] Error 2
文件:
-
SpellScript.cpp
: http://pastebin.com/Cam59CWt -
SpellScript.h
: http://pastebin.com/XYp6pSf9
是的,这是一段很长的代码。
根据这个站点,std::shared_ptr
是在c++ 11中引入的。
使用GCC编译c++ 11需要4.7或更高版本。
注意,MistCore是基于TrinityCore,而不是使用c++ 11特定的定义命名为AuraPtr
使用一个简单的Aura*
指针。将其恢复到原始状态应该就像在原始项目中使用一样。
您可以简单地编辑/src/server/game/SharedPtrs/SharedPtrs.h
,并通过用简单的指针替换定义来取消std::shared_ptr
的需要。但不能保证它能解决所有问题。为例。
您可以使用-std=c++11
相关文章:
- 警告处理为错误这里有什么问题
- 最小硬币更换问题(自上而下方法)
- 为"adjacent"变量赋值时出现问题
- 我的神经网络不起作用 [XOR 问题]
- 在Ubuntu 16.04上安装Cilk时出现问题
- C++我的数学有什么问题,为什么我的代码不能正确循环
- CMake 错误"源似乎不包含 CMakeLists.txt",路径/库连接问题
- 问题基于从源到目的地的最短最远距离
- 从c++应用程序向bash传递源命令时出现问题
- 编译C 源的问题将.OFF文件转换为XML Android OpenGL ES可读取的问题
- 字符串副本表示缓冲区太小,strcpy_s源问题
- 在 Matlab 中将以下矩阵代码转换为 C++ 中的特征码时出现问题
- Linux 键盘扫描码问题:例如,向上箭头给出 ^[[A.
- 如何解决二维码中的堆栈溢出问题
- 问题与我的第一个CPP程序-头和源
- c++源码组织- COM端口初始化
- 跨步进入c++ OpenCV源码
- 用于比较c++头文件与其基文件的开放源码实用程序
- C/ c++混合源码:在C代码中获取sizeof(c++结构体)
- 编译c++源码问题