Compilation and windows version

Discussions related to using the OSE version of VirtualBox.

Compilation and windows version

Postby Rankin » 5. Nov 2009, 12:02

Hello,

I successfully compiled the 3.0.8 version under Windows XP SP3 with Visual Studio 2005. I used it under the same OS, and also with 2 machines with Vista and 7. But I tried to install it on a XP machine with SP2 and it doesn't work. I got the message "the application failed to initialize properly (0xc0150002)". Is there a problem because I compiled under a more recent version, or do I need to install the .NET framework ?
I had the same problem with an application of mine that I compiled under Vista and didn't work under XP SP3 before I compiled it with this system.

Do I need to set an option or something in Visual Studio in order to make the application compatible with previous Windows version ?

Thank you for your answers !
Rankin
 
Posts: 32
Joined: 25. May 2009, 18:24
Primary OS: MS Windows XP
VBox Version: OSE self-compiled
Guest OSses: Linux Debian Lenny

Re: Compilation and windows version

Postby mpack » 6. Nov 2009, 23:28

My bet is that it isn't VBox that has the dependency, it's something your Visual Studio code is doing - looking for some runtime DLL that only ships with VS2K5 perhaps. Is VS2K5 installed on the other PC? I'm not saying it should be, I'm saying that my guess is wrong if it is.
mpack
Volunteer
 
Posts: 957
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Compilation and windows version

Postby Rankin » 9. Nov 2009, 10:20

Those are the PCs I tried to install VBox into :

Windows XP SP3 with Visual Studio 2005 (the one I use for the compilation) : it works
Windows Vista Family with VS 2005 : it works
Windows 7 (beta version) without VS 2005 : it works
Windows XP SP1 without VS 2005 : it doesn't work.

Due to the kind of error, it might be a missing dll ? How could I do to know which one it could be ?
Rankin
 
Posts: 32
Joined: 25. May 2009, 18:24
Primary OS: MS Windows XP
VBox Version: OSE self-compiled
Guest OSses: Linux Debian Lenny

Re: Compilation and windows version

Postby MarkCranness » 9. Nov 2009, 11:54

Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)
The Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) installs runtime components of Visual C++ Libraries required to run applications developed with Visual C++ on a computer that does not have Visual C++ 2005 installed.
MarkCranness
Volunteer
 
Posts: 242
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Windows 2000 Server

Re: Compilation and windows version

Postby Rankin » 9. Nov 2009, 12:04

Thank you ! I'll try it.
How do you explain that it works on Windows 7 although VS is not installed ?
Rankin
 
Posts: 32
Joined: 25. May 2009, 18:24
Primary OS: MS Windows XP
VBox Version: OSE self-compiled
Guest OSses: Linux Debian Lenny

Re: Compilation and windows version

Postby MarkCranness » 9. Nov 2009, 12:31

The MS quote is a little bogus: Other programs can install the DLLs to Windows\system32 or Windows\WinSxS\blah.
Search for MSVCR80.dll, and you will no doubt find it somewhere under \Windows.
MarkCranness
Volunteer
 
Posts: 242
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Windows 2000 Server

Re: Compilation and windows version

Postby Rankin » 9. Nov 2009, 12:43

Thank you again !
Rankin
 
Posts: 32
Joined: 25. May 2009, 18:24
Primary OS: MS Windows XP
VBox Version: OSE self-compiled
Guest OSses: Linux Debian Lenny

Re: Compilation and windows version

Postby mpack » 9. Nov 2009, 13:29

I suggest you recompile with the static runtime linking option. I have no idea why they default to the DLL runtime - it's a pain and just asks for these problems.
mpack
Volunteer
 
Posts: 957
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Compilation and windows version

Postby Rankin » 9. Nov 2009, 13:41

Good idea, but how must I do to do so ?
Rankin
 
Posts: 32
Joined: 25. May 2009, 18:24
Primary OS: MS Windows XP
VBox Version: OSE self-compiled
Guest OSses: Linux Debian Lenny

Re: Compilation and windows version

Postby mpack » 9. Nov 2009, 16:34

Rankin wrote:Good idea, but how must I do to do so ?

For a command line build, I don't know. Inside the Visual Studio IDE you select Project | <app> Properties | Config Properties | C/C++ | Code Generation, then change the runtime library selection to "Multi-threaded (/MT)" (i.e. don't use any of the DLL runtime library offerings).
mpack
Volunteer
 
Posts: 957
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Compilation and windows version

Postby Rankin » 9. Nov 2009, 18:27

Thanks for your piece of advice, it's a good thing to know. I'll try to find how to use it with the command line build and if I find it, I'll post it here. If anybody knows, feel free to tell it anyway ! ;)
Rankin
 
Posts: 32
Joined: 25. May 2009, 18:24
Primary OS: MS Windows XP
VBox Version: OSE self-compiled
Guest OSses: Linux Debian Lenny

Re: Compilation and windows version

Postby mpack » 9. Nov 2009, 19:12

Rankin wrote:I'll try to find how to use it with the command line build

Duh... it turns out to have been staring me in the face. The "(/MT)" bit that I quoted earlier is telling us what the equivalent command line option is. So, look in your build scripts for "/MTd" (multithreaded nondebug runtime DLL) or "/MDd" (multithreaded debug runtime DLL) and simply knock that trailing 'd' off the end to get the equivalent statically linked version.
mpack
Volunteer
 
Posts: 957
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Compilation and windows version

Postby Rankin » 10. Nov 2009, 10:51

I can't find those directives in the build files of VBox :/ It should be in the makefile I guess ?
Rankin
 
Posts: 32
Joined: 25. May 2009, 18:24
Primary OS: MS Windows XP
VBox Version: OSE self-compiled
Guest OSses: Linux Debian Lenny

Re: Compilation and windows version

Postby MarkCranness » 10. Nov 2009, 11:43

AFAIK, the /MT directive outs the C++ runtimes into EACH exe or DLL that the compiler/linker creates, so if you have 10, that's overhead times 10. For a single EXE, its an OK idea, but not so good when there are multiple executables.
MarkCranness
Volunteer
 
Posts: 242
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Windows 2000 Server

Re: Compilation and windows version

Postby mpack » 10. Nov 2009, 12:01

Are you that short of disk space? Who cares about a few extra Kb of data in a 20MB application? Certainly not me, and certainly not when the alternative is DLL hell.

And incidentally my advice was wrong before. The basic alternatives are "/MT" and "/MD", the former being the static linked runtime, the latter the DLL version. Adding little 'd' to either, ie. "/MTd" gives you the debug version of the same library.
mpack
Volunteer
 
Posts: 957
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Next

Return to VirtualBox OSE

Who is online

Users browsing this forum: No registered users and 2 guests