View previous topic :: View next topic |
Author |
Message |
jma_1
Joined: 08 Feb 2005 Posts: 147 Location: Wisconsin
|
command line compiler |
Posted: Sun Dec 10, 2006 11:40 pm |
|
|
Greetings,
I've come across a quirky thing when using the command line compiler v3.228
I'm trying to construct a small interface to check code in and out of a version control package, edit source code, and compile the source code. It would be very inconvenient If I have to manually create a project through the IDE each time I check out code. I could create a project file once and save the project file, but I do not believe this would work if I move the source code to a different location (assumption)
If I use the windows IDE and manually create the project, the project will compile successfully (F9 inside IDE).
If I try to compile the project from the command line, I get strange error messages saying the first file listed can not be opened (error 18). It then lists the locations it's searching. It's interesting though, the first path listed in the error message is correct. The file is included in the source code as #include "whatever.h".
I'm using the options +STDOUT +EA -EA +FH +DF +Y9 -P +DC +J -T -Z +LNlst +o8hex I+="c:\mysources;." c:\mysources\whatever.c
(where whatever.c has the 'main')
I get the same results if I have +J or -J
If I select 'Review / Edit include files' and select save (when creating the project). The command line version works correctly. The same behavior happens if I use the Project -> Edit / include dirs -> save.
Weird...
How does one use the command line compiler w/o the IDE?
Any thoughts?
Cheers,
JMA |
|
|
Martin Berriman
Joined: 08 Dec 2005 Posts: 66 Location: UK
|
Re: command line compiler |
Posted: Mon Dec 11, 2006 3:42 am |
|
|
jma_1 wrote: | I'm using the options +STDOUT +EA -EA +FH +DF +Y9 -P +DC +J -T -Z +LNlst +o8hex I+="c:\mysources;." |
I also use the command line compiler as I prefer using Microsoft Visual C++ IDE for editing however it seems to work for me (admittedly not all the same options though). Could it be that you have an unnecessary semicolon and period after the path specification? |
|
|
jma_1
Joined: 08 Feb 2005 Posts: 147 Location: Wisconsin
|
|
Posted: Mon Dec 11, 2006 7:46 am |
|
|
Greetings Martin,
If I understand the documentation correctly, multiple search paths can be used in the 'I' option where each one is separated by semicolons. I inlcuded the '.' to indicate looking 'here' in the calling directory.
Would you suggest other options? I called out the -EA for suppressing warnings, the -P to get rid of the splash screen compilation as soon as possible. Some of the other options specified merely duplicate the defaults.
Any other suggestions?
Cheers,
JMA |
|
|
Martin Berriman
Joined: 08 Dec 2005 Posts: 66 Location: UK
|
|
Posted: Mon Dec 11, 2006 9:22 am |
|
|
Hi JMA,
Just tried it with your command line and I get the same effect as you. Not sure if this is useful to you but I have found a simple workaround that does the job:
Create a project file that contains only this:
Code: | [Directories]
Include=C:\Program Files\PICC3\devices\;C:\Program Files\PICC3\drivers
|
Obviously you need to change the paths to suit. This then works with your compile command line on my version 3.236
Is this any good to you? |
|
|
jma_1
Joined: 08 Feb 2005 Posts: 147 Location: Wisconsin
|
|
Posted: Mon Dec 11, 2006 12:00 pm |
|
|
Thanks for the suggestion. This could work.
I haven't tested it yet, but based on your suggestion I might only have to add the device and driver directory to my search path. If this is all I have to do, I feel silly. I thought I had already tested this.
Cheers,
JMA |
|
|
jma_1
Joined: 08 Feb 2005 Posts: 147 Location: Wisconsin
|
|
Posted: Mon Dec 11, 2006 1:02 pm |
|
|
I was dumb and forgot to include the devices and driver directories in my search path. Once I added both, everything works perfectly.
Perhaps a more useful error message than unable to open a file which was in my search path is needed (hint).
Cheers,
JMA |
|
|
Martin Berriman
Joined: 08 Dec 2005 Posts: 66 Location: UK
|
|
Posted: Mon Dec 11, 2006 2:08 pm |
|
|
jma_1 wrote: | Perhaps a more useful error message than unable to open a file which was in my search path is needed (hint). |
Good point. It didn't occur to me that all you had to do was add them to the search path on the command line - Doh!
Now if only the linker would work... |
|
|
|