dspencer
|
|
« on: November 30, 2009, 04:13:53 PM » |
|
Hi I'm working on a cross platform project, and everything seemed to be going well - I could build my project on both Windows and Mac with very few problems, and functionally they worked. However, after being able to build and run my program on my windows machine (via parallels) I tried to send my program to my friend, and she couldn't open it because of a side by side error.
I can't link my program statically because of my need to link to SDL/opengl. I've tried including the runtime library that my version of VC++ is using, but it doesn't fix anything. Does anyone know of a fix that doesn't involve the end user having to run an installer or compile anything on their own computer?
Thanks!
edit: clarified things
|
|
« Last Edit: November 30, 2009, 06:27:40 PM by dspencer »
|
Logged
|
|
|
|
Martin 2BAM
|
|
« Reply #1 on: November 30, 2009, 05:04:14 PM » |
|
Your friend uses Windows? Apparently you're using MSVC ( >VC6 I hope ) I suggest you static compile the Common Runtime Libraries (CRT). You might need to recompile SDL, even if you're using it as a DLL (this has nothing to do with static linking to SDL). I had a shitload of problems with MSVC on that field. Perhaps you can try that. You might also want to check his graphic driver version, as those come with the needed OpenGL libraries, and need to be installed so everything works properly. -Regards
|
|
|
Logged
|
|
|
|
dspencer
|
|
« Reply #2 on: November 30, 2009, 08:49:21 PM » |
|
Hrm. I was unaware I could statically link to SDL, because when I tried to it gave me some linker errors. But upon some research, it appears that you can! Thank you for the tip. I'll see if it works when I next get the chance; for now, I'll just cross my fingers. My concern wasn't really this particular computer, but computers in general, given that I can't test all that many to make sure. Thanks for the help!
|
|
|
Logged
|
|
|
|
Martin 2BAM
|
|
« Reply #3 on: November 30, 2009, 11:09:20 PM » |
|
No problem, but I wasn't talking about static linking to SDL. I think the GPL license has something against it. I'm talking about the microsoft "guts", the CRT... somewhere in the project properties you must select "Multithreaded" instead of "Mutlithreaded DLL" (Cant remember if it was at compiler or linker sub sections". Read the rant here by this "Magnus Norddahl" guy, it might help you a bit. http://www.rtsoft.com/forums/archive/index.php/t-1607.htmlIt talks about SxS errors as well. Regards
|
|
|
Logged
|
|
|
|
Robotacon
|
|
« Reply #4 on: November 30, 2009, 11:29:47 PM » |
|
Thank you very much for this information. I've had problems relating to this as well but couldn't quite wrap my head around what was wrong.
|
|
|
Logged
|
|
|
|
dspencer
|
|
« Reply #5 on: November 30, 2009, 11:45:21 PM » |
|
No problem, but I wasn't talking about static linking to SDL. I think the GPL license has something against it. I'm talking about the microsoft "guts", the CRT... somewhere in the project properties you must select "Multithreaded" instead of "Mutlithreaded DLL" (Cant remember if it was at compiler or linker sub sections". Read the rant here by this "Magnus Norddahl" guy, it might help you a bit. http://www.rtsoft.com/forums/archive/index.php/t-1607.htmlIt talks about SxS errors as well. Regards Right - I didn't think I could do this because it gave me those errors with linking to SDL when I changed that setting.
|
|
|
Logged
|
|
|
|
Martin 2BAM
|
|
« Reply #6 on: December 01, 2009, 01:37:53 AM » |
|
Oh, ok Yeah, the problem is Microsoft (what a surprise). That manifest-SxS shit is one step forward and two steps back. I also had this problem a long time ago. There is another solution (I do not recommend), that's adding a lot of manifests and including two CRT dlls with your app: The latest to which your app was compiled and the version to which SDL was compiled (yes, it's EULA-happy). (I had to do this when using SDL-VC8 with a game in VC9) I switched to "static-linking as much as possible" from that point forward Luckily SFML license is ok with static-linking and I switched to it, so no more shitty linking problems on Windows. Regards and good luck!
|
|
|
Logged
|
|
|
|
Ivan
Owl Country
Level 10
alright, let's see what we can see
|
|
« Reply #7 on: December 01, 2009, 09:44:06 AM » |
|
One solution is to use MingW for compiling your stuff, which always links the CRT statically, while still allowing you to link dynamic libraries.
|
|
|
Logged
|
|
|
|
Martin 2BAM
|
|
« Reply #8 on: December 01, 2009, 11:52:06 AM » |
|
But if you use the SDL dll, you'll still have to ship the CRT dlls to which it was linked against (you have to find them first, and that sucks balls :D)
|
|
|
Logged
|
|
|
|
powly
|
|
« Reply #9 on: December 01, 2009, 11:58:13 AM » |
|
I'm using MinGW and SDL as a dll and never ever seen a CRT dll. But I have seen the name in countless error popups when VC++ people have failed to release their stuff properly
|
|
|
Logged
|
|
|
|
Ivan
Owl Country
Level 10
alright, let's see what we can see
|
|
« Reply #10 on: December 01, 2009, 12:40:15 PM » |
|
Yeah, i think that most dlls dont actually require a CRT, unless im gravely mistaken.
|
|
|
Logged
|
|
|
|
Garthy
|
|
« Reply #11 on: December 08, 2009, 03:10:21 PM » |
|
I've recently ported my code to build with MSVC++ 8, and as part of this I directly built every external library I planned to use, being extremely careful to always select the same runtime linking option (eg. either MT DLL Debug or MT DLL Release) for each. In my first attempt I didn't do that, and ran into countless problems. I also used Dependency Walker (free) to check my exes and DLLs to see which DLLs they were actually searching for. It appears to work fine, but who knows what it will be like out in the real world? In hindsight, maybe I should have looked at just statically linking the darn thing. nitram_cero: I enjoyed reading that rant, thankyou for the link.
|
|
|
Logged
|
|
|
|
|