CW10 + HCS08 + file not found

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

CW10 + HCS08 + file not found

跳至解决方案
2,867 次查看
ssinfod
Contributor IV

Hello, 

 

I just installed CW10 for Microcontroller (HCS08).

I created a project with the wizard and the basic generated code works fine.

 

Anyhow, now I want to use a simple header (.h) and source(.c) files. When I try to compile, I have the error message : C5200 file not found.

 

My project is very simple. I only include the file "f.h" in the main.

 

FILE main.c :

 

 

#include <hidef.h> /* for EnableInterrupts macro */#include "derivative.h" /* include peripheral declarations */#include "f.h"void main(void) {  EnableInterrupts;  /* include your code here */    for(;;) {    __RESET_WATCHDOG(); /* feeds the dog */  } /* loop forever */  /* please make sure that you never leave main */}

 

 

The file f.h and f.c only have a simple function which does a basic addition.

 

 

int fxx(int x){    return  x;}

 

 

What is wrong with this code ?

Ican see the file in the IDE under the Sources directory but it seems CW10 (Eclipse) needs more information.

How do you add a simple header/source file in CW10 ?

 

Thanks for your time

ssinfod

标签 (1)
0 项奖励
回复
1 解答
1,168 次查看
CompilerGuru
NXP Employee
NXP Employee

The compiler include path only contains Project_Headers, but not the sources folder.

Therefore either move the header file into Project_Headers or add an include path to the Source folder.

The include paths for the compiler are defined in the properties of the project,

"C/C++ Build/Settings" Tab, select "HCS08 Compiler/Input" click on the "+" Button in Include File Path (-I) box

and add "${ProjDirPath}/Sources"

 

Daniel

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,168 次查看
Geoff_L
Contributor I

Are you sure that it isn't <hidef.h> or "derivative.h" that it can't find?

0 项奖励
回复
1,168 次查看
ssinfod
Contributor IV

 

No it says "f.h" file not found.

 

Here is a copy of the message.

 

C5200 f.h file not found main.c Test/Sources line 4 C/C++ Problem

I have attached the project with this post.

 

Thanks !

ssinfod

0 项奖励
回复
1,169 次查看
CompilerGuru
NXP Employee
NXP Employee

The compiler include path only contains Project_Headers, but not the sources folder.

Therefore either move the header file into Project_Headers or add an include path to the Source folder.

The include paths for the compiler are defined in the properties of the project,

"C/C++ Build/Settings" Tab, select "HCS08 Compiler/Input" click on the "+" Button in Include File Path (-I) box

and add "${ProjDirPath}/Sources"

 

Daniel

0 项奖励
回复
1,168 次查看
ssinfod
Contributor IV

Thanks both solutions work fine.

 

ssinfod.

 

0 项奖励
回复