| Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате |
| Форум программистов > C/C++: Мультимедия, OpenGL/DirectX > Компилятор dev C++ и DirectX |
| Автор: MrImho 29.8.2009, 01:38 |
| Здравствуйте помогите решить проблему. Я использую примеры DirectX SDK. Они все рабочие, но компилятор вечно жалуется. Я добавил в project options и папку для инклуда и папку для библиотек и добавил сами библиотеки. Но при компиляции жалуется на строку: #include "dxfile.h" // defines LPDIRECTXFILEDATA в файле: d3dx9mesh.h Вот что выводит компилятор: 46 C:\DXSDK\Include\d3dx9mesh.h:15, from C:\DXSDK\Include\D3DX9.h In file included from C:/DXSDK/Include/d3dx9mesh.h:15, from C:/DXSDK/Include/D3DX9.h 14 C:\DXSDK\Include\D3DX9.h:46, from Lighting.cpp from C:/DXSDK/Include/D3DX9.h:46, from Lighting.cpp 14 C:\DXSDK\Samples\C++\Direct3D\Lighting\Lighting.cpp from Lighting.cpp 240 C:\DXSDK\Include\dxfile.h stray '\26' in program 240:2 C:\DXSDK\Include\dxfile.h [Warning] no newline at end of file Lighting.cpp:16:20: DXUtil.h: No such file or directory Lighting.cpp:17:28: D3DEnumeration.h: No such file or directory Lighting.cpp:18:25: D3DSettings.h: No such file or directory Lighting.cpp:19:20: D3DApp.h: No such file or directory Lighting.cpp:20:21: D3DFont.h: No such file or directory Lighting.cpp:21:21: D3DUtil.h: No such file or directory Lighting.cpp:50: error: expected class-name before '{' token Lighting.cpp:54: error: ISO C++ forbids declaration of `CD3DFont' with no type Lighting.cpp:54: error: expected `;' before '*' token Lighting.cpp:55: error: ISO C++ forbids declaration of `CD3DFont' with no type Lighting.cpp:55: error: expected `;' before '*' token Lighting.cpp: In function `INT WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, INT)': Lighting.cpp:91: error: 'class CMyD3DApplication' has no member named 'Create' Lighting.cpp:94: error: 'class CMyD3DApplication' has no member named 'Run' Lighting.cpp: In constructor `CMyD3DApplication::CMyD3DApplication()': Lighting.cpp:106: error: `m_strWindowTitle' was not declared in this scope Lighting.cpp:107: error: `m_d3dEnumeration' was not declared in this scope Lighting.cpp:109: error: `m_pFont' was not declared in this scope Lighting.cpp:109: error: `CD3DFont' has not been declared Lighting.cpp:109: error: `D3DFONT_BOLD' was not declared in this scope Lighting.cpp:110: error: `m_pFontSmall' was not declared in this scope Lighting.cpp:110: error: `CD3DFont' has not been declared Lighting.cpp: In member function `HRESULT CMyD3DApplication::InitDeviceObjects()': Lighting.cpp:135: error: `m_pFont' was not declared in this scope Lighting.cpp:135: error: `m_pd3dDevice' was not declared in this scope Lighting.cpp:138: error: `m_pFontSmall' was not declared in this scope Lighting.cpp:138: error: `m_pd3dDevice' was not declared in this scope Lighting.cpp: In member function `HRESULT CMyD3DApplication::RestoreDeviceObjects()': Lighting.cpp:159: error: `m_pd3dDevice' was not declared in this scope Lighting.cpp:162: error: `m_pd3dDevice' was not declared in this scope Lighting.cpp:167: error: `D3DUtil_InitMaterial' was not declared in this scope Lighting.cpp:168: error: `m_pd3dDevice' was not declared in this scope Lighting.cpp:189: error: `m_d3dsdBackBuffer' was not declared in this scope Lighting.cpp:222: error: `m_pFont' was not declared in this scope Lighting.cpp:223: error: `m_pFontSmall' was not declared in this scope Lighting.cpp: In member function `HRESULT CMyD3DApplication::BuildWallMesh()': Lighting.cpp:240: error: `SAFE_RELEASE' was not declared in this scope Lighting.cpp:243: error: `m_pd3dDevice' was not declared in this scope Lighting.cpp:316: error: `m_pd3dDevice' was not declared in this scope Lighting.cpp:323: error: `SAFE_DELETE_ARRAY' was not declared in this scope Lighting.cpp: In member function `HRESULT CMyD3DApplication::FrameMove()': Lighting.cpp:338: error: `m_fTime' was not declared in this scope Lighting.cpp:343: error: `m_d3dCaps' was not declared in this scope Lighting.cpp:377: error: `m_pd3dDevice' was not declared in this scope Lighting.cpp: In member function `HRESULT CMyD3DApplication::Render()': Lighting.cpp:394: error: `m_pd3dDevice' was not declared in this scope Lighting.cpp:466: error: `m_pFont' was not declared in this scope Lighting.cpp:466: error: `m_strFrameStats' was not declared in this scope Lighting.cpp:467: error: `m_strDeviceStats' was not declared in this scope Lighting.cpp:469: error: invalid conversion from `const char*' to `TCHAR*' Lighting.cpp:472: error: `m_pFontSmall' was not declared in this scope Lighting.cpp: In member function `HRESULT CMyD3DApplication::InvalidateDeviceObjects()': Lighting.cpp:502: error: `SAFE_RELEASE' was not declared in this scope Lighting.cpp:505: error: `m_pFont' was not declared in this scope Lighting.cpp:506: error: `m_pFontSmall' was not declared in this scope Lighting.cpp: In member function `HRESULT CMyD3DApplication::DeleteDeviceObjects()': Lighting.cpp:521: error: `m_pFont' was not declared in this scope Lighting.cpp:522: error: `m_pFontSmall' was not declared in this scope Lighting.cpp: In member function `HRESULT CMyD3DApplication::FinalCleanup()': Lighting.cpp:538: error: `m_pFont' was not declared in this scope Lighting.cpp:538: error: `SAFE_DELETE' was not declared in this scope Lighting.cpp:539: error: `m_pFontSmall' was not declared in this scope Lighting.cpp: In member function `LRESULT CMyD3DApplication::MsgProc(HWND__*, UINT, WPARAM, LPARAM)': Lighting.cpp:587: error: `CD3DApplication' has not been declared mingw32-make.exe: *** [Objects/MingW/Lighting.o] Error 1 Execution terminated Compilation Failed. Make returned 2 Что же я делаю не так? |
| Автор: nerezus 29.8.2009, 16:38 |
| MrImho, а зачем ты используешь этот компилятор для этой задачи? Просто интересно. |
| Автор: Alexeis 29.8.2009, 17:27 |
| "No such file or directory" по видимому не все пути прописаны в среде. Возможно некоторые дефайны нужно включить. Все таки DirectX SDK изначально не адаптировалось для mingw. Придется чуток напильником доработать. Кстати новая студия показывает какие части кода включены, а какие отключены дефайнами. Возможно включена часть заголовков оставленная для совместимости со старыми версиями MSVC. |
| Автор: MrImho 29.8.2009, 23:30 |
| Всё убрал ошибки с no such files. Но возникли другие. Уже компиляция проходит нормально, но в самом конце вылазиет следующее: много таких строк .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized много таких строк Objects/MingW/Lighting.o:Lighting.cpp:(.text+0x67): undefined reference to `InitCommonControls@0' Objects/MingW/Lighting.o:Lighting.cpp:(.text+0x7c): undefined reference to `CD3DApplication::Create(HINSTANCE__*)' Objects/MingW/Lighting.o:Lighting.cpp:(.text+0xbf): undefined reference to `CD3DApplication::Run()' Objects/MingW/Lighting.o:Lighting.cpp:(.text+0x1ab): undefined reference to `CD3DApplication::CD3DApplication()' Objects/MingW/Lighting.o:Lighting.cpp:(.text+0x20e): undefined reference to `CD3DFont::CD3DFont(char const*, unsigned long, unsigned long)' много таких строк ../../../../Lib/d3dx9.lib(obj/i386/createmesh.obj):..\createmesh.cpp:(.text[??1CBone@@QAE@XZ]+0x7): undefined reference to `??3@YAXPAX@Z' ../../../../Lib/d3dx9.lib(obj/i386/createmesh.obj):..\createmesh.cpp:(.text[??1CBone@@QAE@XZ]+0x13): undefined reference to `??3@YAXPAX@Z' Проблема чтоли с самими библиотеками? Т.к. компиляция проходит, но в самом конце после ожидания вылазиет много таких строк. Всё подключил правильно. Почему использую именно этот компилятор, потому, что нет возможности использовать другой. Всем спасибо за ответы |
| Автор: nerezus 30.8.2009, 00:00 | ||
|
| Автор: andrew_121 30.8.2009, 16:38 |
Разве речь об этом? По теме: Укажи линковщику следующую библиотеку: libcomctl32.a П И покажи какую DXSDK установил? |