View previous topic :: View next topic |
Author |
Message |
skoberlink
Joined: 27 May 2010 Posts: 52
|
|
Posted: Mon Jul 12, 2010 9:59 am |
|
|
I have an update on this. I finally broke down and just added the whole file path to the #include statement in osa.h and it worked. This would be an acceptable fix except I then have the same error on the osa_css18.h file and on and on for every #include statement. That's not very efficient and isn't really an acceptable fix, especially since I don't even understand why I need to do it.
Does it maybe have something to do with the fact that I'm keeping the files on a server instead of the C: drive? I think it's clear, it's something about the file path now but I might be jumping to conclusions.
EDIT: ah sorry I see what you mean now. Sorry I'm a little out of it today |
|
|
skoberlink
Joined: 27 May 2010 Posts: 52
|
|
Posted: Mon Jul 12, 2010 10:12 am |
|
|
alright thanks for your help. I realize this isn't related to your library but I'll ask anyway in case you happen to know a fix. Unfortunately I can't change the file structure and I have to keep my files there (company policy). Is there any way I can tell CCS to handle those spaces properly? |
|
|
tester
Joined: 29 Jun 2009 Posts: 40 Location: Russia, SPb
|
|
Posted: Mon Jul 12, 2010 10:24 am |
|
|
skoberlink wrote: | Is there any way I can tell CCS to handle those spaces properly? |
Try to use relative paths:
. - for the project
..\osa - for OSA files |
|
|
skoberlink
Joined: 27 May 2010 Posts: 52
|
|
Posted: Mon Jul 12, 2010 10:30 am |
|
|
Well using relative paths, it found osa.h but can't find port\osa_includ.h
Ah well this isn't anything to with your library anymore so I'll stop posting here. Thank you so much for your help and even more for the library! You saved me so much time and effort. |
|
|
tester
Joined: 29 Jun 2009 Posts: 40 Location: Russia, SPb
|
|
Posted: Mon Jul 12, 2010 10:41 am |
|
|
skoberlink wrote: | Well using relative paths, it found osa.h but can't find port\osa_includ.h
Ah well this isn't anything to with your library anymore so I'll stop posting here. Thank you so much for your help and even more for the library! You saved me so much time and effort. |
Don't give up! Other users can meet same troubles and they will find the solution here. Check the mail, I've sent you corrected copy of your project with correctly set path. It compiled with no errors. |
|
|
skoberlink
Joined: 27 May 2010 Posts: 52
|
|
Posted: Mon Jul 12, 2010 11:17 am |
|
|
Alright I lied before, I'm gonna bother you again lol.
So I've been using the relative paths and that will get me into osa.h. What I've noticed now is that when it looks for "port\osa_include.h" it looks for it in the project directory even though the #include statement is in "osa\osa.h" and ..\osa is in the search path. I know this because if I make the #include statement this:
Code: | #include "..\osa\port\osa_include.h" |
then it works.
So what this says to me (and I might be wrong) is that it's looking for the "port" folder in the project folder and not in the "osa" folder. So this no longer seems to be a <space> character issue (there aren't any in the search path) and since it compiles for you I'm guessing it's some compiler setting I have wrong.
Here's my whole compiler output from MPlab. Maybe you can spot something if you have the time.
Code: | Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program files\Picc\CCSC.exe" +FH "main_test.c" #__DEBUG=1 +ICD +DF +LN I+="..\osa\;.\" +T +A +M -Z +Y=9 +EA #__18F2620=TRUE
*** Error 18 "..\osa\osa.h" Line 1137(10,30): File can not be opened
Not in local "port\osa_include.h"
//a bunch of error messages stemming from the file that can't be opened
100 Errors, 0 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Mon Jul 12 12:07:17 2010 |
|
|
|
tester
Joined: 29 Jun 2009 Posts: 40 Location: Russia, SPb
|
|
Posted: Mon Jul 12, 2010 11:27 am |
|
|
This is strange...
I run your command line into the prject foulder (in Windows Commander):
"C:\Program files\Picc\CCSC.exe" +FH "main_test.c" #__DEBUG=1 +ICD +DF +LN I+="..\osa\;.\" +T +A +M -Z +Y=9 +EA #__18F2620=TRUE
Program has been compiled without any errors.
May be you're right and the problem is that disk "X:" is not physical? |
|
|
tester
Joined: 29 Jun 2009 Posts: 40 Location: Russia, SPb
|
|
Posted: Mon Jul 12, 2010 11:28 am |
|
|
Do you have a possibility to allocate OSA into "C:\OSA"? |
|
|
skoberlink
Joined: 27 May 2010 Posts: 52
|
|
Posted: Mon Jul 12, 2010 11:30 am |
|
|
Yeah I should be able to since it isn't code I wrote...At least I can give it a try and then work it out with my boss later if it works. |
|
|
tester
Joined: 29 Jun 2009 Posts: 40 Location: Russia, SPb
|
|
Posted: Mon Jul 12, 2010 11:32 am |
|
|
skoberlink wrote: | Yeah I should be able to since it isn't code I wrote...At least I can give it a try and then work it out with my boss later if it works. |
Another one expirement: copy OSA into your project directory:
X:\xxx\xxx\RTOS test\OSA
And add paths: "." and "osa" |
|
|
skoberlink
Joined: 27 May 2010 Posts: 52
|
|
Posted: Mon Jul 12, 2010 11:38 am |
|
|
Well now this is just weird. I tried putting osa in C:\ and it didn't work.
So I tried adding RTOStest to C:\ as well and it didn't work.
I changed the include search path to be the full path and it still didn't work. Then I put a copy of the port folder into the RTOStest folder and it still did not work.
That last one was a long shot but I'm running out of ideas. All of them gave the same compiler output. It seemed like at least one of those should have worked. Why would it only be able to find includes if the full path is in the #include statement? |
|
|
skoberlink
Joined: 27 May 2010 Posts: 52
|
|
Posted: Mon Jul 12, 2010 11:41 am |
|
|
tester wrote: | skoberlink wrote: | Yeah I should be able to since it isn't code I wrote...At least I can give it a try and then work it out with my boss later if it works. |
Another one expirement: copy OSA into your project directory:
X:\xxx\xxx\RTOS test\OSA
And add paths: "." and "osa" |
This one didn't work either. For some reason the #include statement in the osa files has to have the full file path. And that just doesn't make any sense... |
|
|
skoberlink
Joined: 27 May 2010 Posts: 52
|
|
Posted: Mon Jul 12, 2010 11:50 am |
|
|
Currently I have the osa folder in the project folder. If I make the osa_include.h statement relative to the project folder it will work. if I leave it as your original code (i.e. relative to the osa folder) it does not work. The proper include search paths are in place.
Any ideas as to why is it always relative to the project folder and not checking the search paths?
I mean the quote form include statement should make it search relative to the osa folder and even if it didn't for some reason it should find it based on the search path if I'm not mistaken. |
|
|
tester
Joined: 29 Jun 2009 Posts: 40 Location: Russia, SPb
|
|
Posted: Mon Jul 12, 2010 2:12 pm |
|
|
Last an idea - try to use another version of compiler. |
|
|
skoberlink
Joined: 27 May 2010 Posts: 52
|
|
Posted: Tue Jul 13, 2010 7:59 am |
|
|
I think you're right, it must be a compiler bug where it doesn't handle the includes quite right. I'll try to get another version of the compiler but it might be awhile...anyway thanks for trying.
That's CCS v4.038 in case you feel confident enough to add it to your documentation.
EDIT: continued to play with it. This version of the compiler doesn't seem to know the #WORD pre-processor either. Also it's definitely the compiler. I used a friends v4.105 (a confirmed working version) and it compiled no problem. So it def seems to be a bug in v4.038. |
|
|
|