2

我早些时候发布了一个关于这个的问题,并意识到我的问题实际上并没有解决。无论如何,我的问题/问题是,由于某种原因,当我通过 IDE 运行我的 SDL 应用程序时,无论是 Code::Blocks 还是 Visual C++ 2010,我的 BMP 都不会加载。但是,如果我通过文件资源管理器运行它,它将正确显示 BMP。我不确定问题是什么,也许这与我正在运行 64 位 Windows 的事实有关?

当我通过 Visual C++ 2010 运行它时,出现以下错误:

'Brain Bread.exe': Loaded 'C:\Users\UserNameHere\Desktop\Brain Bread\Debug\Brain Bread.exe', Symbols loaded.
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Users\UserNameHere\Desktop\Brain Bread\Debug\SDL.dll', Binary was not built with debug information.
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\apphelp.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\AppPatch\AcLayers.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\userenv.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\profapi.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\winspool.drv', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\mpr.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'Brain Bread.exe': Unloaded 'C:\Windows\SysWOW64\ddraw.dll'
'Brain Bread.exe': Unloaded 'C:\Windows\SysWOW64\dwmapi.dll'
'Brain Bread.exe': Unloaded 'C:\Windows\SysWOW64\setupapi.dll'
'Brain Bread.exe': Unloaded 'C:\Windows\SysWOW64\devobj.dll'
'Brain Bread.exe': Unloaded 'C:\Windows\SysWOW64\cfgmgr32.dll'
'Brain Bread.exe': Unloaded 'C:\Windows\SysWOW64\dciman32.dll'
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\KBDUS.DLL', Cannot find or open the PDB file
'Brain Bread.exe': Unloaded 'C:\Windows\SysWOW64\KBDUS.DLL'
'Brain Bread.exe': Loaded 'C:\Windows\SysWOW64\KBDUS.DLL', Cannot find or open the PDB file
'Brain Bread.exe': Unloaded 'C:\Windows\SysWOW64\KBDUS.DLL'
The program '[4992] Brain Bread.exe: Native' has exited with code 0 (0x0).
4

2 回答 2

4

可能是因为当您通过 IDE 运行程序时,IDE 错误地为程序设置了当前工作目录,因此如果您在代码中使用 BMP 的相对路径,它将无法正常工作。尝试找出 IDE 为您的应用程序设置的工作目录并将 BMP 复制到那里。

于 2010-11-25T18:11:25.257 回答
1

问题可能是当前工作目录。Code::Blocks 从*.cbp文件所在的位置运行您的应用程序。我确信 Code::Blocks 可以让你在某个地方改变它。

于 2010-11-25T18:11:47.487 回答