|
73 / 74 / 4
Регистрация: 25.09.2012
Сообщений: 211
|
||
Подключение SDL.h к проекту06.03.2015, 12:55. Показов 11812. Ответов 6
Метки нет (Все метки)
Доброго времени суток, уважаемые форумчане.
Я пытаюсь скомпилировать готовый проект вот отсюда: https://github.com/chaotika86/... source-lib Использую для этого компилятор g++ и инструкцию, приведенную там же: Кликните здесь для просмотра всего текста
Compilation ------------------------ The bare lib depends only on the standard C/C++ library. If you want to see some action, the small program stored in main.cpp depends on SDL. Compilation is quite straightforward: g++ -I./ main.cpp source/resource.cpp source/resource_image.cpp source/resource_string.cpp source/resource_tech.cpp source/resource_palette.cpp -I/usr/include/SDL -lSDL -o demo You'll need to change the hardcoded path in main.cpp source file. And to run, demo need two numerical parameters: - first one is the index of the image inside the data file - second one is the index of the palette used to render the image itself Я создал в проекте директорию /usr/include/SDL и скопировал туда содержимое SDL библиотеки для разработчиков http://www.libsdl.org/download-1.2.php - .h .lib и .dll файлы. Теперь, если я пытаюсь скомпилировать проект по инструкции разработчика командой
Кликните здесь для просмотра всего текста
In file included from include/resource.h:1,
from main.cpp:1: include/common.h:8: SDL.h: No such file or directory In file included from include/resource.h:1, from include/resource_string.h:1, from main.cpp:2: include/common.h:8: SDL.h: No such file or directory In file included from include/resource.h:1, from include/resource_image.h:1, from main.cpp:3: include/common.h:8: SDL.h: No such file or directory In file included from include/resource.h:1, from include/resource_palette.h:1, from main.cpp:4: include/common.h:8: SDL.h: No such file or directory In file included from include/resource.h:1, from include/resource_tech.h:1, from main.cpp:5: include/common.h:8: SDL.h: No such file or directory In file included from .\include/resource.h:1, from source/resource.cpp:1: .\include/common.h:8: SDL.h: No such file or directory In file included from .\include/resource.h:1, from .\include/resource_image.h:1, from source/resource.cpp:4: .\include/common.h:8: SDL.h: No such file or directory In file included from .\include/resource.h:1, from .\include/resource_string.h:1, from source/resource.cpp:5: .\include/common.h:8: SDL.h: No such file or directory In file included from .\include/resource.h:1, from .\include/resource_palette.h:1, from source/resource.cpp:6: .\include/common.h:8: SDL.h: No such file or directory In file included from .\include/resource.h:1, from .\include/resource_tech.h:1, from source/resource.cpp:7: .\include/common.h:8: SDL.h: No such file or directory In file included from .\include/resource.h:1, from .\include/resource_image.h:1, from source/resource_image.cpp:1: .\include/common.h:8: SDL.h: No such file or directory In file included from .\include/resource.h:1, from .\include/resource_string.h:1, from source/resource_string.cpp:1: .\include/common.h:8: SDL.h: No such file or directory In file included from .\include/resource.h:1, from .\include/resource_tech.h:1, from source/resource_tech.cpp:1: .\include/common.h:8: SDL.h: No such file or directory In file included from .\include/resource.h:1, from .\include/resource_palette.h:1, from source/resource_palette.cpp:1: .\include/common.h:8: SDL.h: No such file or directory Я так понимаю, что нужно изменить какой-то путь в main.cpp или добавить путь ко всей библиотеке SDL, но как именно это сделать я не могу разобраться. Подскажите, как скомпилировать этот проект без ошибок или в каком направлении двигаться - мне кажется, что решение простое, но я его не вижу, т.к. знаком с плюсами довольно поверхностно. Заранее благодарю. Здесь все используемые мной ресурсы: openpax-master.zip - чистый проект с гитхаба SDL-devel-1.2.15-VC.zip - библиотека SDL openpax-master.7z - так выглядит проект у меня на компьютере. P.S. g++ я устанавливал отсюда, если это важно: http://completepascal.blogspot... ndows.html
0
|
||
| 06.03.2015, 12:55 | |
|
Ответы с готовыми решениями:
6
Подключение SDL 2.0 MinGW Подключение wininet.h к проекту Подключение С библиотеки (.so) к проекту С++ |
|
859 / 448 / 112
Регистрация: 06.07.2013
Сообщений: 1,491
|
|
| 06.03.2015, 12:57 | |
|
Скажите в какой именно папке находится sdl.h
прямо в /usr/include/SDL ? если там то можно попробовать прописать директорию полностью в опциях не относительно а что то типа -IС:/projects/../usr/include/SDL
1
|
|
|
73 / 74 / 4
Регистрация: 25.09.2012
Сообщений: 211
|
||
| 06.03.2015, 12:58 [ТС] | ||
0
|
||
|
859 / 448 / 112
Регистрация: 06.07.2013
Сообщений: 1,491
|
|
| 06.03.2015, 13:03 | |
|
как в файле resource.h и common.h и подобных подключается SDL - надо так #include <SDL.h> именно в таких скобках
1
|
|
|
73 / 74 / 4
Регистрация: 25.09.2012
Сообщений: 211
|
||
| 06.03.2015, 13:13 [ТС] | ||
|
Кликните здесь для просмотра всего текста
In file included from C:\openpax-master\resource-lib\usr\include\SDL\SDL_main.h:
26, from C:\openpax-master\resource-lib\usr\include\SDL\SDL.h:30, from main.cpp:1: C:\openpax-master\resource-lib\usr\include\SDL\SDL_stdinc.h:68: stdint.h: No suc h file or directory In file included from C:\openpax-master\resource-lib\usr\include\SDL\SDL_main.h: 26, from C:\openpax-master\resource-lib\usr\include\SDL\SDL.h:30, from .\include/common.h:8, from .\include/resource.h:1, from source/resource.cpp:1: C:\openpax-master\resource-lib\usr\include\SDL\SDL_stdinc.h:68: stdint.h: No suc h file or directory In file included from C:\openpax-master\resource-lib\usr\include\SDL\SDL_main.h: 26, from C:\openpax-master\resource-lib\usr\include\SDL\SDL.h:30, from .\include/common.h:8, from .\include/resource.h:1, from .\include/resource_image.h:1, from source/resource_image.cpp:1: C:\openpax-master\resource-lib\usr\include\SDL\SDL_stdinc.h:68: stdint.h: No suc h file or directory In file included from C:\openpax-master\resource-lib\usr\include\SDL\SDL_main.h: 26, from C:\openpax-master\resource-lib\usr\include\SDL\SDL.h:30, from .\include/common.h:8, from .\include/resource.h:1, from .\include/resource_string.h:1, from source/resource_string.cpp:1: C:\openpax-master\resource-lib\usr\include\SDL\SDL_stdinc.h:68: stdint.h: No suc h file or directory In file included from C:\openpax-master\resource-lib\usr\include\SDL\SDL_main.h: 26, from C:\openpax-master\resource-lib\usr\include\SDL\SDL.h:30, from .\include/common.h:8, from .\include/resource.h:1, from .\include/resource_tech.h:1, from source/resource_tech.cpp:1: C:\openpax-master\resource-lib\usr\include\SDL\SDL_stdinc.h:68: stdint.h: No suc h file or directory In file included from C:\openpax-master\resource-lib\usr\include\SDL\SDL_main.h: 26, from C:\openpax-master\resource-lib\usr\include\SDL\SDL.h:30, from .\include/common.h:8, from .\include/resource.h:1, from .\include/resource_palette.h:1, from source/resource_palette.cpp:1: C:\openpax-master\resource-lib\usr\include\SDL\SDL_stdinc.h:68: stdint.h: No suc h file or directory
0
|
||
|
859 / 448 / 112
Регистрация: 06.07.2013
Сообщений: 1,491
|
||
| 06.03.2015, 13:48 | ||
|
stdint.h помоему стандартный файл вообще, он должен идти вместе с G++ странно что его не видно
Добавлено через 9 минут нужна версия SDL-Mingw или SGL-GCC как то так
1
|
||
|
73 / 74 / 4
Регистрация: 25.09.2012
Сообщений: 211
|
||
| 06.03.2015, 15:24 [ТС] | ||
|
0
|
||
| 06.03.2015, 15:24 | |
|
Помогаю со студенческими работами здесь
7
Подключение к проекту jpg
Подключение dll (C++) к проекту VB 6.0 Как вывести текст на экран, используя библиотеку SDL TTF для SDL 2? Подключение dll к проекту в visual studio Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |
|
Новые блоги и статьи
|
|||
|
Семь CDC на одном интерфейсе: 5 U[S]ARTов, 1 CAN и 1 SSI
Eddy_Em 18.02.2026
Постепенно допиливаю свою "многоинтерфейсную плату". Выглядит вот так:
https:/ / www. cyberforum. ru/ blog_attachment. php?attachmentid=11617&stc=1&d=1771445347
Основана на STM32F303RBT6.
На борту пять. . .
|
Символьное дифференцирование
igorrr37 13.02.2026
/ *
Программа принимает математическое выражение в виде строки и выдаёт его производную в виде строки и вычисляет
значение производной при заданном х
Логарифм записывается как: (x-2)log(x^2+2) -. . .
|
Камера Toupcam IUA500KMA
Eddy_Em 12.02.2026
Т. к. у всяких "хикроботов" слишком уж мелкий пиксель, для подсмотра в ESPriF они вообще плохо годятся: уже 14 величину можно рассмотреть еле-еле лишь на экспозициях под 3 секунды (а то и больше),. . .
|
И ясному Солнцу
zbw 12.02.2026
И ясному Солнцу,
и светлой Луне.
В мире
покоя нет
и люди
не могут жить в тишине.
А жить им немного лет.
|
|
«Знание-Сила»
zbw 12.02.2026
«Знание-Сила»
«Время-Деньги»
«Деньги -Пуля»
|
SDL3 для Web (WebAssembly): Подключение Box2D v3, физика и отрисовка коллайдеров
8Observer8 12.02.2026
Содержание блога
Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами и вызывать обработчики событий столкновения. . . .
|
SDL3 для Web (WebAssembly): Загрузка PNG с прозрачным фоном с помощью SDL_LoadPNG (без SDL3_image)
8Observer8 11.02.2026
Содержание блога
Библиотека SDL3 содержит встроенные инструменты для базовой работы с изображениями - без использования библиотеки SDL3_image. Пошагово создадим проект для загрузки изображения. . .
|
SDL3 для Web (WebAssembly): Загрузка PNG с прозрачным фоном с помощью SDL3_image
8Observer8 10.02.2026
Содержание блога
Библиотека SDL3_image содержит инструменты для расширенной работы с изображениями. Пошагово создадим проект для загрузки изображения формата PNG с альфа-каналом (с прозрачным. . .
|