-
October 28th, 2015, 02:43 AM
#1
Selectively use dynamic linking?
How can I create a program that is partially dynamically linked, and some parts set to statically linked (like some third party libraries)?
Thanks
Jack
Last edited by lucky6969b; October 28th, 2015 at 08:51 AM.
Reason: Solved by recompiling the program... no need to ask anymore
-
October 28th, 2015, 10:47 AM
#2
Re: The linker cannot find the file I didn't specify in my project?
You download the static libs for the 3p project if you want to link statically, otherwise the dynamic libs
No proper libs available? If you have the source of the 3p project compile the lib yourself.
Nobody cares how it works as long as it works
-
October 28th, 2015, 07:09 PM
#3
Re: The linker cannot find the file I didn't specify in my project?
Hello,
I tried to wrap a big project which consists of a numerous sub-projects into statically linked library.
But one of the sub-projects complains that
The link time library (statically linked) is not suitable for a dynamically linked library as a final product.
Thanks
Jack
-
October 29th, 2015, 09:03 AM
#4
Re: The linker cannot find the file I didn't specify in my project?
Then I think you will have to investigate why they claim static linking is not suitable. I've seen this type of statement before and there are valid reasons for it, but could also be nonsense or simply the license which disallows static linking.
Nobody cares how it works as long as it works
-
October 30th, 2015, 02:16 AM
#5
Re: The linker cannot find the file I didn't specify in my project?
A third party code (including plain C runtime) may be released in a library of various forms, e.g. static .lib or dynamic .dll.
In case some of your code uses static library, and other does require to be linked with its DLL sibling, you cannot build all this into a single binary. You just can't. To solve that you may either get rid of inconsistency, i.e. use strictly the same type of third party library, .lib or .dll, all over your project, or you split your code to separate dlls, each one using only one type of third party library, and build your final app of the dlls.
A problem inevitably introduced with the last approach is that you cannot be sure about a memory (de)allocation uniformity in case of mixing different libraries. And because of this, you need to take a special care about freeing particular objects in the same binary where it was allocated.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|