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

[RESOLVED] CCS command line version selection

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



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

[RESOLVED] CCS command line version selection
PostPosted: Fri Nov 06, 2015 3:15 am     Reply with quote

Hello,

CCS IDE gives the option to select an already installed version of the compiler, when compiling a specific project.

I need to be able to select a specific version but via command line. I cant find it in CCS (command line) help.

Anyone?

Thank you


Last edited by PICoHolic on Fri Nov 06, 2015 8:59 am; edited 1 time in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19494

View user's profile Send private message

PostPosted: Fri Nov 06, 2015 4:07 am     Reply with quote

In the compiler directory. Subdirectory 'DLL', it creates subdirectories for each version, in which it keeps the .dat files and the DLL's. If you change the search path before calling CCSC, explicitly to the directory for the version you want (and the other directories necessary for the compile), it uses this version.

I must admit I find it much simpler to have all the versions in completely separate directories. So I have PICC5042 PICC5043 etc. etc.. Then you can just call the CCSC or IDE in the required directory, and not only does it get the dat/dll, it also gets the corresponding _includes_. There is a problem with the 'old version' option from the IDE, in that though it changes the compiler behaviour to the older version, it keeps the current include files. Where these change with versions, and you rely on the compiler's 'old version' behaviour, it becomes necessary to include all include files you use, with your project.... Crying or Very sad
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Fri Nov 06, 2015 5:32 am     Reply with quote

Hi Ttelmah,

Thank you.

I already know that different compilers are located in different folders

What do you mean by changing the search path?

CCS location: "C:\Program Files (x86)\PICC\"
Project location: "C:\TestCode\"

What I'm doing is that I'm calling the compiler from within the project location (prompt):
C:\TestCode> "C:\Program Files (x86)\PICC\Ccsc.exe" +FH +LS +STDOUT filename.c

("filename.c" is in "C:\TestCode\" folder)

I even tried this (in a batch file):
CD "C:\Program Files (x86)\PICC\DLL\5.048"
C:\Program Files (x86)\PICC\Ccsc.exe" +FH +LS +STDOUT "C:\TestCode\filename.c"

with no luck, the compiler version used is still 5.051 and not 5.048


Thanks again
Ttelmah



Joined: 11 Mar 2010
Posts: 19494

View user's profile Send private message

PostPosted: Fri Nov 06, 2015 6:09 am     Reply with quote

Launch a command prompt, and type 'set<return>'.
This shows the default 'paths' that any program receives.
You have to change the path to access the version you require (and then set it back to the default after the program has run).
It is messy and difficult, and as I say does not actually give you genuine compilation as if you had the old version (neither does the IDE), which is why if you really need the original version you need to store it 'complete', not use this method....
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Fri Nov 06, 2015 6:18 am     Reply with quote

Thank you.

I understand that. But sometimes include files (of a specific chip) do not change; thus, just a change of compiler version will do. (in the case of 5.048 and 5.051).

BTW I can't see any path related to compiler version in this list.

Thanks again Ttelmah
Ttelmah



Joined: 11 Mar 2010
Posts: 19494

View user's profile Send private message

PostPosted: Fri Nov 06, 2015 8:23 am     Reply with quote

There isn't.

It searches the path _first_, then ./DLL/current_version. If the path to the older version is in the path, it gets found instead of the current version.
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Fri Nov 06, 2015 9:01 am     Reply with quote

Hello Ttelmah,

I just sent an email to CCS support, apparently there's a command line option that does that:

version=x.xxx

Thanks
Ttelmah



Joined: 11 Mar 2010
Posts: 19494

View user's profile Send private message

PostPosted: Fri Nov 06, 2015 2:46 pm     Reply with quote

That simplifies things, but still with the caveats about this.
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