Why does my Application not run using the x64 Version of Windows Server 2008? - c++

I have a Win32 C++ Application using a handful of third-Party DLLs that is installed at some hundred costumer machines. I recently tested the x86 Version of the installation successfully on Windows XP, Windows Vista x64, Windows 7 x86 as well as Windows Server 2008 x86. No Problems. The Installer (nullsoft) installs the redistributable files for VC 2005 and VC 2008 as both are required by different DLLs we use.
But with Windows Server 2008 x64 both, the x86 and the x64 Versions refuse to start.
When i start the x86 Version of the program a Dialog appears:
<myApp> has stopped Working.
The EventLog contains a message:
Faulting application myapp.exe, version 1.0.0.0, time stamp 0x4bcb37ca,
faulting module MSVCR80.dll, version 8.0.50727.4053, time stamp 0x4a594c79,
exception code 0xc000000d, fault offset 0x0001ce0b, process id 0x29c,
application start time 0x01cb0329976cfc68.
\Windows\winsxs contains a directory
x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_none_d08d7da0442a985d
Using sxstrace (first trace, then parse) a log file of 3 Bytes length is created containing non readable characters. Behavior of the x64 Version is similar. Also all demo programms from the 3rd Party Dlls are working properly. Any hint ?

It doesn't look like a side-by-side error. The exception code is STATUS_INVALID_PARAMETER, "An invalid parameter was passed to a service or function." That doesn't help. You'll need a debugger, probably with the Windows debugging symbols. Make it stop on the first-chance exception.

Related

How to build a Winsock2 (WS2_32.lib) application targeting Windows XP with Visual Studio 2017

I have an application written in C++ that uses socket (Winsock2.h). It has been developed on Windows 10 and it builds and runs fine on Windows 10. There is an old XP machine on which that application has to run (the machine cannot be upgraded as it contains legacy code that does not run on newer systems), but when I try to run the application on it I get the error: "The procedure entry point WSAPoll could not be located in the dynamic link library WS2_32.dll".
I tried the following:
I downloaded Visual Studio Express 2010 on a XP box and tried to build the application on it:
The code does not compile, because it uses libpqxx library (I suspect that libpqxx uses some c++11 code, that is not fully supported by VS2010);
I downloaded the XP toolset (v141_xp) for Visual Studio 2017 and built the application on Windows 10 (I have also downloaded and installed on XP the Microsoft Visual C++ Redistributable for Visual Studio 2017);
I got the same "The procedure entry point WSAPoll could not be located in the dynamic link library WS2_32.dll" error.
I tried to use winsock.h and link the application to wsock32.lib:
I got the same entry point error on WS2_32.lib (probably VS links the application to WS2_32.lib even if I specified to use wsock32.liB).
Is there a way to build on VS2017 using the xp toolset an application that uses Ws2_32.lib targeting XP?
EDIT 2019-05-03 10:30
As noticed by cprogrammer and Remy Lebeau WSAPoll does not exist in XP. The point is that I do not use WSAPoll in my code. So I followed the suggestion of Retired Ninja and I wrote from scratch an application using WinSock2 starting from the very basic and adding functions step by step(*). Well, all of my code worked well. The point is that I included also another library - libpqxx - and probably it uses WSAPoll.
Ok, I still have a problem, but at least I know where it is
(*) By the way, I already tried the same in the part of my code that uses WS2_32.lib, but as the problem was in another library I still got the error, so the suggestion to start from scratch really helped.
Accortding to docs, for WSAPoll, the minimum supported client is Windows 8.1, Windows Vista [desktop apps | UWP apps]
Cannot be used for applications targeting Windows XP.
Your app (or one of its dependancies) is static linking to WSAPoll(), which simply does not exist on XP, it was introduced in Vista. Whatever code your app uses that utilizes WSAPoll() will have to be rewritten for XP. For instance, by using GetProcAddress() to access WSAPoll() dynamically instead of statically, and using a fallback (select(), WSAAsyncSelect(), WSAEventSelect(), etc) when WSAPoll() is not available.
Actually, the code should be rewritten - period, since WSAPoll() is broken and even Microsoft has gone on record saying that WSAPoll() will not be fixed and should not be used.

VS2015 : The application was unable to start correctly (0xc000007b)

