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 support@ccsinfo.com

How to open header file for specific PIC?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
NAR



Joined: 01 Dec 2016
Posts: 17
Location: IL, USA

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 12:57 pm     Reply with quote

Let me give that a shot;

I assume you mean when you right click and click on "Open File at cursor" option. Yes, if you do that with .h or .c then CCS IDE will open that file in a new TAP within the IDE. Except; if your project is unable to see that folder in the first place. For example, if your .h or .c you are trying to open is in the same directory as your project then it will open (compile your .c file first to get your project file created and directories included)

If you put it somewhere else and 'Project' settings can't see that folder, then nothing will happen when you click on that menu option.

If this is the case; go to Options -> Project -> Include Files and add the directory where file is located. On the other hand, if the folder is not there, you wont be able to compile either.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 12:59 pm     Reply with quote

We are back to what I said at the start... Very Happy

Point is the right click 'open', uses the _Windows_ associations.
If Windows has been told to open .c and .h files 'with' the CCS IDE, then the files will be opened with this. If the association hasn't been set, it won't open. If is is set to something else, it opens with this instead.
Happen to know this, because I have .c files set to open with another compiler, and if I use the right click option, it uses this instead....
NAR



Joined: 01 Dec 2016
Posts: 17
Location: IL, USA

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 1:03 pm     Reply with quote

Ttelmah wrote:
We are back to what I said at the start... Very Happy

Point is the right click 'open', uses the _Windows_ associations.
If Windows has been told to open .c and .h files 'with' the CCS IDE, then the files will be opened with this. If the association hasn't been set, it won't open. If is is set to something else, it opens with this instead.
Happen to know this, because I have .c files set to open with another compiler, and if I use the right click option, it uses this instead....


Yes but when he installs the IDE, it will change that by itself and it will associate all output files to be opened by the IDE, even .lst and so on. Though if the folder is not included in the Project, it wont open the file even if its correctly associated with the IDE Very Happy
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 1:07 pm     Reply with quote

Something else has changed these associations.....

Will happen if you install quite a few other things.

That's also assuming the IDE was installed on that system. Quite common to copy it onto another system, then the associations are not set.


Last edited by Ttelmah on Sat Mar 18, 2017 1:08 pm; edited 1 time in total
jeremiah



Joined: 20 Jul 2010
Posts: 1314

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 1:08 pm     Reply with quote

Ttelmah wrote:
We are back to what I said at the start... Very Happy

Point is the right click 'open', uses the _Windows_ associations.
If Windows has been told to open .c and .h files 'with' the CCS IDE, then the files will be opened with this. If the association hasn't been set, it won't open. If is is set to something else, it opens with this instead.
Happen to know this, because I have .c files set to open with another compiler, and if I use the right click option, it uses this instead....


Interesting. On mine it doesn't use the window's associations. I have both .h and .c associated to a non CCS program (visual studio 2017), but right click=>"open file at cursor" on the include line does still work within PCWHD. You can only have one windows association per file extension (at least in the version of Windows I am running), so I wonder why it works that way for you but not for me.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 1:14 pm     Reply with quote

Interesting. It's MS Visual studio, that took them over on my system....
NAR



Joined: 01 Dec 2016
Posts: 17
Location: IL, USA

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 1:14 pm     Reply with quote

jeremiah wrote:

Interesting. On mine it doesn't use the window's associations. I have both .h and .c associated to a non CCS program (visual studio 2017), but right click open does still work within PCWHD You can only have one windows association per file extension (at least in the version of Windows I am running), so I wonder why it works that way for you but not for me.


Looks like IDE will not use the Windows program and it still opens the file within its IDE even if its configured to use Notepad outside the IDE.

I have 5.070. and just tested this, changed .C to notepad. IDE opens it still normally.

Ok, so looks like OP just need to add the folder containing the file to his project; unless he means completely something else by his question Rolling Eyes
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 1:19 pm     Reply with quote

When you install, one of the last options it asks is whether to associate .c and .h files with the IDE. Wonder if the behaviour changes according to your selection on this?. I always say 'no' on recent installs (have too many compilers on the system...). About fifty copies of CCS included!...
NAR



Joined: 01 Dec 2016
Posts: 17
Location: IL, USA

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 1:24 pm     Reply with quote

Ttelmah wrote:
When you install, one of the last options it asks is whether to associate .c and .h files with the IDE. Wonder if the behaviour changes according to your selection on this?. I always say 'no' on recent installs (have too many compilers on the system...). About fifty copies of CCS included!...


While we are talking installation; whats your preferred way to manage different compiler versions and to revert back to an older one?

I know you choose which version to compile with if you have installed more than one on the same folder. But i noticed that older compiler will use newer header/device files. Recently i pointed out a duplicate defines with different values in the 66K40 header file to CCS and they sent me an updated fixed version. While debugging that, i was testing with older compiler version but they all used the same new corrupted header file!


Last edited by NAR on Sat Mar 18, 2017 1:32 pm; edited 1 time in total
NAR



Joined: 01 Dec 2016
Posts: 17
Location: IL, USA

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 1:31 pm     Reply with quote

Is installing different versions into different folders work ok?

I am using MAC. So my Windows development is Virtual Machine using VirtualBox. Runs nice and fast and i backup entire windows just by coping a file. I clone the VM when i need to install a new version and name that clone 5.069, or 5.070 and so on. This way i am sure no other files changed during upgrade, even to another folder! If no issue with having different CCS main folders running different compilers (& CCSLoad!!) will give that a try.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 1:36 pm     Reply with quote

I keep all the compilers separate.

PICC5058
PICC5060

etc. etc.

Create the directory.
Copy into it the registration files.
Download the install & run it.
In the install you tell everything to install into the directory name you have chosen (It'll insist momentarily on trying to create a sub directory call PICC, but just edit the selected name to remove this). You have to select the directory three different times.
Then after install, rename the automatic updater program.
Make sure all of your includes are done as 'relative', rather than including full paths.
Launch the compiler, and make sure it's default include options are set to include it's library files.

Then to recompile a file, simply delete the project file.
Open the compiler you want to use.
Select the main C file.
Compile.

Because you have deleted the project, each compiler uses it's own default includes.
Because you have renamed the auto updater, it won't be used, so the version will remain unchanged.

I have a single folder containing shortcuts to dozens of versions. Can just use whatever one I want.
NAR



Joined: 01 Dec 2016
Posts: 17
Location: IL, USA

View user's profile Send private message

PostPosted: Sat Mar 18, 2017 1:41 pm     Reply with quote

Thanks. Will give that a try. Backup will be just a little bit faster and also trying a different version will be faster. Now i need to shutdown current VM and load the other Windows VM to try to compile with a different version.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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