gpt4 book ai didi

c++ - c++中goblin库头文件报错

转载 作者:太空宇宙 更新时间:2023-11-04 03:04:17 25 4
gpt4 key购买 nike

我正在尝试使用 Goblin library用于特殊的网络算法。这个库提供了一些 C/C++ 的头文件和对象。因此,您可以轻松地向您的程序添加一个头文件并使用一些特殊的类和函数。

不幸的是,当我添加头文件时,出现错误。在下面你可以看到简单的代码和错误。

来源:

#include<goblin.h>

int main()
{
return 0;
}

错误:

$ g++ -o test.o test.cpp
/tmp/ccB0Rb25.o: In function `goblinRootObject::~goblinRootObject()':
test.cpp:(.text._ZN16goblinRootObjectD1Ev[goblinRootObject::~goblinRootObject()]+0x10): undefined reference to `goblinNObjects'
test.cpp:(.text._ZN16goblinRootObjectD1Ev[goblinRootObject::~goblinRootObject()]+0x18): undefined reference to `goblinNObjects'
test.cpp:(.text._ZN16goblinRootObjectD1Ev[goblinRootObject::~goblinRootObject()]+0x2c): undefined reference to `goblinRootObject::operator delete(void*)'
/tmp/ccB0Rb25.o: In function `goblinRootObject::~goblinRootObject()':
test.cpp:(.text._ZN16goblinRootObjectD0Ev[goblinRootObject::~goblinRootObject()]+0x10): undefined reference to `goblinNObjects'
test.cpp:(.text._ZN16goblinRootObjectD0Ev[goblinRootObject::~goblinRootObject()]+0x18): undefined reference to `goblinNObjects'
test.cpp:(.text._ZN16goblinRootObjectD0Ev[goblinRootObject::~goblinRootObject()]+0x2c): undefined reference to `goblinRootObject::operator delete(void*)'
collect2: ld returned 1 exit status

最佳答案

尝试:

g++ -lgoblin -L/pathToLibgoblin/-o test.o test.cpp

关于c++ - c++中goblin库头文件报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7602763/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com