首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“错误:架构x86_64的未定义符号”发生在LibSBMLSim(SBML=Systems生物标记语言)中。

“错误:架构x86_64的未定义符号”发生在LibSBMLSim(SBML=Systems生物标记语言)中。
EN

Stack Overflow用户
提问于 2017-09-28 17:55:00
回答 1查看 149关注 0票数 1

我尝试使用LibSBMLSim作为c语言的api。我引用了https://fun.bio.keio.ac.jp/software/libsbmlsim/并同时安装了LibSBML和LibSBMLSim.Then,我创建了如下所示的c文件:

代码语言:javascript
复制
/* Example C, C++ code */
#include "libsbmlsim/libsbmlsim.h"
int main(void) {
  /*
   * Simulate sbml.xml to time=20 with dt=0.1, print_interval=10
   * by 4th-order Runge-Kutta Method.
   */
  myResult *r = simulateSBMLFromFile("sbml.xml", 20, 0.1, 10, 0, MTHD_RUNGE_KUTTA, 0);
  write_csv(r, "result.csv"); /* Export simulation result as CSV file */
  free_myResult(r);           /* Free Result object */
  return 0;
}

并执行了"gcc测试.c -o测试“,但出现了错误。错误消息如下:

代码语言:javascript
复制
Undefined symbols for architecture x86_64:
  "_free_myResult", referenced from:
      _main in test-f56b85.o
  "_simulateSBMLFromFile", referenced from:
      _main in test-f56b85.o
  "_write_csv", referenced from:
      _main in test-f56b85.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我检查了/usr/local/include/libsbmlsim/libsbmlsim.h,那里有指定的free_myResult函数。我试了很多次,但不起作用。请帮帮忙。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-09-28 18:02:34

我检查了/usr/local/include/libsbmlsim/libsbmlsim.h,那里有指定的free_myResult函数。

这只能证实原型的存在。但是在编译时,您需要知道要使用哪个库来查找这些符号。因此,您需要使用-lsbmlsim与库链接,并可能指定使用-L搜索库的位置和使用-I的头文件的位置--所有这些都在命令行中。

或者,您可以使用Makefile。看看libsbmlsim示例中提供的Makefile

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46475514

复制
相关文章

相似问题

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