Building a useable .exe

Started by
11 comments, last by Monkan 12 years, 8 months ago
Hi,

I've made a program in Visual Studio 2010 that I want to run on computers that don't necessarily have Visual Studio installed. Normally I go into the code generation settings for the project and change Multi-threaded DLL to Multi-threaded and it works in some magical way by compiling the needed Visual Studio files into the .exe.

I tried to do that this time and it comes up with various compile errors saying I'm redefining things. e.g

Error 58 error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj) C:\Users\Monkey\Desktop\VolcanoBlast\GLFWEmptyProject\MSVCRT.lib(MSVCR100.dll)

A quick google around seems to imply that it will be something to do with something I'm using in my project having been compiled with the settings set to Multi-threaded DLL and they suggest that everything should be set the same.

e.g. - LINK

My problem is I'm still not really sure what's causing this error, I presume it could be something like my GLFW.dll or my OpenAL.dll or something and I'm not sure how I would even begin remedying this problem. Or do I need to build my project with Multi-threaded DLL settings and include the VS distributable or MSVCR100.dll or somehting?

Please help.
Thank you.

"To know the road ahead, ask those coming back."

Advertisement
I'm curious to hear what others have to say, but I havn't been able to get Multi-threaded to link for quite some time. I instead use the DLL version and include vcredist.exe in the installer for the app.

vcredist.exe includes the necessary DLLs for the app to run and takes care of the dreaded Side-By-Side-Configuration-Error that comes up without it(and if VS is not installed)...
Cool, thanks for the reply BuffaloJ,

Where I might I procure this [color=#1C2837][size=2]vcredist.exe and will I need to link it to my solution somehow? Is there a website tutorial or something?
[color=#1C2837][size=2]

[color=#1C2837][size=2]Thanks

"To know the road ahead, ask those coming back."


Where I might I procure this [color="#1C2837"]vcredist.exe and will I need to link it to my solution somehow? Is there a website tutorial or something?


http://www.microsoft...ls.aspx?id=5555
np

They generally package it up with VisualStudio itself(not sure where), but you can DL it at:

x86:
http://www.microsoft.com/download/en/details.aspx?id=5555

or

http://www.microsoft.com/download/en/details.aspx?id=14632
for the 64 bit version...

keep in mind too, if you install vcredist.exe and it still gives the side-by-side error, then it's the wrong version. It has the be the one for your version of Visual Studio...
Thanks,

So I've downloaded that but now whenever I want someone else to be able to run my program they have to install that.

Is there anyway I can neaten it up a bit, so they just have to click an .exe because I quite liked how that worked before where you just click the application and it runs. There's no magical .dll I can include with my game so it just runs?
Or how would I go about creating an installer for my game and having this install at the same time? Because I have sounds, shader, script and texture files so I suppose it would be nice to have an installer that puts them all somewhere or something similar. Correct me if I'm just being naive.

Cheers

"To know the road ahead, ask those coming back."

I'd say just roll it into a full installer; I like NSIS personally.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

totally, an installer is a good idea. I'll have to check out NSIS. I've used INNO so far...it's free and easy. I just take an existing script and copy/paste/modify for new projects.
INNO allows you to just specify a folder and it will include all files and subfolders in the installer. It will setup icons and all that as well.


You can't just include the necessary Microsoft DLLs anymore...they have added the whole side-by-side stuff to support multiple hardware targets.
Ok Cool,

Thanks all, I'm having a look at NSIS now and have downloaded it.

Is it easy enough to get an NSIS installer to also run the VS2010 redist installer? Or how does that bit work?

Cheers.

"To know the road ahead, ask those coming back."


Ok Cool,

Thanks all, I'm having a look at NSIS now and have downloaded it.

Is it easy enough to get an NSIS installer to also run the VS2010 redist installer? Or how does that bit work?

Cheers.


You should be able to add a script line to the installer to run vcredist at some point during the install process and preferably wait until that install completes before continuing. There should also be a way to check to see if it's already installed and if so, skip it. Not a biggie, but a good polish item. I played a while back with trying to get vcredist to install silently (no dialog box or anything) and only got it partially working:(

This topic is closed to new replies.

Advertisement