Problem when saving a .lib or .sch file

I am new to KiCad but I have used Cad programs for many years. I wanted to try KiCad because my old Ultiboard V5.56 is outdated. Vhen I started a new project with KiCad, I had to make some new parts to the library. When I tried to save the new component(symbol) everything seems to work. I could import the part to the schematic editor, place it and fetch other components. When saving the .sch and closed the program no fault messages were reported. But when I opened the program the next day and tried to load the .sch, the new component was missing, just a question mark and the name of the component was presented. Also the saved component library was missing. When I looked in the direcrory were they should be I found the files but they were saved as Altium files. I have tested an evaluation version of Altium so the PC seems to believe that the KiCad files are Altium files and save them as this.
How do I fix this? I use Windows 10.
Regards, KjKa

Well i don’t think they are really altium files. Your operating system just associates the file type .lib as an altium file.
(This is because a long time ago people thought it would be a good idea to define the file type via a part of the name. Maybe a better way would have been to use some sort of file header. But well it’s to late to think about something like that.)

I assume you are using kicad v4.x
About your problem. It seems a bit strange to me. Normally when you insert a symbol it should be put into the local cache library. (there should be a <project_name>-cache.lib file in your project directory.)
This file should contain the information about all used symbols. As long as you don’t delete this file nothing like you described up there should happen.

Please check the following.
1.) give us your kicad version. (otherwise we are a bit in the dark)
2.) Is this cache lib in your project folder.
3.) Did you create a project or did you open the schematic editor as standalone?
4.) Is your library added to the searchpath of your project?
(preferences->component libraries, You need to add both the path to the library [lower half of the dialog] and the library itself [upper half])
5.) Check if the symbol is in the library (after adding id as in point 4, open it with the library editor)

If the symbol is not in the library maybe you forgot to save the changes to the file (symbol is found on the top left corner.) But then you should never have been able to insert it into the project.

1 Like

Hi Rene.
Thanks for reply!
1.) My KiCad version is 4.0.5.
2.) There is a cache lib in the project folder. But it is also marked as an Altium type file!
3.) I created a project and opened the schematic editor.
4.) The searchpath is included for the library but not the library itself! I´ll try again and see what happens.

Do you know if it is possible to avoid Windows to handle this files as Altium type files?
Regards, KjKa

It doesn’t really matter do be honest. (This association is only used for deciding which program to open when double clicking on a file.)
I don’t use windows but a quick google search gave me this:

(apparently there is more than one method to change this.)

1 Like

The Altium file associations are not a problem. I have AD Viewer, CS demo and EAGLE 7.7 Free installed and there are no influences to KiCad with lib, brd, mod files if you avoid to double click on them.

I think your problem is KiCad installation path. When you just accept every installation steps, you accepted that KiCad will be installed as many other Windows apps in Program Files [(x86)]. Unfortunately KiCad can’t save anything to Program Files folder and its own library subfolder ...\share\libraries because didn’t have higher permissions to do that and pass through the Windows UAC. You didn’t get any warning or error on that form Windows. He just do it their own way.
Your modified libraries fortunately has been saved and should be found in Virtual Store which is created for any attempt to save in Program Files by unknown to UAC application. Enable visibility of hidden files in Explorer and then look at C:\Users\<your_profile_name>\AppData\Local\VirtualStore\Program Files folder.

To avoid these situation in the future, there are two options:

  1. Uninstall KiCad and save your work and KiCad’s Virtual Store content. Install KiCad somewhere else than Windows Program Files and restore your modifications.
  2. Keep KiCad where it is and always save your work and libraries outside folders protected by Windows and include these folders in any new project you started. You can create your own portable template using some info in KiCad manual if you choose easy way. Or modify default .pro file from \share\templates folder if you choose harder way where UAC will be play first fiddle again.

ps. The Devs should think about add some warning in installer for Windows users. The WinXP era passed away.

1 Like

OK, thank you. I´ll try to make the component with the right paths set.

Hi. Thanks for the quick answers and help! I am up and running and have made several new components but I see that I have a lot to learn. It is really good to experience that this forum is behaving in a similar manner as i am used to from the OpenHPSDR forum! I never got so fast reaction and help from any commercial vendors!
Best regards, KjKa

OFF: Because they are busy making their money. Kidding… :smiley:

1 Like

On Win 7, not sure about Win 10, you can also right click on the file and select “Properties”, then on the “General” tab where it says “Opens with:” click the “Change” button.

1 Like

Sorry for reviving this old thread, but it has 2 errors which I did not want to ignore.
I would like it to be able to reply here (for the archives / reference) without bumping the thread…

This is a typical example of window’s lazyness. Unix/Linux (derived) systems have been looking at file contents for ages to determine what it should be used for.
For example pdf files start with the string “%PDF” followed by a version number and many more. In fact Just cp’d asdf.pdf to asdf.silly_extension (on cmd line) and when double clicking on it (in file browser) it still opens flawlesly in a pdf viewer.

This is not unfortunate. It is good design. Libraries there should not be edited by users. If a user wants a similar component he should copy it to a personal lib and modify the copy.

Well, you didn’t really find errors, but just added your own opinions - which are debatable.

Rather silly opinion, Windows started out on PCs which were considerably less powerful than Unix systems which predated PCs, andd were known as “mini-computers” - mini because they were smaller than mainframes.

In your opinion…

Digging up old threads just to throw in your 2c is not very useful, I hope you are not going to make a habit of it.

1 Like