Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues With Compiling This Project #73

Closed
coffeebe4code opened this issue Jun 12, 2021 · 9 comments
Closed

Issues With Compiling This Project #73

coffeebe4code opened this issue Jun 12, 2021 · 9 comments

Comments

@coffeebe4code
Copy link

make SDL_PLATFORM=linux SDL_MODE=release
gprbuild -p -gnat2012 -XSDL_MODE=release -XSDL_PLATFORM=linux \
	-Psdlada.gpr
Compile
   [C]            version_ttf.c
/home/christopher/source/sdlada/src/ttf/version_ttf.c:26:10: fatal error: 'SDL_ttf.h' file not found
#include <SDL_ttf.h>
         ^~~~~~~~~~~
1 error generated.
gprbuild: *** compilation phase failed
make: *** [makefile:48: lib/libadasdl.a] Error 4

I have built SDL2 from source. Although I probably plan to use ttf, I'm curious how would I go about getting it, and included so this could be built.

@coffeebe4code
Copy link
Author

coffeebe4code commented Jun 12, 2021

yea the problem is when i did sudo make install for the sdl ttf source, the installation path was in of it in usr/local and it was put in the SDL2 folder, so the reference is "<SDL2/SDL_ttf.h>"

How would you prefer sdl2_ttf be installed?

@coffeebe4code
Copy link
Author

I've edited the C files to prepend <SDL2/ on a few files to make it get past this issue. Now the Ada compiler is complaining with this error.

[Ada]          sdl-video-palettes.adb
sdl-video-palettes.adb:146:41: error: expected type "Palette_Constant_Access" defined at sdl-video-palettes.ads:124
sdl-video-palettes.adb:146:41: error: found type access to "Palette'CLASS" defined at line 69
sdl-video-palettes.adb:163:41: error: expected type "Palette_Constant_Access" defined at sdl-video-palettes.ads:124
sdl-video-palettes.adb:163:41: error: found type access to "Palette'CLASS" defined at line 69

Here is where I don't know enough about the language yet to know what this means.

@riccardo-bernardini
Copy link

I've edited the C files to prepend <SDL2/ on a few files to make it get past this issue. Now the Ada compiler is complaining with this error.

[Ada]          sdl-video-palettes.adb
sdl-video-palettes.adb:146:41: error: expected type "Palette_Constant_Access" defined at sdl-video-palettes.ads:124
sdl-video-palettes.adb:146:41: error: found type access to "Palette'CLASS" defined at line 69
sdl-video-palettes.adb:163:41: error: expected type "Palette_Constant_Access" defined at sdl-video-palettes.ads:124
sdl-video-palettes.adb:163:41: error: found type access to "Palette'CLASS" defined at line 69

Here is where I don't know enough about the language yet to know what this means.

The type of Container in Iterator is kind of an "anonymous" access type and it is different from the access type defined in sdl-video-palettes.ads:124. Yes, they are both access constant Palette'Class, but they are considered different types.

I do not know enough the whole code to propose a solution, but I see two possible approaches

  1. Define Iterator using Palette_Constant_Access instead of the anonymous type. This should be possible since Iterator is defined in the body and Palette_Constant_Access in the specs
  2. Convert the value of Container to Palette_Constant_Access

I do not know enough about the code to say which one is better or if there are strange side effects (I do not expect any, but never say never...). Maybe someone more expert could chime in?

@coffeebe4code
Copy link
Author

I'm not sure if this is an actual issue with the code, or an incorrect flag for building the project. But I would expect master to be a spitting image of the latest release, and it be fully build-able, test-able, and production ready code. I think there is something else that I am missing as I tried compiling from the docs, and am new to ada.

@coffeebe4code coffeebe4code changed the title Unable to find SDL_ttf.h Issues With Compiling This Project Jun 13, 2021
@Lucretia
Copy link
Collaborator

Lucretia commented Jun 13, 2021

What is the output from sdl2-config --cflags, mine is -I/usr/include/SDL2 -D_REENTRANT, my SDL_ttf.h file is in that directory.

Where is your SDL_ttf.h file?

@Lucretia
Copy link
Collaborator

I've just checked Debian and Fedora and they both install SDL_ttf.h in the same place as Gentoo (what I use).

@Lucretia
Copy link
Collaborator

I would guess that either you don't have SDL2_ttf installed or the sdl2-config your using is not the correct one. Doesn't your OS have SDL2 packaged up?

@coffeebe4code
Copy link
Author

@Lucretia I installed it by building and installing from source with the default options. I am trying to move past that as there is a quick workaround. Right now, the issue stems from here. I will go ahead and make a new issue.

@ghost
Copy link

ghost commented Aug 10, 2023

I am attempting to build sdlada on FreeBSD and am also getting the issues with the build not finding any SDL header. I too have to patch three files to prepend SDL2 to the include directive.

sdl2-config --cflags returns:

-I/usr/local/include/SDL2 -I/usr/local/include -D_REENTRANT -D_THREAD_SAFE

sdl2-config --libs returns:

-L/usr/local/lib -lSDL2

Tho, I am unsure if I am building the project correctly, there is no Alire on FreeBSD yet, so I am using the Ports system to fetch, extract, and cd to ${SRC}/build/gnat/ and run GNU make there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants