CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

command line compiler

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

command line compiler
PostPosted: Sun Dec 10, 2006 11:40 pm     Reply with quote

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

View user's profile Send private message

Re: command line compiler
PostPosted: Mon Dec 11, 2006 3:42 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Dec 11, 2006 7:46 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Dec 11, 2006 9:22 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Dec 11, 2006 12:00 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Dec 11, 2006 1:02 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Dec 11, 2006 2:08 pm     Reply with quote

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... Rolling Eyes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group