i dont like microsoft...

Get answers to all your basic programming questions. No Ogre questions, please!
Post Reply
onEnterFrame
Gnoblar
Posts: 8
Joined: Thu Dec 09, 2010 6:59 am

i dont like microsoft...

Post by onEnterFrame »

i've been doing OGRE for a week now and everything is finally going smoothly with the program itself, but microsoft .dll problems keep tripping me up.

i dont want to do any fancy build distribution but i want to be able to have people look at the project without installing a bunch of msvcp .dlls.
i cant even give them the .dlls myself because the folder that indicates their location in redist.txt isnt even there!

is it possible to supplant the microsoft standard C libraries with something more generic like BSD or GNU? will it work the same way?

thanks in adv...
User avatar
so0os
Bugbear
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: i dont like microsoft...

Post by so0os »

these are an integral part of windows since Vista (msvcr80 and msvcr70) and & (msvcr90). If you don't want it, use MSVC 6.0 (i use it for that purpose) and / or MinGW
Sos Sosowski :)
http://www.sos.gd
User avatar
Fish
Greenskin
Posts: 131
Joined: Fri Aug 22, 2008 6:12 pm

Re: i dont like microsoft...

Post by Fish »

If you expect to distribute an executable that is built with a recent Microsoft compiler, then you'll need to make sure that the user has the correct runtime libraries that are compatible with your build. It's not hard. Do a Google search for "Microsoft Visual C Redistributable Package", pick the compiler you use, d/l the package, and use your installer to run the Redistributable Package on the users machine.

Otherwise you'll have to use MinGW and include its runtime library with your executable.
onEnterFrame wrote:is it possible to supplant the microsoft standard C libraries with something more generic like BSD or GNU? will it work the same way?
Are you trying to make things easier or harder? <--rhetorical question, no need to answer that

- Fish
User avatar
so0os
Bugbear
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: i dont like microsoft...

Post by so0os »

MinGW uses msvcrt.dll, VC 6 too. It's standard since windows 98 (or 2000), so no external deps.

EDIT: there's a dirty trick of using Windows DDK to link against msvcrt.dll in newer versions of visual studio, but it's a hell of work, and I believe, you need to be a recognised Microsoft dev since recently to obtain that.
Sos Sosowski :)
http://www.sos.gd
onEnterFrame
Gnoblar
Posts: 8
Joined: Thu Dec 09, 2010 6:59 am

Re: i dont like microsoft...

Post by onEnterFrame »

thanks for your replies soos. i have minGW lying around somewhere from when i installed eclipse so i might test using that at some point.

fish, a help forum is an odd place to condescend to people.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: i dont like microsoft...

Post by jacmoe »

Did you notice that VC10 has gone back to the good old days of xcopy installation?
Just copy the runtime dll over and that's it.
Sort of makes this discussion slightly obsolete, doesn't it?

If you wonder where the dll is, look in your windows/System32 directory:

Code: Select all

msvcp100.dll
msvcr100.dll
I can't remember which one you're supposed by copy over. Sorry. :wink:
Haven't tried it yet as I'm waiting for the (slow) Qt developers to finally support vc10.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
onEnterFrame
Gnoblar
Posts: 8
Joined: Thu Dec 09, 2010 6:59 am

Re: i dont like microsoft...

Post by onEnterFrame »

so i can just put it in the same folder? oddly ive been meaning to test that theory out but nobody wants to try it anymore after the first test wouldnt work due to dlls. :P

ill make a build and try that at work today anyway.
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: i dont like microsoft...

Post by mkultra333 »

I've been ignoring this issue myself, since I'm a long way from distributing my project, but it hovers on the horizon and makes me nervous.

I'm building using VS9 on XP sp3. My understanding is that I just need to tell people to download and run the Microsoft Visual C++ 2008 Redistributable Package, or run it myself as part of an installer. One complicating factor is that there appear to be at least 3 different versions.

Microsoft Visual C++ 2008 Redistributable Package (x86)
Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)
Microsoft Visual C++ 2008 Redistributable Package (x64)

God forbid they should make it simple. If a person with a 64 bit system used the x86 package, or someone with sp3 uses the sp1 package, or vice versa, will their computer explode?
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: i dont like microsoft...

Post by jacmoe »

I seriously loathe that they did that. :)
The Ogitor installer is running two redist installers in sequence..
I am really looking forward to just doing a plain xcopy. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
marty9063

Re: i dont like microsoft...

Post by marty9063 »

I am with you, I have been done with Microsoft for some time now. I use a mac for most of my work stuff, but find Linux really interesting too. I just wish that Linux would get up to speed with their apps. Does anyone else out there use Linux? What do you think?
cdreid
Gnoblar
Posts: 20
Joined: Sat Dec 18, 2010 4:51 pm

Re: i dont like microsoft...

Post by cdreid »

Linux is great and aweful. It's a programmers os to be honest. How many of you would code something entirely from the command line in windows. OR macos. There are only two downsides to linux. You have an extremly limited user/customer-base. And parts of linux are very badly done. Xwindows last i looked being a major culprit.
As far as linux getting "up to speed with their apps" there is no "they". You become a kernel programmer for linux by submitting code and it being accepted by the community. Having said that if it is an MS app linux probably has a clone.

If you want to try out linux just google doslinux. Heck you can even run it in a virtual machine. Requires no changes.

To the OP etc. Can i suggest: Dont worry about it. Microsoft has decades of horrific coding, bad management and no concern for their userbase or coderbase behind them. Ive been where yo uare and the best thing is to worry about it when you're ready to release. At THAT point i'd reccomend using a professionally done third party installer. It was a nagging annoyance to me back in the d ay but at the end working around microsoft stupidity re dll's etc was nothing compared to battling their api's, visual studio and the 300 times they break their own systems within a year. If i remember correctly we were working on an early mmorpg and they broke directx 4 times in one year. There was much screamaing and cursing of firstborn.
User avatar
GantZ
Kobold
Posts: 33
Joined: Thu Jan 31, 2008 9:23 pm
Location: France

Re: i dont like microsoft...

Post by GantZ »

you can use xcopy deployment with vc2008 : http://msdn.microsoft.com/en-us/library ... S.90).aspx see the section "Deploying Visual C++ library DLLs as private assemblies".

usually, i deploy my app with these dlls :

msvcm90.dll
msvcp90.dll
msvcr90.dll

and you need the manifest related to the redist version

Microsoft.VC90.CRT.manifest.

You have to use the exact version of the crt used to compile your program (for ex, use the 9.0.21022.8 version if you compile with the vs RTM version).

This is not a solution without risk (see the comments in the link i posted), but it's the best i found to avoid installing the redist.
mogre community irc channel at : irc://freenode/#mogre

Image
SamJ
Halfling
Posts: 40
Joined: Tue Jan 25, 2011 9:12 pm

Re: i dont like microsoft...

Post by SamJ »

Sorry to hijack but since I read from somebody on this topic that you only need to copy dlls on vc2010 (which is awesome) I've been trying to look for confirmation from an official source because it seems surprising to me that the same dll works the same for 32bit and 64bit systems (among other concerns, but I'm clueless so it wouldn't surprise me that much). I found nothing on msdn (the xcopy section is only available for vc2005 and vc2008) or by googling. So, does anybody remember where they learnt this from?

EDIT: Ok, it's not from Microsoft but found this: http://mariusbancila.ro/blog/2010/03/24 ... vc-part-5/ msdn deployment docs for vc2010 don't mention this, I guess Microsoft doesn't want to encourage this so that they can update the dlls.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: i dont like microsoft...

Post by jacmoe »

Take a look at this:
http://msdn.microsoft.com/en-us/library/zebw5zk9.aspx
Especially this:
http://msdn.microsoft.com/en-us/library/8kche8ah.aspx
And that:
http://msdn.microsoft.com/en-us/library/ms235316.aspx
The last link contains this information:
Install a particular Visual C++ DLL in the same folder as the application by using files provide in the Program Files\Microsoft Visual Studio 10.0\VC\Redist directory. This way is recommended to enable installation of applications by users who do not have administrative rights or when it should be possible to run an application from a share.
HTH. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
SamJ
Halfling
Posts: 40
Joined: Tue Jan 25, 2011 9:12 pm

Re: i dont like microsoft...

Post by SamJ »

Oh thanks. I have read all those links, it's only that paragraph on the third link I missed.

Anyway, that folder (Program Files\Microsoft Visual Studio 10.0\VC\Redist) doesn't exist for me, I have vc2010 express. I could get the dlls from my system32 directory, but again, I have no idea of knowing if that is OK (maybe the ones I got installed are optimized for 64 bits or something).
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: i dont like microsoft...

Post by jacmoe »

Taking them from your system directory is alright. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
yzt
Halfling
Posts: 98
Joined: Wed Dec 28, 2005 7:43 am
x 2
Contact:

Re: i dont like microsoft...

Post by yzt »

This might be slightly late and slightly off-topic, but I think it is related.

There is a free (as in beer) tool called Dependency Walker that can help eliminate the guesswork in determining what DLLs are actually needed by another EXE or DLL. Basically, if you can run your application on your own system, you just use this tool to find out all the DLLs your application needs and ship them with it.

There are a few things to consider:
  • As has already been covered in this topic, some versions of VC need quite a lot more work that that (Egads, I'm happy to see that even Microsoft got tired of WinSXS or whatever it was and dropped it in VC10.)
  • In the default setup of Visual Studio projects, when you run the application from within the IDE, the working directory is not the same directory that your executable is placed in. You should keep that in mind.
  • When opening an EXE in the Dependency Walker, it gives a large tree of what DLL is needed by your application, and what DLLs are needed by those DLLs, and so on. In practice, all the DLLs deeper in the tree are system DLLs that are going to be present, and you should NOT bundle them with you app anyway. Most of the time, you just need to look at the first 2 or 3 levels of dependencies from your EXE down to work out what you need to distribute with your application.
  • Obviously, a tool such as this cannot determine the DLLs that your application might or might not load at run-time (for example, OGRE plug-ins.)
  • By the way, IIRC, this tool used to be shipped with Visual Studio 6 (which I still feel nostalgic about) but not the later versions. Another "thank you" from the bottom of our hearts goes out to MS for that.
In all probability this might be common knowledge for everybody around here, and I apologize for wasting everybody's time and bandwidth.
Do not meddle in the affairs of Wizards, for they are subtle and quick to anger.
My useless rants
The company I work for (Dead Mage)
The first game we made (Garshasp: The Monster Slayer)
Post Reply