Importing shared libraries

Hi,

I'm trying to run my application on a system other then my computer and get a lot of errors of missing .dll files.
What I really not want is creating a folder that contains all the libraries and my application file.
I'm more interested in a way to import .dlls into my program. I know, that must be possible, because every "normal" program also does it this way (user only gets a setup.exe that extracts all needed dlls).. So how do I do that? Can I pass the dlls to the command line by compiling?
I'm using mingw_32 g++ compiler...

Thank you in anticipation!
Last edited on
I know, that must be possible, because every "normal" program also does it this way (user only gets a setup.exe that extracts all needed dlls).
You need to create an installation package that contains your app and all its dependencies.

http://www.jrsoftware.org/isinfo.php
Hi kbw,
thank you for your fast support!
Well, using an already existing routine would be one way, but I'm more interested in a "small" solution just to import and export about 5 missing .dll files.

Before I started programming in c++, I coded with AutoHotkey, and there I had an easy command:
FileInstall, source_path, dest_pathThis functionallity made it possible to import any file resource (.exe, .dll, .txt, .mp3 and so on..) into my executable and export it at runtime to "destination_path".
Now, using C++, I'm looking for such a functionallity. What would be the best way to import files into my program? I don't know.. Is there a possibility to pass the dll files to g++ in command line?
Last edited on
@MiiNiPaa:
Well, I'm using Qt and so I need to include e.g. the Qt5Core.dll in mingw_32/bin. So what I tried was:
1
2
3
g++ -static -Qt5core.dll
g++ -static -libQt5Core
g++ -static -static-libQt5Core
Nothing works. I also have a folder mingw_32/lib, where all those Qt5 libs are in static ".a" format, and I also include them:
g++ -LD:/Qt/mingw_32/lib -lqt5core
So why does it still say:
"Missing Qt5Core.dll"
when I try to run it on another system??
Maybe you could just use static libs:
http://qt-project.org/doc/qt-5/windows-deployment.html
But that is what I do, I only include the wanted .dll files as lib files:
- Qt5Core.a
- Qt5Gui.a
- Qt5Widgets.a

Why does compiler still link against the shared libraries, too ?
Hi again,
so far, I know a little bit more about the functionallity of:
FileInstall, source, dest
It uses windows resource system to add files (http://msdn.microsoft.com/en-us/library/windows/desktop/ms648008%28v=vs.85%29.aspx#_win32_Updating_Resources). After checking the source of AHK, I found three functions that were needed:
- BeginUpdateResource
- UpdateResource
- EndUpdateResource

My problem now is, I don't understand how that works.. If I guess right, BeginUpdateResource() is needed to get information about the executable, which will be extended. UpdateResource() is needed to embed the files into the executable, and what EndUpdateResource() is used for.. no clue.

What I still don't really understand is the concept of this.. The functions embed data to the executable, but how does the executable calls and exports those files while runtime?
Remember:
FileInstall, source, dest
How das UpdateResource() tell the executable, that the embedded resource has to be exported to dest (path where it should be exported to after running the program)?

Does anybody know a little bit about this?
Last edited on
Topic archived. No new replies allowed.