我尝试在lib语言中使用LibSBMLSim作为api。 我引用了https://fun.bio.keio.ac.jp/software/libsbmlsim/并安装了LibSBML和LibSBMLSim。然后我创建了如下所示的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 test.c -o test",但发生了错误。错误消息如下:
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函数。 我尝试了很多,但它不起作用。请帮忙。