Хелп
Суть проблемы такая, скачал LTE движок. Поставил 8ю студию, psp sdk и т.п.
Проблема заключается в том что LTE движок не хочет нормально компилиться вот пример кода: #include <engine.h> #include <common.h> #define printf pspDebugScreenPrintf using namespace engine; using namespace core; using namespace scene; using namespace video; using namespace io; using namespace gui; using namespace audio; /* Define the module info section */ PSP_MODULE_INFO("template", 0, 1, 1); /* Define the main thread's attribute value (optional) */ PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU); int main(int argc, char *argv[]) { setupPSP(); engineDevice *device = createDevice(); IVideoDriver* driver = device->getVideoDriver(); ISceneManager* smgr = device->getSceneManager(); IGUIEnvironment* guienv = device->getGUIEnvironment(); gui::IGUIStaticText* statusText = guienv->addStaticText(L"Hello World!", rect<int>(10,10,260,22), true); IAnimatedMesh* mesh = smgr->getMesh("mediasydney.md2"); IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); if (node) { node->setMaterialFlag(EMF_LIGHTING, false); node->setMD2Animation ( scene::EMAT_STAND ); node->setMaterialTexture( 0, driver->getTexture("mediasydney.bmp") ); node->setScale(core::vector3df(0.7f, 0.7f,0.7f)); } smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); while(device->run()) { driver->beginScene(true, true, SColor(255,100,101,140)); smgr->drawAll(); guienv->drawAll(); driver->endScene(); core::stringw status = L"Hello World! FPS = "; status += driver->getFPS(); statusText->setText(status.c_str()); } // sleep thread sceKernelSleepThreadCB(); return 0; } и получаю вот такую ошибку 1>main.c (21) :20: error: engine.h: No such file or directory 1>main.c (22) :20: error: common.h: No such file or directory 1>main.c (27) : error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace' 1>main.c (28) : error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace' 1>main.c (29) : error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace' 1>main.c (30) : error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace' 1>main.c (31) : error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace' 1>main.c (32) : error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace' 1>main.c (33) : error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace' 1>main.c (38) : error: expected declaration specifiers or '...' before string constant 1>main.c (38) : error: expected declaration specifiers or '...' before numeric constant 1>main.c (38) : error: expected declaration specifiers or '...' before numeric constant 1>main.c (38) : error: expected declaration specifiers or '...' before numeric constant 1>main.c (38) : warning: data definition has no type or storage class 1>main.c (38) : warning: type defaults to 'int' in declaration of 'PSP_MODULE_INFO' 1>main.c (41) : error: expected ')' before '|' token 1>main.c: In function 'main': 1>main.c (76) : warning: implicit declaration of function 'setupPSP' 1>main.c (80) : error: 'engineDevice' undeclared (first use in this function) 1>main.c (80) : error: (Each undeclared identifier is reported only once 1>main.c (80) : error: for each function it appears in.) 1>main.c (80) : error: 'device' undeclared (first use in this function) 1>main.c (80) : warning: implicit declaration of function 'createDevice' 1>main.c (83) : error: 'IVideoDriver' undeclared (first use in this function) 1>main.c (83) : error: 'driver' undeclared (first use in this function) 1>main.c (84) : error: 'ISceneManager' undeclared (first use in this function) 1>main.c (84) : error: 'smgr' undeclared (first use in this function) 1>main.c (85) : error: 'IGUIEnvironment' undeclared (first use in this function) 1>main.c (85) : error: 'guienv' undeclared (first use in this function) 1>main.c (88) : error: expected expression before ':' token 1>main.c (92) : error: 'IAnimatedMesh' undeclared (first use in this function) 1>main.c (92) : error: 'mesh' undeclared (first use in this function) 1>main.c (93) : error: 'IAnimatedMeshSceneNode' undeclared (first use in this function) 1>main.c (93) : error: 'node' undeclared (first use in this function) 1>main.c (97) : error: 'EMF_LIGHTING' undeclared (first use in this function) 1>main.c (97) : error: 'false' undeclared (first use in this function) 1>main.c (98) : error: 'scene' undeclared (first use in this function) 1>main.c (98) : error: expected ')' before ':' token 1>main.c (102) : error: 'core' undeclared (first use in this function) 1>main.c (102) : error: expected ')' before ':' token 1>main.c (105) : warning: implicit declaration of function 'vector3df' 1>main.c (110) : error: 'true' undeclared (first use in this function) 1>main.c (110) : warning: implicit declaration of function 'SColor' 1>main.c (118) : error: expected expression before ':' token 1>main.c (119) : error: 'status' undeclared (first use in this function) 1>main.c (120) : error: 'statusText' undeclared (first use in this function) 1>main.c (127) : warning: implicit declaration of function 'sceKernelSleepThreadCB' 1>main.c (118) : warning: label 'core' defined but not used 1>main.c (88) : warning: label 'gui' defined but not used все инклюды движка, добавил к инклюдам вижуал студии. С чем может быть связана проблема? может что-то делаю не правильно, просто раньше не работал с движками... (в инете пытался найти решение данной проблемы но ничего нормального не получилось) пытался прописывать прямые пути к файлам но ничего толкового и путного с этого не получилось. Если убрать все using namespace и писать каждую функцию полным путем аля engine::... то так компилятору вроде бы нравилось, но писать каждый раз полный путь к функции как понимаете не очень хочется. Заранее спасибо за помощь. Kirill_Mag добавил 03.04.2011 в 18:14 после некоторых преобразований и т.п. получил такой список ошибок 1>main.cpp (8) :20: error: engine.h: No such file or directory 1>main.cpp (9) :20: error: common.h: No such file or directory 1>main.cpp (16) : error: 'engine' is not a namespace-name 1>main.cpp (16) : error: expected namespace-name before ';' token 1>main.cpp (23) : error: 'core' is not a namespace-name 1>main.cpp (23) : error: expected namespace-name before ';' token 1>main.cpp (24) : error: 'scene' is not a namespace-name 1>main.cpp (24) : error: expected namespace-name before ';' token 1>main.cpp (25) : error: 'video' is not a namespace-name 1>main.cpp (25) : error: expected namespace-name before ';' token 1>main.cpp (26) : error: 'io' is not a namespace-name 1>main.cpp (26) : error: expected namespace-name before ';' token 1>main.cpp (27) : error: 'gui' is not a namespace-name 1>main.cpp (27) : error: expected namespace-name before ';' token 1>main.cpp (28) : error: 'audio' is not a namespace-name 1>main.cpp (28) : error: expected namespace-name before ';' token 1>main.cpp: In function 'int main()': 1>main.cpp (40) : error: 'setupPSP' was not declared in this scope 1>main.cpp (58) : error: 'engineDevice' was not declared in this scope 1>main.cpp (58) : error: 'device' was not declared in this scope 1>main.cpp (59) : error: 'createDevice' was not declared in this scope 1>main.cpp (67) : error: 'IVideoDriver' was not declared in this scope 1>main.cpp (67) : error: 'driver' was not declared in this scope 1>main.cpp (68) : error: 'ISceneManager' was not declared in this scope 1>main.cpp (68) : error: 'smgr' was not declared in this scope 1>main.cpp (69) : error: 'IGUIEnvironment' was not declared in this scope 1>main.cpp (69) : error: 'guienv' was not declared in this scope 1>main.cpp (76) : error: 'gui' has not been declared 1>main.cpp (76) : error: 'statusText' was not declared in this scope 1>main.cpp (77) : error: 'rect' was not declared in this scope 1>main.cpp (77) : error: expected primary-expression before 'int' 1>main.cpp (90) : error: 'IAnimatedMesh' was not declared in this scope 1>main.cpp (90) : error: 'mesh' was not declared in this scope 1>main.cpp (91) : error: 'IAnimatedMeshSceneNode' was not declared in this scope 1>main.cpp (91) : error: 'node' was not declared in this scope 1>main.cpp (103) : error: 'EMF_LIGHTING' was not declared in this scope 1>main.cpp (104) : error: 'scene' has not been declared 1>main.cpp (108) : error: 'core' has not been declared 1>main.cpp (115) : error: 'vector3df' was not declared in this scope 1>main.cpp (132) : error: 'SColor' was not declared in this scope 1>main.cpp (140) : error: 'core' has not been declared 1>main.cpp (140) : error: expected `;' before 'status' 1>main.cpp (141) : error: 'status' was not declared in this scope 1>main.cpp (147) : error: 'sceKernelSleepThreadCB' was not declared in this scope при таком коде (взял чистый пример который есть в движке без каких либо изменений и т.п.) #include <engine.h> #include <common.h> using namespace engine; using namespace core; using namespace scene; using namespace video; using namespace io; using namespace gui; using namespace audio; int main() { setupPSP(); engineDevice *device = createDevice(); IVideoDriver* driver = device->getVideoDriver(); ISceneManager* smgr = device->getSceneManager(); IGUIEnvironment* guienv = device->getGUIEnvironment(); gui::IGUIStaticText* statusText = guienv->addStaticText(L"Hello World!", rect<int>(10,10,260,22), true); IAnimatedMesh* mesh = smgr->getMesh("ms0:/media/sydney.md2"); IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); if (node) { node->setMaterialFlag(EMF_LIGHTING, false); node->setMD2Animation ( scene::EMAT_STAND ); node->setMaterialTexture( 0, driver->getTexture("ms0:/media/sydney.bmp") ); / node->setScale(core::vector3df(0.7f, 0.7f,0.7f)); } smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); while(device->run()) { driver->beginScene(true, true, SColor(255,100,101,140)); smgr->drawAll(); guienv->drawAll(); driver->endScene(); core::stringw status = L"Hello World! FPS = "; status += driver->getFPS(); statusText->setText(status.c_str()); } sceKernelSleepThreadCB(); return 0; } Kirill_Mag добавил 03.04.2011 в 18:16 1>main.cpp ( :20: error: engine.h: No such file or directory 1>main.cpp (9) :20: error: common.h: No such file or directory 1>main.cpp (16) : error: 'engine' is not a namespace-name 1>main.cpp (16) : error: expected namespace-name before ';' token 1>main.cpp (23) : error: 'core' is not a namespace-name 1>main.cpp (23) : error: expected namespace-name before ';' token 1>main.cpp (24) : error: 'scene' is not a namespace-name 1>main.cpp (24) : error: expected namespace-name before ';' token 1>main.cpp (25) : error: 'video' is not a namespace-name 1>main.cpp (25) : error: expected namespace-name before ';' token 1>main.cpp (26) : error: 'io' is not a namespace-name 1>main.cpp (26) : error: expected namespace-name before ';' token 1>main.cpp (27) : error: 'gui' is not a namespace-name 1>main.cpp (27) : error: expected namespace-name before ';' token 1>main.cpp (2 : error: 'audio' is not a namespace-name 1>main.cpp (2 : error: expected namespace-name before ';' token причину этих ошибок не могу понять хоть убейте. Файлы подключаемые он знает где находятся. Наводя на функции из этих файлов пишет их прототипы и т.п. Почему не хочет нормально работать понять не могу((( |
Цитата:
Это значит, что путь к файлу компилятор не находит или этого файла там нет. (21) - номер строки, на которую ссылается ошибка в main.c Цитата:
Если не указано другое в makefile. |
в студии все указанно где находятся инклюды в настройках
|
Kirill_Mag, и правильно указаны? Судя по первым же ошибкам, сразу говорит о другом.
И зачем Студию сюда? Не проще ли польковаться батником или командной строкой. Вот этого набора фактически более, чем достаточно для компиляции программ: https://www.pspx.ru/forum/showthread.php?t=90993 |
ну вот в том то и дело что все указанно правильно а ошибку выдает, при этом если нажать перейти к файлу он открывает этот файл, потому я и не могу понять в чем проблема. Потому что в студии удобнее
Kirill_Mag добавил 03.04.2011 в 23:37 на студии уже компилил проги) |
Цитата:
Ну тут не спорю, если тебе так нравится. Я просто говорю о том, что можно проверить скомпилить простым способом - обычным батником. И, посмотрев на ошибки, если они вдруг появятся, выявить где загвоздка - в коде программы или в твоей Студии. |
Цитата:
|
да к проекту тоже все подключено
сегодня вечером попробую откомпилить тем компилятором что на форуме указан. У меня просто есть еще вариант что связанно с моей виндой, я ее сегодня как раз сносить буду. Потом буду опять тестить |
Kirill_Mag, все проблемы из-за хедэров стопудово... Бывает, что в мэйкфайле делают чтобы хэдэры грузились не только из includ`ов, но и из папки с сорц кодом (INCDIR =
), попробуй кинуть их как я говорил в папку с основным сорц кодом... Короче юзай мэйкфайл... На вижуал студио нафиг забей... пропиши вот это в батнике и суй в директорию с сорцами: Код:
c:/pspsdk/bin/make |
Цитата:
|
Всем спасибо. Проблема оказалась в МейкФайле) Я добавил там несколько строк в которых указал где лежат либы и инклюды, потому что как оказалось то что это указанно в вижуал студии, это до одного места)
|
ErikPshat, Не могу удерьжаться от того чтобы заявить что програмировать в "блокноте с подстветкой синтаксиса" хотя и приемлимо но уж никак не сравнимо с нормальным иде.
|
ivy, я например пока не понимаю, что даёт нормальный IDE. Может объяснишь, если не затруднит, пусть коротко и по порядку.
Kirill_Mag, тоже попросил бы тебя написать фак, как правильно подключить PSP-SDK к Visual Studio 2010. Ну чтобы не пропустить ни один шаг, по порядку, т.к. у тебя видимо уже опыт есть. Просто было как-то давно дело, когда я корячился, но как-то криво с трудом подключил к тогдашней 6-ке или 7-ке. Там ещё куча не задействованных полей оставалось, т.к. нечего было задействовать из SDK )). В результате, при открытии любых исходников для PSP в Visual Studio, там есть автоматическая проверка кода, так эта проверка тут-же кричало на каждую строчку кода, что там не правильно и тут не правильно. В результате, я ей просто пользовался, как элементарным блокнотом. А потом подумал, что нафиг вообще она для PSP, если я тоже самое намного проще могу править в текстовом редакторе EmEditor или Dev-C++ (Notepad++ давно списал), при том, что он также автоматически делает отступ кода, если скобки ещё не закрыты, поэтому сразу отделяет отступом каждый блок кода, а так-же подсвечивает каждый вид кода нужным цветом. А скомпилить программу по бырому можно и без всяких IDE, элементарным батником или просто из командной строки. Но я приспособился ещё проще, чтобы не искать/создавать каждый раз батник или набирать путь в командной строке - через Git Bash (GIT). Прямо в любом месте компьютера, где находится папка с исходниками, просто жмёшь правой кнопкой и выбираешь в контекстном меню "Git Bash", тут-же открывается консольное окно с уже автоматом прописанным путём к папке. Остаётся только ввести команду Make или Make Clean и т.п.. Короче, а толку от IDE я так и не узрел. Поэтому прошу помощи... |
Цитата:
Цитата:
Цитата:
|
Цитата:
А если по делу то адекватные иде: эклипс, вижуал студия, икскод, даже кодблокс банально экономят огромное количество времени. Конечно компилить уже готовый код можно и без иде, но вести разработку без иде это нонсенс. |
ivy, Я думал, что ты говоришь PSPxIDE. А эклипс.. Боже упаси. Самое неадекватное IDE мире. Вижуал студио более менее, а остальные из перечисленных я не юзал.
Вот например я веду разработки в ноутпаде++ и всё прекрасно.. Ошибаюсь просто в коде я редко, но бувает... Всё равно буду сидеть без ИДЕ, я привык уже просто. Человеку помогли, уже пошёл оффтоп. Тема закрыта. |
окей завтра напишу тему в которой опишу как PSP SDK к студии подключать нормально)
|
Kirill_Mag, буду премного благодарен...
|
кстати я столкнулся с такой проблемой
везде сказано что в pspsdk/psp/sdk/lib/build.mak нужно найти такие строки: $(PACK_PBP) EBOOT.PBP $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON) <br /> $(PSP_EBOOT_ICON1) $(PSP_EBOOT_UNKPNG) $(PSP_EBOOT_PIC1) <br /> $(PSP_EBOOT_SND0) strip_$(FINAL_TARGET) $(PSP_EBOOT_PSAR) и удалить strip_ вот ток проблема... у меня в это файле нету строки $(PSP_EBOOT_SND0) strip_$(FINAL_TARGET) $(PSP_EBOOT_PSAR) так же стоит добавить что версия ядра 5.xx и скорее всего проблема кроется в makefile кто-то сталкивался? проблема просто в том что prx файлы не хотят нормально запускаться при запуске выдается вот такое окно: http://cs11289.vkontakte.ru/u5818272...y_cd49d2a1.jpg но зато есть $(PSP_EBOOT_SND0) $(TARGET)_strip.elf $(PSP_EBOOT_PSAR) |
Kirill_Mag, Посмотри нет ли других мэйкфайлов, часто их несколько и они в других папках, к разным модулям свои мэйки... перебери все, если есть..
|
Текущее время: 10:58. Часовой пояс GMT +3. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc. Перевод: zCarot
PSPx Forum - Сообщество фанатов игровых консолей.