Dll/So: how to work
-
Hello!
Is it cross-platform method of working with dll/so libraries?
Would it work with static linking?Thank you!
@sitesv
What is your question?.dll
files are for Windows,.so
are for Linux. Static linking might require a different licence from the standard LGPL. And if you mean would that magically somehow work with same executable/binary across platforms, no it would not. You have to compile/link separately for each target platform. But maybe your question is something else.... -
Hello!
Is it cross-platform method of working with dll/so libraries?
Would it work with static linking?Thank you!
-
I have an app with dll's (windows variant). I need to make this soft for linux.
I need to recompile the app and libs. How to use dll/so in app code? -
Do you just have the
dll
or do you have the code available? You can not convert compiled dll's into so's. -
@Pl45m4
I have dll's sources.
I know about function names.
I need to know about something like LoadLibrary and GetProcAddress, that will work with *.so in Linux as well.@sitesv said in Dll/So: how to work:
I need to know about something like LoadLibrary and GetProcAddress
Usually there is no need for that if you link against shared libraries. LoadLibrary and GetProcAddress is only needed if you're loading shared libs manually at runtime. If you're just linking against shared libraries then you simply include header files from the libs and use their functionality as usual.
See https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html for some hints. -
@sitesv said in Dll/So: how to work:
I need to know about something like LoadLibrary and GetProcAddress
Usually there is no need for that if you link against shared libraries. LoadLibrary and GetProcAddress is only needed if you're loading shared libs manually at runtime. If you're just linking against shared libraries then you simply include header files from the libs and use their functionality as usual.
See https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html for some hints.@jsulm said in Dll/So: how to work:
@sitesv said in Dll/So: how to work:
I need to know about something like LoadLibrary and GetProcAddress
Usually there is no need for that if you link against shared libraries. LoadLibrary and GetProcAddress is only needed if you're loading shared libs manually at runtime. If you're just linking against shared libraries then you simply include header files from the libs and use their functionality as usual.
Sorry, my fault.
Exactly, I need to load libs manually at runtime. -
@jsulm said in Dll/So: how to work:
@sitesv said in Dll/So: how to work:
I need to know about something like LoadLibrary and GetProcAddress
Usually there is no need for that if you link against shared libraries. LoadLibrary and GetProcAddress is only needed if you're loading shared libs manually at runtime. If you're just linking against shared libraries then you simply include header files from the libs and use their functionality as usual.
Sorry, my fault.
Exactly, I need to load libs manually at runtime.@sitesv In this case see https://tldp.org/HOWTO/Program-Library-HOWTO/dl-libraries.html
-
@sitesv In this case see https://tldp.org/HOWTO/Program-Library-HOWTO/dl-libraries.html
-
@jsulm Thank you!
I was hoping that there are QT functions that allow working with libraries of different systems. -
-
@jsulm Thank you!
I was hoping that there are QT functions that allow working with libraries of different systems. -
@Pablo-J-Rogina said in Dll/So: how to work:
Is QLibrary of any help here?
My apologies! I didn't realize Qt provided an interface. The facts/behaviour remain the same, but Qt obviously supplies a "wrapper" layer.