Question

So I am new to windows and this might be a very noob question.

I have to create an exe application which will eventually run on another system. In the project, I am required to use external gdal library which I compiled using visual studio. As I understand this will create a dll file for gdal which I will refer to in my application by including it. Now, can I transfer this file over to another system as well (I doubt this)??

I am actually participating in some competition which requires me to run my application in the minimum time possible. It will run via command line which will simply take some command line arguments. So will I be able to use this external dll file in any way??

Was it helpful?

Solution

If you are building you DLL on one Windows PC and your program works there, of course you can copy the exe and the DLL to another Windows PC and run it there.

You might get problems if the Windows differs. If you build for an x64 system and the target system is a 32 bit system, your program won't run. Also if you explicitly build for Windows 7 your program might not run on an older Windows. This is especially true for Visual Studio 2013 which by default only generates code for Windows 7 minimum.

So when building the program you might need to set the project/build settings according to your target machine.

When copying the exe and the DLL you need to put them in the same folder. You might also need to add Visual Studio DLLs like the C(++) runtime DLL. You'll find these in the VC\redist folder in the Visual Studio installation folder.

OTHER TIPS

From visual studio select the publish wizard this will package your program along with any required libraries.

In the publish options you can set which version of Windows you wish to compile for(as I remember).

You then simply run the executable in your package folder on the target machine and it'll install.

Google visual studio publish wizard there's plenty of information there.

Yes, you can run exe/dll files in another Windows machine with the same CPU - 32 or 64 bit.

Windows will seek dll first in the path of the executable, then in all paths, specified in PATH environment variable. So, put exe and dll in one directory when deploy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top