TI C2800 DSP:排除 C++ 之间的链接器问题和汇编代码
我在汇编文件 sincos_p5sh.asm 中有一个函数 sincos_Q15_asm()
,其指令如下:
.sect ".text"
.global _sincos_Q15_asm
.sym _sincos_Q15_asm,_sincos_Q15_asm, 36, 2, 0
.func 1
当我单独测试它时(仅汇编),该函数工作正常,但是当我尝试链接到它时,我收到链接器错误:
undefined first referenced
symbol in file
--------- ----------------
sincos_Q15_asm(int, int *) build\pwm3phase.obj
error: unresolved symbols remain
这对我来说非常令人困惑,因为我在链接器命令中包含了组装文件 build\blocks\sincos_p5sh.obj
,并且我使用了绝对列表器 abs2000
在此 obj 文件上,它显示有一个符号 _sincos_Q15_asm
。 (下划线前缀是它在装配中的工作原理)
有什么建议我接下来应该排除故障吗?
I have a function sincos_Q15_asm()
in assembly, in file sincos_p5sh.asm with directives as follows:
.sect ".text"
.global _sincos_Q15_asm
.sym _sincos_Q15_asm,_sincos_Q15_asm, 36, 2, 0
.func 1
The function works fine when I test it by itself (assembly only), but when I try to link to it, I get a linker error:
undefined first referenced
symbol in file
--------- ----------------
sincos_Q15_asm(int, int *) build\pwm3phase.obj
error: unresolved symbols remain
This is very puzzling to me, as I am including the assembled file build\blocks\sincos_p5sh.obj
in my linker command, and I've used the absolute lister abs2000
on this obj file and it says there is a symbol _sincos_Q15_asm
. (the underscore prefix is how it works for assembly)
Any suggestions what I should troubleshoot next?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
噢!我发现了——我使用的是 C++,但忘记为我的函数包含
extern "C"
声明:D'oh! I figured it out -- I was using C++ and forgot to include the
extern "C"
declaration for my function: