Sign in to follow this  

visual studio 2005

This topic is 3025 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

#include <iostream> #include <winsock.h> using namespace std; int main() { SOCKET lol; cout << "lolz\n"; system("PAUSE"); return 0; } It works well on my computer but on my friends computer the program crashes. The following error occurs: This program could not start because the application configuration is incorrect. The problem may be corrected to if you reinstall the program. (translated from swedish to english) Very strange, please help :D thx!

Share this post


Link to post
Share on other sites
Hi, my friend installed the "Visual C++ 2005 Redistributable Package" but no success. The program still crashes for him, we've also checked which service pack version he have, SP3 for XP is the service pack he uses.

Do you have any other tips or something to point me in the right direction? thanks :P

Share this post


Link to post
Share on other sites
Did you actually use Visual Studio 2005? Not 2005 SP1 or 2008 or 2008 SP1...

Or just avoid the mess altogether, and link with static library instead of dll (the /MT switches, I think).

Share this post


Link to post
Share on other sites
I compiled the project with visual studio 2005 Professional Edition Version 8.0.50727.42 (RTM.050727-4200). Microsoft Visual Studio tell me I'm using Microsoft .NET Framwork Version 2.0.50727 SP2.

I used the link I've got from one of the earlier posts in this thread to install the redistributable packet, well I noticed that it was for 2008 but I didn't really think it would matter.

I did change from Multi-Threaded DLL (/MD) to Multi-Threaded (/MT), it didn't solve the problem thou.

These are my servicepacks installed:
Microsoft .Net Framework 1.0 SP3 Developer
Microsoft .Net Framework 2.0
Microsoft .Net Framework 3.5 SP1

My friend have these installed. I have them too.
Microsoft Visual C++ 2005 Redistributable
Microsoft Visual C++ 2008 Redistributable

Does my servicepack version change the outcome of the compile?
Should I patch my visual studio version?

Thanks for your help :)

[Edited by - ixuz on August 19, 2009 10:05:00 AM]

Share this post


Link to post
Share on other sites
There are service packs for Visual Studio, in addition to service packs for XP/Vista...

Your best bet is to create a deployment project (Setup Wizard) from within Visual Studio, and have your friend run the installer (he needs both the EXE and the MSI, because the EXE bootstraps dependencies). Also note that your application likely needs a manifest, which may or may not be automatically included for you depending on how you created the project.

To diagnose exactly what is missing, you can have your friend download the Dependency Walker, open your EXE, and look for DLLs marked yellow in the tree view on the left, and/or symbols marked red in the symbol list view.
www.dependencywalker.com.

Finally, the latest version of Visual Studio is 2008 SP1. If you're still using 2005, you're soon five years out of date (2010 is coming out soon).

Share this post


Link to post
Share on other sites
Okay, I'll try this, so you think I should quit using the visual studio 2005 and go for the visual studio 2008 until the 2010 is here? Will my problem still occur if I switch to visual studio 2008?

I would like to ask you, what is a manifest and what is it good for?

thanks

Share this post


Link to post
Share on other sites
Quote:
Original post by ixuz

I would like to ask you, what is a manifest and what is it good for?

thanks


A manifest is Microsoft's way of making it practically IMPOSSIBLE to distribute a project in the same way that you could with any VC compiler pre-2003. Basically there is a folder in the windows directory (WinSxS) holding various versions of runtimes required for most applications compiled with the C libraries (and probably .net, etc). I think it was supposed to make things like backward compatibility easy, as well as provide a common location for all runtimes for all versions of everything without each version having to distribute the files specific to the version of the compiler that was used to make it. In reality, it's just an extra hurdle, where you either link statically, include the manifest and runtimes in the installation directory and insert a custom manifest in your exe so it knows to use the local copies, or install the c runtimes on any machine you want to run the software on.

What it's good for? In reality, so far I have seen no benifits - only hinderences.

Share this post


Link to post
Share on other sites
Okay thank you for your reply, so I'll have to link a static library by linking a manifest and have the runtime dll's and such in order to make my program work without having to install the runtime files in the machine this program will run on.

What will I need to make my winsock2 project have a static library?
If you have any tips on how to link the manifest and get the correct files please tell me, thank you very much for the help.

// ixuz

Share this post


Link to post
Share on other sites
Quote:
Original post by Badgerr
A manifest is Microsoft's way of making it practically IMPOSSIBLE to distribute a project in the same way that you could with any VC compiler pre-2003.
What way was that? With every version of Visual Studio, if you're deploying the app properly, you need to install the Visual Studio redistributable package - If it worked before, then it was just luck (The runtimes were probably installed by some other application).

Quote:
Original post by Badgerr
Basically there is a folder in the windows directory (WinSxS) holding various versions of runtimes required for most applications compiled with the C libraries (and probably .net, etc). I think it was supposed to make things like backward compatibility easy, as well as provide a common location for all runtimes for all versions of everything without each version having to distribute the files specific to the version of the compiler that was used to make it. In reality, it's just an extra hurdle, where you either link statically, include the manifest and runtimes in the installation directory and insert a custom manifest in your exe so it knows to use the local copies, or install the c runtimes on any machine you want to run the software on.

What it's good for? In reality, so far I have seen no benifits - only hinderences.
Pretty much - it's so that you can have all sorts of versions of the CRT installed, and applications will use the correct one. This is usually less of an issue for home PCs, but if you were the IT guy deploying some new software onto your companies network, there was a chance that the new app would overwrite an older version of some CRT DLLs with newer ones, and break all of the applications that used the older one.

Share this post


Link to post
Share on other sites
Quote:
What it's good for? In reality, so far I have seen no benifits - only hinderences.


Manifests define what feature level of a given DLL that you're linking against. It's similar to how Linux uses "libwhatever.so.5" as a symlink to "libwhatever.so" (if you're lucky).

However, manifests additionally allow things like cross-versioning, where an application that uses custom controls version 4.7 can load a plug-in that uses custom controls version 6.0, even though custom controls version 6.0 is not a re-distributable, and is a different binary from 4.7.

In addition, manifests with system-managed side-by-side installation allows Microsoft to easily update/patch DLLs using Windows Update. I think they learned this when the gdiplus DLL problem hit -- scanning the entire disk for any DLL that might be a gdiplus DLL was not a pleasant experience for people applying updates...

It does solve some problems, and if you go through the half-hour to learn how to create a proper setup project (using merge modules for runtimes, etc), then the install/uninstall is very simple for the user. But a lot of developers, for some reason, would be happy to spend years learning how a compiler and a linker works, without spending a few hours learning how the main delivery vehicle for the platform works. I guess that's their choice, but then complaining isn't really warranted IMO.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Quote:
Original post by Badgerr
A manifest is Microsoft's way of making it practically IMPOSSIBLE to distribute a project in the same way that you could with any VC compiler pre-2003.
What way was that? With every version of Visual Studio, if you're deploying the app properly, you need to install the Visual Studio redistributable package - If it worked before, then it was just luck (The runtimes were probably installed by some other application).


The way we did it where I work (before everything moved to VS2005), we used VC6, and deploying the application was a case of putting our applications in a directory, copying the 3(?) msvc*.dll type files in, and running it through NSIS. It worked, and no one seemed to do it any other way.

Now we use 2005, we just bundle the vcredist.exe into the installer and exec it during install.

Quote:
Original post by hplus0603
Quote:
What it's good for? In reality, so far I have seen no benifits - only hinderences.


Manifests define what feature level of a given DLL that you're linking against. It's similar to how Linux uses "libwhatever.so.5" as a symlink to "libwhatever.so" (if you're lucky).

However, manifests additionally allow things like cross-versioning, where an application that uses custom controls version 4.7 can load a plug-in that uses custom controls version 6.0, even though custom controls version 6.0 is not a re-distributable, and is a different binary from 4.7.

In addition, manifests with system-managed side-by-side installation allows Microsoft to easily update/patch DLLs using Windows Update. I think they learned this when the gdiplus DLL problem hit -- scanning the entire disk for any DLL that might be a gdiplus DLL was not a pleasant experience for people applying updates...

It does solve some problems, and if you go through the half-hour to learn how to create a proper setup project (using merge modules for runtimes, etc), then the install/uninstall is very simple for the user. But a lot of developers, for some reason, would be happy to spend years learning how a compiler and a linker works, without spending a few hours learning how the main delivery vehicle for the platform works. I guess that's their choice, but then complaining isn't really warranted IMO.


I guess half an hour is better than what we currently do. All this stuff makes sense, maybe it's time to find out how to do it properly.

Share this post


Link to post
Share on other sites
oooh, I'm pretty lost now, I don't know where I should start. I may seem dumb but it seems like I need a step by step tutorial :(

The compiled solution is just containing the main() function and a cout. I can look up manifests more soon, but first of all I'd at least like to get my program to work.

My friend installed vcredist_x86 but the program still doesn't work, what's missing?

Share this post


Link to post
Share on other sites
New Project
-> Setup and Deploy Projects
-> Setup Wizard
-> Build project

This spits out a .exe and a .msi.

Put the .exe and the .msi in a directory on your web host, and link people to the .exe to install. The directory on the web host should be entered into project settings of the setup project, too (before building it).

If you don't want to use a web host, you can just make sure that the .exe and the .msi is in the same folder on the hard disk, and start the .exe, and it should use the .msi as-is (without downloading it).

By the way: We're still waiting for the output of the "dependency checker" tool I linked to above, from the machine that has the problem.

Share this post


Link to post
Share on other sites
Wow, thanks for the quick response! Okay I've done what you've said, I got an .exe file and a .msi file. I'm trying to contact my friend now so he can test the dependency checker, and what is this install doing, does it install the redist correctly?

Share this post


Link to post
Share on other sites
Quote:
Original post by hplus0603
It does solve some problems, and if you go through the half-hour to learn how to create a proper setup project (using merge modules for runtimes, etc), then the install/uninstall is very simple for the user. But a lot of developers, for some reason, would be happy to spend years learning how a compiler and a linker works, without spending a few hours learning how the main delivery vehicle for the platform works. I guess that's their choice, but then complaining isn't really warranted IMO.


To be fair, the documentation for setup and deployment is some of the worst that Microsoft has ever produced. It's a lot less frustrating studying how the compiler and linker works than trying to figure out how to do stuff with deployment projects.

Share this post


Link to post
Share on other sites
Okay, I'm aware that this problem isn't related to winsock, it seems like the project configuration is the problem. My friend have tested my program with the dependency walker, this is the results:

Logfile
Quote:

*****************************| System Information |*****************************

Dependency Walker: 2.2.6000 (32-bit)
Operating System: Microsoft Windows XP Professional (32-bit)
OS Version: 5.01.2600 Service Pack 2
Processor: x86 Family 6 Model 15 Stepping 11, GenuineIntel, ~2399MHz
Number of Processors: 4, Mask: 0x0000000F
Computer Name: P
User Name: Pe
Local Date: 01 September 2009
Local Time: 12:38:45 AM Västeuropa, normaltid (GMT+02:00)
OS Language: 0x041D: Swedish
Memory Load: 62%
Physical Memory Total: 2,145,824,768 (2047 MB)
Physical Memory Used: 1,336,606,720
Physical Memory Free: 809,218,048
Page File Memory Total: 4,130,246,656
Page File Memory Used: 1,318,957,056
Page File Memory Free: 2,811,289,600
Virtual Memory Total: 2,147,352,576
Virtual Memory Used: 53,174,272
Virtual Memory Free: 2,094,178,304
Page Size: 0x00001000 (4,096)
Allocation Granularity: 0x00010000 (65,536)
Min. App. Address: 0x00010000 (65,536)
Max. App. Address: 0x7FFEFFFF (2,147,418,111)

********************************| Search Order |********************************
* *
* Legend: F File E Error (path not valid) *
* *
********************************************************************************

Side-by-Side components (Windows 2000/XP/2003/Vista/+)
The system's "KnownDLLs" list
[F ] c:\windows\system32\ADVAPI32.DLL
[F ] c:\windows\system32\APPHELP.DLL
[F ] c:\windows\system32\COMCTL32.DLL
[F ] c:\windows\system32\COMDLG32.DLL
[F ] c:\windows\system32\CRYPT32.DLL
[F ] c:\windows\system32\CRYPTUI.DLL
[F ] c:\windows\system32\GDI32.DLL
[F ] c:\windows\system32\IMAGEHLP.DLL
[F ] c:\windows\system32\KERNEL32.DLL
[F ] c:\windows\system32\LZ32.DLL
[F ] c:\windows\system32\MPR.DLL
[F ] c:\windows\system32\MSASN1.DLL
[F ] c:\windows\system32\MSVCRT.DLL
[F ] c:\windows\system32\NETAPI32.DLL
[F ] c:\windows\system32\NTDLL.DLL
[F ] c:\windows\system32\OLE32.DLL
[F ] c:\windows\system32\OLEAUT32.DLL
[F ] c:\windows\system32\OLECLI32.DLL
[F ] c:\windows\system32\OLECNV32.DLL
[F ] c:\windows\system32\OLESVR32.DLL
[F ] c:\windows\system32\OLETHK32.DLL
[F ] c:\windows\system32\RPCRT4.DLL
[F ] c:\windows\system32\SHDOCVW.DLL
[F ] c:\windows\system32\SHELL32.DLL
[F ] c:\windows\system32\SHLWAPI.DLL
[F ] c:\windows\system32\URL.DLL
[F ] c:\windows\system32\URLMON.DLL
[F ] c:\windows\system32\USER32.DLL
[F ] c:\windows\system32\USERENV.DLL
[F ] c:\windows\system32\VERSION.DLL
[F ] c:\windows\system32\WININET.DLL
[F ] c:\windows\system32\WINTRUST.DLL
[F ] c:\windows\system32\WLDAP32.DLL
[F ] c:\windows\system32\WOW32.DLL
The application directory
[ ] C:\Documents and Settings\Pe\Mina dokument\Mina mottagna filer\debugThe 32-bit system directory
[ ] C:\WINDOWS\system32The 16-bit system directory (Windows NT/2000/XP/2003/Vista/+)
[ ] C:\WINDOWS\systemThe system's root OS directory
[ ] C:\WINDOWSThe application's registered "App Paths" directories
The system's "PATH" environment variable directories
[ ] C:\WINDOWS\system32 [ ] C:\WINDOWS [ ] C:\WINDOWS\System32\Wbem [ ] C:\Program\Delade filer\Adobe\AGL [ ] C:\Program\QuickTime\QTSystem
***************************| Module Dependency Tree |***************************
* *
* Legend: F Forwarded Module ? Missing Module 6 64-bit Module *
* D Delay Load Module ! Invalid Module *
* * Dynamic Module E Import/Export Mismatch or Load Failure *
* ^ Duplicate Module *
* *
********************************************************************************

[ ] c:\documents and settings\pe\mina dokument\mina mottagna filer\debug\WINSOCK BUGFINDING.EXE
[ ] c:\documents and settings\pe\mina dokument\mina mottagna filer\debug\MSVCP80D.DLL
[ ^ ] c:\documents and settings\pe\mina dokument\mina mottagna filer\debug\MSVCR80D.DLL
[ ^ ] c:\windows\system32\KERNEL32.DLL
[F^ ] c:\windows\system32\NTDLL.DLL
[ ] c:\documents and settings\pe\mina dokument\mina mottagna filer\debug\MSVCR80D.DLL
[ ] c:\windows\system32\MSVCRT.DLL
[ ^ ] c:\windows\system32\KERNEL32.DLL
[F^ ] c:\windows\system32\NTDLL.DLL
[ ] c:\windows\system32\NTDLL.DLL
[ ^ ] c:\windows\system32\KERNEL32.DLL
[F^ ] c:\windows\system32\NTDLL.DLL
[ ] c:\windows\system32\KERNEL32.DLL
[ ^ ] c:\windows\system32\NTDLL.DLL
[F^ ] c:\windows\system32\NTDLL.DLL

********************************| Module List |*********************************
* *
* Legend: D Delay Load Module ? Missing Module 6 64-bit Module *
* * Dynamic Module ! Invalid Module *
* E Import/Export Mismatch or Load Failure *
* *
********************************************************************************

Module File Time Stamp Link Time Stamp File Size Attr. Link Checksum Real Checksum CPU Subsystem Symbols Preferred Base Actual Base Virtual Size Load Order File Ver Product Ver Image Ver Linker Ver OS Ver Subsystem Ver
----- ------------------------------------------------------------------------------------------- ----------------- ----------------- --------- ----- ------------- ------------- --- --------- ------- -------------- ----------- ------------ ---------- ------------- ------------- --------- ---------- ------ -------------
[ ] c:\documents and settings\pe\mina dokument\mina mottagna filer\debug\MSVCP80D.DLL 01/02/2009 02:05p 23/09/2005 08:46a 1,028,096 A 0x0010AE15 0x0010AE15 x86 GUI CV 0x10480000 Unknown 0x000FC000 Not Loaded 8.0.50727.42 8.0.50727.42 0.0 8.0 4.0 4.0
[ ] c:\documents and settings\pe\mina dokument\mina mottagna filer\debug\MSVCR80D.DLL 29/06/2007 03:07a 23/09/2005 08:44a 1,171,456 A 0x00125902 0x00125902 x86 GUI CV 0x10200000 Unknown 0x00120000 Not Loaded 8.0.50727.42 8.0.50727.42 0.0 8.0 4.0 4.0
[ ] c:\documents and settings\pe\mina dokument\mina mottagna filer\debug\WINSOCK BUGFINDING.EXE 19/08/2009 02:32a 19/08/2009 02:32a 45,056 A 0x00000000 0x0000C4C0 x86 Console CV 0x00400000 Unknown 0x0001B000 Not Loaded N/A N/A 0.0 8.0 4.0 4.0
[ ] c:\windows\system32\KERNEL32.DLL 04/08/2004 01:33a 04/08/2004 10:33a 997,376 A 0x0010308A 0x0010308A x86 Console CV 0x7C800000 Unknown 0x000F8000 Not Loaded 5.1.2600.2180 5.1.2600.2180 5.1 7.10 5.1 4.0
[ ] c:\windows\system32\MSVCRT.DLL 04/08/2004 01:33a 04/08/2004 10:34a 343,040 A 0x00060743 0x00060743 x86 GUI CV 0x77C00000 Unknown 0x00058000 Not Loaded 7.0.2600.2180 6.1.8638.2180 5.1 7.10 5.1 4.0
[ ] c:\windows\system32\NTDLL.DLL 04/08/2004 01:33a 04/08/2004 10:33a 712,704 A 0x000BB654 0x000BB654 x86 Console CV 0x7C900000 Unknown 0x000B2000 Not Loaded 5.1.2600.2180 5.1.2600.2180 5.1 7.10 5.1 4.10

************************************| Log |*************************************

Error: The Side-by-Side configuration information for "c:\documents and settings\pe\mina dokument\mina mottagna filer\debug\WINSOCK BUGFINDING.EXE" contains errors. Det hr programmet kunde inte starta eftersom programmets konfiguration r felaktig. Problemet kanske kan rttas till om du installerar om programmet (14001).




Error message
Quote:

Error: The Side-by-Side configuration information for "c:\documents and settings\pe\mina dokument\mina mottagna filer\debug\WINSOCK BUGFINDING.EXE" contains errors. This program could not start because the program configuration is wrong. The problem may be corrected if you install the software (14001).


Any ideas?
Thanks in advance // ixuz

Share this post


Link to post
Share on other sites
It looks as if you're trying to distribute a debug version of your application. You can't do that - the runtime redist doesn't include the debug version of the runtime.

Try recompiling your program in "Release" mode and try again.

Share this post


Link to post
Share on other sites
Thank you for your post, me and my friend just realised that the release version worked but not the debug version, I googled some stuff and found out I should change my project settings to /MTd (multi-threaded debug), this almost made my debug work, I changed my project from "precompiled header" to "empty project" after that it worked.

Thank you all for the help.

Now onto some networking programming, I did host a server and my friend used the client join, but no pings was received. I don't know why it didn't work and I'm very sure that the port I was hosting on was forwarded. He tried to connect to my ip which I gotten from this site: www.ip-adress.com/

The server/client network works well on the same machine and also on LAN, but now when we tested over the internet it didn't really work.

Help? ^^ thank you very much for everything!

Share this post


Link to post
Share on other sites
blocked by firewall? If the port was forwarded and the IP is correct, that should work. Welcome to the wonderful world of the Internet.

Share this post


Link to post
Share on other sites
Neither of us have any firewall. I used the port 6112 which blizzard uses for their networks, I've forwarded that port to enable me hosting on blizzards battle.net, does the website give wrong ips?

edit: I've tested 4 different sites, all of them are giving me that same ip.

Share this post


Link to post
Share on other sites
If you run "ipconfig" on the machine that is the server, what is the IP address? If the IP address starts with 192.168. or 10. (or a few others), then that's a "private address" and you actually have a NAT firewall/router on your network. Even if you port forward through a NAT firewall/router, ping will not be forwarded, because ping doesn't use a "port." You'll have to "protocol forward" the ICMP protocol, which may or may not be supported on your NAT router/firewall.

Share this post


Link to post
Share on other sites
I tested my program with another friend, he couldn't join my server but I was able to join his. So it do work at least, what causes this kind of behavior?

I have no antivirus, no installed firewall and the windows firewall is inactivated. The port I'm using is forwarded.

[Edited by - ixuz on September 1, 2009 1:06:46 PM]

Share this post


Link to post
Share on other sites

This topic is 3025 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this