找不到符号"Embeddedrcall_Init"; [英] cannot find symbol "Embeddedrcall_Init"

查看:67
本文介绍了找不到符号"Embeddedrcall_Init";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用swig为Windows环境中的EmbeddedR C程序创建dll文件.我正在使用以下命令:

I am trying to create a dll file using swig for an embeddedR C Program in windows environment. I am using the below commands:

C:\swigwin-3.0.12\Examples\r\Z>swig -c++ -tcl embeddedRCall.i
C:\swigwin-3.0.12\Examples\r\Z>gcc -c  embeddedRCall.c -I/swigwin-3.0.12/Examples/r/Z
C:\swigwin-3.0.12\Examples\r\Z>gcc -c  embeddedRCall_wrap.c -I/Tcl/include/tcl8.6 -I/swigwin-3.0.12/Examples/r/Z
C:\swigwin-3.0.12\Examples\r\Z>gcc -shared embeddedRCall.o embeddedRCall_wrap.o -o embeddedRCall.dll -L/Tcl/lib -L/R/R-3.3.2/bin/i386 -lR -lRblas -lRiconv -lRlapack -ltcl86
% load embeddedRCall
cannot find symbol "Embeddedrcall_Init"

我能够使用tclsh加载其他example.dll文件.但是我无法弄清原因-我已经在使用tcl 32位
我的模块文件名为,模块名称为EmbeddedRcall
我想念什么吗???我是TCL的新手,有人可以帮助我吗.

I was able to load other example.dll files with tclsh
However I was unable to figure out the reason-- I am already using tcl 32 bit
My module file name is and module name is embeddedRcall
Am I missing something??? I am relatively new to TCL can someone please help me.

推荐答案

您应该在库中有一个导出的( extern"C" )功能符号,该符号的名称类似于 Embeddedrcall_Init ;它是让Tcl将库安装到特定解释器实例的入口点.(必须显式地找到它,因为它带有一个参数.)默认情况下,该函数的名称是通过修改库的名称(带版本号,大小写转换,附加 _Init )找到的,但是名称的确定可以由可选

You should have an exported (extern "C") function symbol in your library called something like Embeddedrcall_Init; it is the entry point that lets Tcl install the library into a specific interpreter instance. (It has to be found explicitly because it takes an argument.) By default, the name of the function is found by munging the name of the library (strip version number, case convert, append _Init) but the determination of the name can be overridden by the optional second argument to load.

更确切地说,如果该条目实际上被称为 EmbeddedRCall_Init ,则必须使用以下命令加载该条目:

To be more exact, if the entry is actually called EmbeddedRCall_Init, you would have to load it with:

load embeddedRCall EmbeddedRCall
# The _Init suffix is fixed when loading into a standard interp

请注意大小写不同!(此外,我们建议对加载的库使用完全限定的路径名​​,因为它避免了 dlopen()系统中的某些复杂情况.)

Note the case difference! (Also, we recommend using fully qualified path names to loaded libraries, as it avoids some complexities in the dlopen() system.)

这篇关于找不到符号"Embeddedrcall_Init";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