I wrote a code on Visual studio 2015 for a windows 10 PC. The application is mainly focused on UDP communication and I use the boost libraries.
It works perfectly but when I move the folder of the code to Windows 7 I receive the error "The application was unable to start correctly (0xc000007b)". I tried also in Windows 8.1 and after rebuilding the libraries it works.
What I noticed is that when I receive the error it does not load the .dll that in the other versions it loads.
May it be a problem with the boost?
Have you ever experienced it?
0xc000007b is error when you try to use x64 dlls in x32 application or other way around, so you probably copied wrong dlls. Rebuild fixed this, as it prepared new dlls.
win7_64 visual studio 2015, 0xc000007b
When I was programming C++ code in the visual studio 2015, it threw the error:0x000007b, and I have tried three kinds of solutions;
1.Installing Direct X
2.Installing VC C++ 2015 libraries
3.Making sure the DLL is consistent with the OS(and I think this is relevant to my problem)
ANd my solution will show below:
enter image description here
and I changed the [[[Debug]]] into [[[X64]]], then, it works, I believe that because some dlls are not consistent with the platform, so if I changed the Debug platform, We will get the correct result.The prerequisite:must having installed all dlls under the X64 system.

Can't debug using VS2005 on Win7/64 box

I've got an 32-bit C++ app, "MyOldApp" built with VS2005. I recently changed my dev PC from a WinXP box to a Win7/64 one. On it I installed VS2005,VS2008,VS2010 and VS2012 (in that order).
Then I found I could not launch "MyOldApp" inside VS2005 in the Debug configuation (Release works fine). Error: Unable to start program. This application has failed to start because the application configuration is correct." Windows event log says: Activation context generation failed for "MyOldApp.exe". Dependent Assembly Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762" could not be found. Please use sxstrace.exe for detailed diagnosis.
I check the manifest and it confirms this dependency.
So I check C:\Windows\winsxs and find this directory: x86_microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.42_none_ef74ff32550b5bf0
Then I check VS2005 Help > About, find it at 8.0.50727.42 and realize I never installed SP1 which I must have been using on the XP box. So I set out to update my machine from .42 to .762 but fail. I have tried installing it from here:
Visual C++ 2005 Sp1 Runtime (x86)
and from here:
Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Update
While installing, I get and agree to the license agreement, then see the "preparing to install" dialog. Then the installer just silently exits, and I am left with version .42 and my original problem.
How do I get SP1 to install? Thanks.
Found this:
Microsoft® Visual Studio® 2005 Team Suite Service Pack 1
and it was kind enough to run to completion. Launched VS2005 and it told me to do another update, which I found here:
Visual Studio 2005 Service Pack 1 Update for Windows Vista
which also ran to completion. VS2005 Help about now shows version .762 and my app can be run in Debug Configuration.

C++ app built on Windows 7 (using VS2010 IDE and VS2008 toolset) runs on Windows 7, but not on Win XP

I have a C++ application, which is built on Windows 7 using VS 2010 IDE against VS2008 toolset. I have verified that it depends on msvc*90.dll.
The problem occurs when i move it to XP professional SP3 machine. I have installed the 32-bit vs 2008 redistributable package too.
However, the application fails to run. No error is reported. Nothing is logged into system even viewer as well.
Any hints?
PS: I have seen the following threads already.
Program Built on Win7 won't run on WinXP
How do I compile for windows XP under windows 7 / visual studio 2008
Have you checked the DLL in that Windows XP system with Dependency Walker. This may help you find if you are not missing another dependency or not dealing with side by side execution problems.
This issue is resolved now. The problem was not related to dependencies. Instead, it was some directory not existing in the file system.

How to view .dmp file on Windows 7?

I have created a "minidump" file using the Visual Studio 2008 C++ debugger (Debug menu -> Save dump as...). I am running on Windows 7, 64-bit.
What program can I run to view the contents of the dump file in a meaningful way?
What information are you trying to get out of it?
WinDbg is my tool of choice.
It's part of the Windows SDK. You can get download links from here: http://www.windbg.org/
Note that there are three plaforms for it - x86, x64, and IA64. You want the version based on what the application is designed for, not your architecture. So if it is a 32-bit process, either by running on x86 Windows or WOW64 on x64 Windows, you want the x86 version. Only use x64 if the dmp came from a 64-bit process.
In my opinion WinDbg is the best.
It is supplied as part of Microsoft Windows SDK.