- UID
- 107818
- 性别
- 男
|
我编译时总报错,提示找不到变量定义,可是我不知道需要那个头文件?在sopc builder中,我选择了生成sdk,但是我使用的是ide开发环境,在别的文章中说需要include system.h ,不需要include excalibur.h,此外,生成的sdk中的头文件是不是就是我需要的?怎么用呢?可能sdk与我的源程序不在同一个目录。在属性对话框里面设置了路径也不对。谢谢!
======================
#include
#include "system.h"
int main()
{
na_timer1->np_timerperiodl = (short)(nasys_clock_freq & 0x0000ffff);
na_timer1->np_timerperiodh = (short)((nasys_clock_freq >> 16) & 0x0000ffff); // Set timer running, looping, no interrupts
na_timer1->np_timercontrol = np_timercontrol_start_mask+ np_timercontrol_cont_mask;
return 0;
}
===================
make -s all
Compiling hello_world.c...
../hello_world.c: In function `main':
../hello_world.c:22: error: `na_timer1' undeclared (first use in this function)
../hello_world.c:22: error: (Each undeclared identifier is reported only once
../hello_world.c:22: error: for each function it appears in.)
../hello_world.c:22: error: `nasys_clock_freq' undeclared (first use in this function)
../hello_world.c:24: error: `np_timercontrol_start_mask' undeclared (first use in this function)
../hello_world.c:24: error: `np_timercontrol_cont_mask' undeclared (first use in this function)
make: *** [obj/hello_world.o] Error 1
Build completed
======================= |
|