Custom Libraries

Hi,

I would like to develop my own custom libraries. Each project I develop will have a subdirectory with the custom libraries it needs to run that project. I know that you can point to this location in the LIB.DIR file and it will work. However, let’s say that I have 10 different projects and all of them use a library called “My_Lib” and I want each of the 10 projects to use its own copy of “My_Lib”. I have two reasons for this. Firstly, I want the ability to modify “My_Lib” as time goes by without breaking a previous project that used "My_Lib. Secondly, I want a project contained within its own directory structure to make it easy to copy a project.

How can I differentiate which "My_Lib file the project uses if I can only modify LIB.DIR? I would have 10 reference paths to “My_Lib” and the compiler wouldn’t know which one to use.

Do people’s LIB.DIR typically end up having 100’s of path entries?

I hope this makes sense.

Thanks

Dynamic C supports having a custom LIB file for each project (.DCP) file you have. Go into Options/Project Options/Compiler/Advanced to select that file.

So you’ll have the main .C file, a .DCP (Project), and LIB.DIR (you’re free to name it something else) for each of your projects. Use the default Dynamic C LIB.DIR file as the starting point for the one used in your project. If you have libraries you use across projects, they could go into a sibling directory to your project directories. Libraries specific to a single project can be a subdirectory of the project.

Dynamic C 10 recursively scans ALL files in the directories listed and generates .HX1 and .MD1 files for each one, which can clutter up that directory. I recommend keeping your libraries in a separate directory from your .C file, even if it’s just a subdirectory.

Thnaks Tom. I will give that a try

Regards

Terry