如何为Blackfin BF537使用VisualDsp++5中*.cpp文件中的asm中实现的函数
How to use function implemented in asm from *.cpp file, in VisualDsp++ 5, for Blackfin BF537?
我已经在"Wiley Embedded Signal Processing with the Micro Signal Architecture。2007"-实现了2D DCT/IDCT(图像压缩)中解释了这个项目,我想在Blackfin BF 537的Visual Dsp中将另一个具有图像处理(只有*.cpp文件)的个人项目组合(将这些文件移动到..)。(首先在模拟器中,然后在板BF537上。)
已实施的项目2D DCT/IDCT具有*c和*asm文件,并且它工作得非常好。在某些情况下,对于某些计算,from C文件使用的是在asm文件中声明(并实现)的函数。
我注意到,如果我在我的项目中移动这些*.c文件(其中只包含*.cpp文件),我会得到很多错误,还有一些类似的错误:
"`[Error li1021] The following symbols referenced in processor 'p0' could not be resolved:
'something [_something]' referenced from '.Debugproject name.doj'"
所以,我认为我的项目中只需要*.cpp文件(而不是*.cpp和*.c的组合)。
在2D DCT/IDCT项目中,当我更改所有这些*时,问题就会出现c文件到*cpp文件。当我试图构建时,我得到了这个链接错误:
"[Error li1021] The following symbols referenced in processor 'p0' could not be resolved:
'_r8x8dct(short *, short *, short *) [__r8x8dct__FPsN21]' referenced from '.DebugStart_DCT2.doj'
'_r8x8invdct_ieee(short *, short *, short *) [__r8x8invdct_ieee__FPsN21]' referenced from '.DebugStart_DCT2.doj'"
在*cpp文件这就是我调用asm:中实现的函数的方式
_r8x8dct(in,coeff,temp);
在同一个*cpp文件我包括一个头文件,我在其中声明了函数:
void _r8x8dct(fract16 *in, fract16 *coeff, fract16 *temp);
这是*的一部分asm包含以下函数的文件:
.section L1_code;
.global __r8x8dct;
.align 8;
__r8x8dct:
.....................................
__r8x8dct.end:
具有$_r8x8invdct_ieee()
功能的模拟
*请原谅我的英语写作错误
要从C++调用C函数,您需要使用extern "C"
来限定C函数原型,例如
extern "C" void _r8x8dct(fract16 *in, fract16 *coeff, fract16 *temp);
或者,如果你有多个C函数,你可以像这样将原型组合在一起:
extern "C" {
void _r8x8dct(fract16 *in, fract16 *coeff, fract16 *temp);
// ... other C function prototypes ...
}
相关文章:
- .cpp和.h文件中的模板专用化声明
- 为什么两个不同的未命名名称空间可以共存于一个cpp文件中
- 命名空间中具有.h和.cpp文件的类
- 为什么我的主文件.cpp不打印头文件中的任何内容
- 生成文件错误 - 找不到文件 - *.cpp
- 如何在文件.cpp gtkmm中声明小部件
- 没有实现文件(.cpp)的派生类
- 如何使用"CMakeLists.txt"中的add_library将整个文件(.cpp,.h等)包含在目录中
- 如何在Linux / Windows操作系统上使用文件*.cpp一步编译下面的代码
- 关于 Linux .so 文件无法链接到主文件.cpp文件
- 文件.cpp从Windows到Linux
- Ubuntu C++ 编译器错误: g++: 错误: 文件.cpp: 没有这样的文件或目录
- 如何将文件.cpp编译为本机编译
- 使用模板类时,似乎无法包含除 main 以外的任何 cpp 文件.cpp
- 无法编译C++文件.cpp。C++98模式
- 为什么C++头文件不需要包含实现文件 (.cpp)
- 如何访问位于独立文件(.cpp)中的非成员函数
- 如何在Visual Studio Code中通过键盘快捷键切换头文件/cpp文件
- 如何将数据从stringstream写入文件(CPP)
- 为什么filestream不把空白写入文件cpp ?