开发者

Error for the header file of goblin library in c++

开发者 https://www.devze.com 2023-04-09 16:50 出处:网络
I am trying to use Goblin library which is used for special network algorithms. This library provides some header files and objects in C/C++. So, you can easily add a header file to your program and u

I am trying to use Goblin library which is used for special network algorithms. This library provides some header files and objects in C/C++. So, you can easily add a header file to your program and u开发者_StackOverflow社区se some special classes and functions.

Unfortunately, when I add the header file, I get error. In the following you can see the simple code and error.

Source:

#include<goblin.h>

int main()
{
    return 0;
}

Error:

$ 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


try:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号