views:

156

answers:

3

I'm trying to compile an SFML program I've writting in Visual C++ 2010. It compiles fine, but when I run the executable I get this error:

The application failed to initialize properly (0xc0150002). Click on OK to terminate the application.

This happens every time I try to run an application that uses SFML, I have included the libraries that I used in the external dependances, the library and include libaries are all in the lib and include files in the VC folder and the DLL is in the same folder as my exe. How can I fix this problem?

EDIT

Here is the debug output from the debugger:

    'SFML.exe': Loaded 'C:\Documents and Settings\Greg\My Documents\Visual Studio 2010\Projects\SFML\Debug\SFML.exe', Symbols loaded.
    'SFML.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
    'SFML.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
    'SFML.exe': Loaded 'C:\Documents and Settings\Greg\My Documents\Visual Studio 2010\Projects\SFML\Debug\sfml-graphics.dll', Cannot find or open the PDB file
    LDR: LdrpWalkImportDescriptor() failed to probe C:\Documents and Settings\Greg\my documents\visual studio 2010\Projects\SFML\Debug\sfml-graphics.dll for its manifest, ntstatus 0xc0150002
    Debugger:: An unhandled non-continuable exception was thrown during process load
    The program '[2792] SFML.exe: Native' has exited with code -1072365566 (0xc0150002).

EDIT

I have tried to recompile the library but I get this error:

    C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\SFML-1.5\build\vc2008\..\..\Temp\vc2008\sfml-network\Debug DLL\sfml-network.dll) does not match the Linker's OutputFile property value (C:\SFML-1.5\lib\vc2008\sfml-network-d.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
    C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(sfml-network) does not match the Linker's OutputFile property value (sfml-network-d). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).

I need to change the value of TargetPath but I cannot find an option to do this, does anyone know how I can change it?

A: 

This is probably caused by SFML being compiled with another version of Visual C++ (I guess it's 2008 or even 2005). You are apparently missing the corresponding manifest file and msvc*.dll libraries. I would suggest recompiling SFML yourself using VS 2010 as it will save you a lot of trouble with manifest tweaking.

dark_charlie
Compile? I just stuck the header and library files in my VC folders..
Greg Treleaven
A: 

Run the exe in the VS 2010 debugger with the following settings:

  1. Debug->Options and Settings->Debugging->Output Window->Module Load Messages -- On
  2. Debug->Exceptions->Win32 Exceptions->c0000135 Unable to Locate DLL (should be On)

Now, I think, it should help you identify which DLL fails to load.

Chubsdad
Sorry, the first one was already set to on and there is no Exeptions button in the Debug menu for number 2.
Greg Treleaven
Follow the link http://blogs.vertigo.com/personal/keithc/Blog/archive/2007/07/20/missing-menu-options-in-visual-studio-2005.aspxIn any case, now as per the new Edit, you know that the problem is in sfml-graphics.dll.
Chubsdad
Chubsdad
A: 

Microsoft Visual Studio 2010 wasn't compatible with the 2008 builds of SFML. I fixed the problem by not using 2010 and using Dev-C++ insead.

Greg Treleaven