Wes Miller
Wes Miller

Reputation: 2241

Visual Studio 2008 says "the specified file is an unrecognized or unsupported binary format" when I try to debug

I have a VS2008 solution containing two C++ projects. One is a Win32/console .dll and the other is a tester program to test that dll, also a Win32 console app.

When I build the solution, even with a clean build and with the Debug Command set to the hardcoded path to the executable, trying to debug presents a messagebox saying,

"the specified file is an unrecognized or unsupported binary format".

The program it is trying to execute is the source of tester.cpp.

Can someone suggest a cure? What information may I provide to help solve this problem?

Upvotes: 3

Views: 8310

Answers (3)

SVSLP001
SVSLP001

Reputation: 1

The easiest way to solve this issue, is to delete the .suo file and re-build the project.

First, you have to change your folder options, to show hidden files (as the .suo file is generally hidden). If you are not sure how to do it, refer to http://windows.microsoft.com/en-sg/windows/show-hidden-files#show-hidden-files=windows-7

Secondly, browse to the location where the respective Visual Studio Solution file is saved and delete the .suo file. If you need to know more about the .suo files, please refer to http://msdn.microsoft.com/en-us/library/bb165909.aspx

Finally, re-build your project.

This method, generally has solved most of similar issues which occurred to me.

Hope this helps!

Upvotes: -2

Arpit Garg
Arpit Garg

Reputation: 51

I have a VS2010 solution containing two C++ projects: one project generates a .lib file and the another project (which contains"main.cpp") is used to test the functionality provided by the .lib file.

for that, I go to the solution explorer, right click '2nd Project' and go to References. when you click "Add new reference", it already contains references to the First Project. Select it.

Now, I need to set the '2nd Project' (which contains "main.cpp") as start-up project so that I can debug the code. for that, again, go to the solution explorer, right click '2nd Project' and go to Set as StartUp Project

Upvotes: 0

Bart
Bart

Reputation: 20038

Please make sure that your test application (it should be an executable: .exe) is the one you're running and not the DLL. Set it as the "startup project" for example.

You can do so from within your Solution Explorer by right-clicking the appropriate project and selecting "Set as startup project".

Upvotes: 16

Related Questions