我尝试使用LibSBMLSim作为c语言的api。我引用了https://fun.bio.keio.ac.jp/software/libsbmlsim/并同时安装了LibSBML和LibSBMLSim.Then,我创建了如下所示的c文件:
/* 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测试“,但出现了错误。错误消息如下:
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函数。我试了很多次,但不起作用。请帮帮忙。
https://stackoverflow.com/questions/46475514
复制相似问题