Модераторы: Rickert, Alexeis, BorisVorontsov
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Компилятор dev C++ и DirectX, не работают даже простые примеры 
:(
    Опции темы
MrImho
Дата 29.8.2009, 01:38 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 31
Регистрация: 31.7.2009

Репутация: нет
Всего: нет



Здравствуйте помогите решить проблему.
Я использую примеры 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
Что же я делаю не так?
PM MAIL   Вверх
nerezus
Дата 29.8.2009, 16:38 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Вселенский отказник
****


Профиль
Группа: Участник
Сообщений: 3330
Регистрация: 15.6.2005

Репутация: нет
Всего: 43



MrImho, а зачем ты используешь этот компилятор для этой задачи? Просто интересно.


--------------------
Сообщество художников Artsociety.ru
PM MAIL WWW   Вверх
Alexeis
Дата 29.8.2009, 17:27 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Амеба
Group Icon


Профиль
Группа: Админ
Сообщений: 11743
Регистрация: 12.10.2005
Где: Зеленоград

Репутация: 5
Всего: 459



"No such file or directory" по видимому не все пути прописаны в среде. Возможно некоторые дефайны нужно включить. Все таки DirectX SDK изначально не адаптировалось для mingw. Придется чуток напильником доработать. Кстати новая студия показывает какие части кода включены, а какие отключены дефайнами. Возможно включена часть заголовков оставленная для совместимости со старыми версиями MSVC.


--------------------
Vit вечная память.

Обсуждение действий администрации форума производятся только в этом форуме

гениальность идеи состоит в том, что ее невозможно придумать
PM ICQ Skype   Вверх
MrImho
Дата 29.8.2009, 23:30 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 31
Регистрация: 31.7.2009

Репутация: нет
Всего: нет



Всё убрал ошибки с 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'
Проблема чтоли с самими библиотеками?
Т.к. компиляция проходит, но в самом конце после ожидания вылазиет много таких строк. Всё подключил правильно.
Почему использую именно этот компилятор, потому, что нет возможности использовать другой. Всем спасибо за ответы
PM MAIL   Вверх
nerezus
  Дата 30.8.2009, 00:00 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Вселенский отказник
****


Профиль
Группа: Участник
Сообщений: 3330
Регистрация: 15.6.2005

Репутация: нет
Всего: 43



Цитата

Почему использую именно этот компилятор, потому, что нет возможности использовать другой. 
 MSVC бесплатен, если что.


--------------------
Сообщество художников Artsociety.ru
PM MAIL WWW   Вверх
andrew_121
Дата 30.8.2009, 16:38 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Кодофей
****


Профиль
Группа: Завсегдатай
Сообщений: 3448
Регистрация: 3.1.2008

Репутация: нет
Всего: 33



Цитата(nerezus @  30.8.2009,  00:00 Найти цитируемый пост)
MSVC бесплатен, если что. 

Разве речь об этом? smile 

По теме: Укажи линковщику следующую библиотеку: libcomctl32.a
П И покажи какую DXSDK установил?


--------------------
Удалил аккаунт. Прощайте!
PM MAIL   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Вы можете найти полезным что...
Alexeis
Rickert
  • Английская документация по DirectX лежит где-то здесь.
  • Английская документация по OpenGL лежит где-то там.
  • Гейм-дев у нас обсуждают где-то тут

Ждём вас! С уважением, Alexeis, Rickert.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | C/C++: Мультимедия, OpenGL/DirectX | Следующая тема »


 




[ Время генерации скрипта: 0.0543 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.