views:

95

answers:

2

Hello,

I am receiving an error that says "The application was unable to start correctly (0xc000007b). Click OK to close the application." When I attempt to run a program I have compiled with Visual Studio 2005.

When I run the windows program "depends" on this executable, I see a TON of DLLs which are listed as "x86" dlls. These all appear to be OS dll's (located in the c:\windows\system32 directory). "Depends" lists these as red where it describes the architecture, since I am making an AMD64 binary. A few of the DLLs (QT dlls I compiled from source) are listed as AMD64.

I have tried adding "c:\windows\SysWOW64" to my path before "c:\windows\system32" and rebuilding my application. This looks to me like where the 64 bit versions of these DLLs live. This still receives the same failure message. My project is setup to be build as a x64 project. Under my project -> properties -> linker -> advanced -> Target Machine, I have tried both "MachineX64" and "Not Set". Both of these settings result in the same error message at run time when I attempt to run my executable.

I am not very knowledgeable about building software in the windows environment. Most of my experience comes from Linux. To me, this seems like a DLL architecture issue, but I am not certain. Google'ing this error message did not provide me with much useful information. Any help provided would be much appreciated. I just started a new job, and seem like I am having lots and lots of problems when it comes to actually running our code...

Thank you very much for taking the time to read my question,

-Brian J. Stinar-

First of all, thank you very much for providing me feedback.

'set' provides me with the following information which I believe will help answer some of your questions. As I am not intimately familiar with windows system administration, please let me know if there are any other commands you think I should run to provide you with more useful information. The output I believe is relevant from 'set' is below:

LIBVERSION=win64

PROCESSOR_ARCHITECTURE=AMD64

PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 26 Stepping 5, GenuineIntel

PROCESSOR_LEVEL=6

PROCESSOR_REVISION=1a05

Under my system properties, I find the following values which I believe will help clarify my situation:

Windows 7

Processor : Intel(R) Xeon(R) CPU W3530 @ 2.80GHz 2.79 GHz

System Type : 64-bit Operating System

I'm not completely sure that I understand the difference between x64 and ia64, but as far as I understand, ia64 is for the itanium class processors, which I do not have. I believe I have a x64 processor. This is according to reading the post on

http://mikedimmick.blogspot.com/2006/03/whats-difference-between-x64-and-ia-64.html

Xeon processors fall into the x64 category. I'm not sure if I understand how AMD64 fits into this though.

Should I have AMD64 DLLs that I am linking to, and should my program be listed of CPU type AMD64 if I actually have an Intel Xeon chip?

Thank you again for your help,

-Brian J. Stinar-

+1  A: 

SysWOW64 is where 32-bit DLLs live on a 64-bit system. ('WOW' is 'Windows On Windows,', e.g 32-bit windows DLLs on 64-bit windows, so SysWOW64 is 'Sys'tem folder for Windows On Windows64) Normally, program runtime operation is automatically redirected here by Windows when it detects a 32-bit image on a 64-bit installation.

I agree with Rup - sounds like your image is built for a different architecture than you're running.

DaveE
Hello,Thank you for clarifying SysWOW64 for me. I am slowly becoming a windows programmer. Do you have any suggestions ensuring that my image (and all the supporting DLLs) are built for the correct architecture in Visual Studio 2005? I believe this is a DLL issue, but I am not sure. Additionally, I am able to run perfectly fine in release mode, but not in debug mode. This also makes me believe that one of the debug DLLs is incorrectly built. My 'solution' has been to change my build environment to a virtual machine. Obviously, this is less than ideal.Thank you again, I appreciate it.
Brian Stinar
Are you sure that none of the projects in your solution have 'x86' set as the architecture when you're building Debug? Everything should either run as your targeted achitecture or as 'Any CPU', no mixing.
DaveE
Since I was referring to functionality outside my project (DLL), how can I check for this in the future? I had x64 set to for the architecture for everything I was building, but other things I was depending on were not built in this same fashion. I don't know a general way of checking for this... Thanks!
Brian Stinar
Check with the source of the external items. The standard output of dumpbin /headers contains information about the target hardware; IF it'll run against a 64-bit image, that will brobalby say something different. You might look into Dependency Walker-wehn I run it against a 64-bit dll, it clearly indicates the target architecture on my 32-bit XP box.
DaveE
Thanks DaveE. Your comment on dumpbin is helpful. I already knew about dependency walker; it is a good tool too.
Brian Stinar
A: 

Hello,

There were two DLLs that were incorrect. These were :

libifcoremdd.dll libmmdd.dll

I was working with a coworker on this problem today, and he copied them over from a location he knew was good. When I was working earlier with a different coworker, we copied them over from a different location that turned out to be incorrect.

Additionally, if anyone else is having similar problems,

dumpbin /headers DLLName 

will give lots of useful information about the DLLs you are using. I'm not exactly sure what the difference was between these different DLLs (I overwrote the old ones, before I checked them). If I do additional analysis on this issue, I will post the results here. I suspect the DLLs were either x86 or ia64, instead of x64 DLLs like I needed.

What is the best solution for packaging and moving around DLLs like this in the Windows environment? Just copying them to a directory in my path doesn't seem like the best solution.

Thanks a lot everyone!

-Brian J. Stinar-

brian-stinar.blogspot.com

Brian Stinar