首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AngelScript G++链接器错误

AngelScript G++链接器错误
EN

Stack Overflow用户
提问于 2013-08-18 16:35:17
回答 2查看 357关注 0票数 1

我试图在64位Linux机器(Linux 14)上使用AngelScript。我已经安装了AngelScript sdk附带的gnuc项目,并尝试使用以下命令进行编译:

代码语言:javascript
复制
g++ -fno-strict-aliasing main.cpp -langelscript

这会导致以下链接器错误:

代码语言:javascript
复制
/usr/local/lib/libangelscript.a(as_thread.o): In function `asCThreadManager::asCThreadManager()':
as_thread.cpp:(.text+0x12a): undefined reference to `pthread_key_create'
/usr/local/lib/libangelscript.a(as_thread.o): In function `asCThreadManager::~asCThreadManager()':
as_thread.cpp:(.text+0x381): undefined reference to `pthread_key_delete'
/usr/local/lib/libangelscript.a(as_thread.o): In function `asCThreadManager::CleanupLocalData()':
as_thread.cpp:(.text+0x453): undefined reference to `pthread_getspecific'
as_thread.cpp:(.text+0x4b8): undefined reference to `pthread_setspecific'
/usr/local/lib/libangelscript.a(as_thread.o): In function `asCThreadManager::GetLocalData()':
as_thread.cpp:(.text+0x4f7): undefined reference to `pthread_getspecific'
as_thread.cpp:(.text+0x557): undefined reference to `pthread_setspecific'
/usr/local/lib/libangelscript.a(as_thread.o): In function `asCThreadCriticalSection::TryEnter()':
as_thread.cpp:(.text+0x6a0): undefined reference to `pthread_mutex_trylock'
/usr/local/lib/libangelscript.a(as_thread.o): In function `asCThreadReadWriteLock::asCThreadReadWriteLock()':
as_thread.cpp:(.text+0x6c5): undefined reference to `pthread_rwlock_init'
/usr/local/lib/libangelscript.a(as_thread.o): In function `asCThreadReadWriteLock::~asCThreadReadWriteLock()':
as_thread.cpp:(.text+0x708): undefined reference to `pthread_rwlock_destroy'
/usr/local/lib/libangelscript.a(as_thread.o): In function `asCThreadReadWriteLock::AcquireExclusive()':
as_thread.cpp:(.text+0x722): undefined reference to `pthread_rwlock_wrlock'
/usr/local/lib/libangelscript.a(as_thread.o): In function `asCThreadReadWriteLock::ReleaseExclusive()':
as_thread.cpp:(.text+0x73c): undefined reference to `pthread_rwlock_unlock'
/usr/local/lib/libangelscript.a(as_thread.o): In function `asCThreadReadWriteLock::AcquireShared()':
as_thread.cpp:(.text+0x756): undefined reference to `pthread_rwlock_rdlock'
/usr/local/lib/libangelscript.a(as_thread.o): In function `asCThreadReadWriteLock::ReleaseShared()':
as_thread.cpp:(.text+0x770): undefined reference to `pthread_rwlock_unlock'
collect2: error: ld returned 1 exit status

似乎很多事情都是没有定义的。我想这是图书馆安装的问题。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-08-18 20:17:36

AngelScript需要为线程定义一个库。在GNU上,您可以通过在编译命令中添加-lpthread来添加Posix线程来启用它。

票数 1
EN

Stack Overflow用户

发布于 2019-10-26 23:45:39

如何为Linux[来源]安装AngelScript

代码语言:javascript
复制
mkdir angelscript
cd angelscript
wget http://www.angelcode.com/angelscript/sdk/files/angelscript_2.22.1.zip
unzip angelscript_*.zip
cd sdk/angelscript/projects/gnuc
SHARED=1 VERSION=2.22.1 make

# sudo make install fails when making the symbolic link, this removes the existing versions
rm -f ../../lib/\*
sudo SHARED=1 VERSION=2.22.1 make install

#cleanup files made by root
rm -f ../../lib/\*
cd ../../../../../
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18301320

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档