I have this application in which I use a .lib file which is added to the application in Project Editor menu before compilation.
My problem that I am using different versions of that .lib file depending on a choice in the application.
Now I am creating various copies of the application depending on the .lib I need, another workaround is having a copy of each version and rename before running the application.
I hope there is a way or code to change the targeted .lib at runtime.
In Clarion, as in many other programming languages, .lib files are static libraries that are linked to your application at compile time. This integration means that once your application is compiled with a specific .lib file, that version becomes a fixed part of your executable and cannot be changed during runtime. Consequently, the idea of switching between different versions of a .lib file based on user choices within the application isn’t feasible. You would need to compile a separate version of your application for each .lib file version you wish to use.
However, for dynamic behavior, as Jeff mentioned, you might need to consider using dynamic libraries (DLLs), particularly leveraging the Windows API function LoadLibrary. This function allows your application to load a DLL at runtime, enabling you to programmatically choose which DLL to load and even switch between different DLLs while the application is running.
Transitioning from static libraries to DLLs will necessitate some modifications in your application(s). This subject might require a deeper understanding and possibly several forum posts here if it’s not something you’re already familiar with. It’s a significant change but can provide the flexibility you need for dynamic functionality.