Include files in Codewarrior 10

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Include files in Codewarrior 10

12,127 Views
vier_kuifjes
Senior Contributor I

I'm trying to build an imported project in Codewarrior 10, but apparently the referenced #include files cannot be found by the compiler. I get the "unresolved inclusion" message.

The on line Codewarrior Infocenter says...

 

Include FilesThe search for include files is governed by two environment variables: GENPATH: #include "File" Path and LIBRARYPATH: `include <File>' Path. Include files that are included using double quotes as in:#include "test.h"are searched first in the current directory, then in the directory specified by the -I: Include File Path option, then in the directories given in the GENPATH: #include "File" Path environment variable, and finally in those listed in the LIBPATH or LIBRARYPATH: `include <File>' Path environment variable. The current directory is set using the IDE, the Program Manager, or the DEFAULTDIR: Default Current Directory environment variable.Include files that are included using angular brackets as in#include <stdio.h>are searched for first in the current directory, then in the directory specified by the -I option, and then in the directories given in LIBPATH or LIBRARYPATH. The current directory is set using the IDE, the Program Manager, or the DEFAULTDIR environment variable.

 

 

The classic Codewarrior had a window in which one could insert a list of paths with folders containing the include files. Do I now have to put all those paths in an (DOS style) environment variable? There must be a better way, or maybe I don't understand what the documentation is saying.

 

Please help!

Labels (1)
0 Kudos
10 Replies

1,645 Views
CrasyCat
Specialist III

Hello

 

From earlier conversation I remember you are using Coldfire MCU. Right?

 

First the documentation you are referring to is related to HC(S)08 compiler and is not valid for Coldfire.

 

In order to add additional include paths to your project settings follow these steps.

   - Open the project Properties dialog

   - On the left hand side of the dialog select "C/C++ Build" -> "Settings"

   - On the right hand side of the dialog select "Coldfire Compiler" -> "Input"

 

You should be able to add include paths in either the User Paths or the System path list box.

 

User paths are used if your files are included using double quotes ("filename.h").

System Paths are used when files are included using smaller and bigger sign (<filename.h>).

 

I hope this helps.

 

CrasyCat

0 Kudos

1,645 Views
WHookway
Contributor III

Hi,

 

I am having a "Unresolved Inclusion" message within the editor window.  The project builds OK and if I rename the include file, I get the message the include file cannot be opened.  If I change the content of the include file (function prototype), I get the message that the function has no prototype.  Actually the include, includes another include and both of the files are flagged with this message.  The changes I made are within the nested include so I am certain the paths are setup correct.  Is there something the editor needs to know about to prevent this warning?

 

Thanks,

Will

 

0 Kudos

1,645 Views
RayD
Contributor I

I'm also getting the "Unresolved inclusion" error.

 

I used the Project Importer to import a project from CW CF 7.2 to CF MCU 10.1.  I'm getting the "Unresolved inclusion" error on system includes such as <ctype.h>, <time.h> and <string.h>.

 

I have found all of these files in the directory MCU\ColdFIre_Support\ewl\EWL_C\include, so I know they're there.

 

I have also found them in the Includes section of the project file viewer, if I drill down deep enough in the hierarchy.  So Eclipse also knows they're there.

 

I tried adding the path to Project Properties --> C/C++ General --> Paths and Symbols --> Include_directories as

     ${MCUToolsBaseDir}\Coldfire Suport\ewl\EWL_C\include

, although this felt like a redundant step since the "include" directory is already listed in the Project file viewer.  After doing a Build All, I get the same "Unresolved inclusion" error and now I get a build warning:

     "Invalid project path: Include path not found (C:\Program Files (x86)\Freescale\CW MCU v10.1\MCU\Coldfire Support\ewl\EWL_C\include)."
That is the correct path name, character for character.

 

So what's going on?  How do I get CW MCU 10.1 to recognize perfectly valid system files in a perfectly valid Include path?

 

RayD

 

0 Kudos

1,645 Views
CrasyCat
Specialist III

Hello

 

There is a space in your installation path.

Please enclose the include directory into double quotes.

 

    "${MCUToolsBaseDir}/ColdFire_Support/ewl/EWL_C/include"

 

CrasyCat

0 Kudos

1,645 Views
RayD
Contributor I

 

There is a space in your installation path.

Please enclose the include directory into double quotes.

 

    "${MCUToolsBaseDir}/ColdFire_Support/ewl/EWL_C/inc​lude"

 

 

Sorry - that was a typing error on my part.  The directory shows up in my project tree as "ColdFire_Support", no space.  There are two spaces in "Program Files (x86)", but they don't seem to be affecting any other steps in the build.  Why would they affect only this step?

0 Kudos

1,645 Views
RayD
Contributor I

I found a strange solution to my "Unresolved includes" problem:  the #include statements were in my extras.c file, which I created long ago to handle deficiencies in the libraries in 6.3, 7.1 and 7.2.  After I imported my project into CW10, I deleted the extras.c file from the project (but didn't erase it from disk, just in case).  When I did a Build All, the compiler found <string.h> and the the other system header files someplace else, probably in the EWL_C/include directory, and finished the build with no problems.

0 Kudos

1,645 Views
SecondTechCo
Contributor IV

We found includes to be difficult.  If you write your own header file and then add it to the workspace, you must add the workspace path tp the include section.  In 6.3 code warrrior you could add a .h file into your project and it would find it.   In 10.0 you have to add the workspace location to the includes section as shown in the previous post if the header file is in the project.

0 Kudos

1,645 Views
SecondTechCo
Contributor IV

Also when we imported a project from code warrior 6.3 it automatically turned off the require function prototype flag.  If you select the project and select properties, settings, tool settings, language you can turn off require prototypes.  So when you import a project from 6.3 "require prototypes" appear to be off and when you create a new project it appears to be on.

0 Kudos

1,645 Views
CrasyCat
Specialist III

Hello

 

CodeWarrior V10 is based on Eclipse IDE and some functionality from CodeWarrior Classic are not present there.

 

In order to request an extension in et tool chain or to report a problem I would recommend you to submit a service request for that.

Click here to submit a service request.

CrasyCat

0 Kudos

1,645 Views
CrasyCat
Specialist III

Hello

 

From this point I think it is better to submit a service request for that.

Click here to submit a service request.

Make sure to attach a reproducible project to the service request.

CrasyCat

0 Kudos