Jump to content

Including Source Files From Other Locations


Recommended Posts

some sources, which are common for several projects, are stored in a common folder.

i try to access them from my sourceboost pic18 project.

 

by including the .h file in my main source file:

 

#include "..\PIC18LIBS\LCD_A_r0_01\P18LCDA2r0_01.h"

 

and by adding the .c file (P18LCDA2r0_01.c) to the source files list in the project (i use sourceboost from within mplab).

 

doing so, the main project .c file (test4main.c ) is compiled, but the P18LCDA2r0_01.c file, i've also added to the source files list, gives an error:

 

FATAL: Unable to open input file: D:\SwDesign\pic\test4\P18LCDA2r0_01.c

 

sure this gives an error, as the file is located under D:\SwDesign\pic\PIC18LIBS\LCD_A_r0_01\P18LCDA2r0_01.c

 

but when adding the source using the 'add files to project' dialog, the file can be found and selected.

 

how do i have to configure that the files can be found?

 

is there a better way to handle 'common files', maybe in a way that the 'common folder' can be configured and such files can be automatically found by all projects?

 

thanx for your help!

Link to post
Share on other sites

I've been using syntax like yours:

 

#include "..\PIC18LIBS\LCD_A_r0_01\P18LCDA2r0_01.h"

 

without any problem. Are you sure there are no typos in the path? Also make sure there are no other files that include this header that only use the file name without the path.

 

Good luck.

Link to post
Share on other sites

it's not the .h file, that is not found. it's the .c file!

the .c file is in the same folder as the .h file (which is not the project folder). it can be added to the sources, but the compiler does not find it.

 

as a workaround, i separately compiled the .c as a library. like this it works, but sometimes, it would be easier to handle it as an external .c file instead of a library.

 

so far, no solution!

 

I've been using syntax like yours:

 

#include "..\PIC18LIBS\LCD_A_r0_01\P18LCDA2r0_01.h"

 

without any problem. Are you sure there are no typos in the path? Also make sure there are no other files that include this header that only use the file name without the path.

 

Good luck.

Link to post
Share on other sites
...so far, no solution!...

 

What compiler version do you use? Version 6.92 is broken in this respect (projects that have sources not in the project dir may not build). All other releases are fine (including 6.93 RC)..

Pavel

Link to post
Share on other sites

hi pavel

i have 6.93rc2

 

...so far, no solution!...

 

What compiler version do you use? Version 6.92 is broken in this respect (projects that have sources not in the project dir may not build). All other releases are fine (including 6.93 RC)..

Pavel

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...