Du bist nicht angemeldet.

Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!

Werbeanzeige

1

01.04.2018, 13:40

Allegro oder SDL unter Linux intallieren wie? Hilfe bitte

Hallo,
ich möchte gern unter C ein wenig mit Grafik experimentieren, dazu wollt ich gern mal Allegro oder SDL austesten.
Nun bin ich aber leider komplett überfordert, ich weiß nicht wie ich das unter Linux zum laufen bekomme..
Könnte mir Jemand eine Schritt für Schritt Anleitung geben? Das wäre echt super!! :)

(Ich nutze den gcc und einfaches C unter Debian.)

NachoMan

Community-Fossil

Beiträge: 3 885

Wohnort: Berlin

Beruf: (Nachhilfe)Lehrer (Mathematik, C++, Java, C#)

  • Private Nachricht senden

2

01.04.2018, 14:03

Wie wärs damit?
https://wiki.libsdl.org/Installation#Linux.2FUnix

Ich habe bei google nur "debian sdl gcc" eingegeben. Versuch es beim nächsten mal doch auch. :)
"Der erste Trunk aus dem Becher der Erkenntnis macht einem zum Atheist, doch auf dem Grund des Bechers wartet Gott." - Werner Heisenberg
Biete Privatunterricht in Berlin und Online.
Kommt jemand mit Nach oMan?

3

01.04.2018, 14:27

Hallo,
ich habe es genauso gemacht wie in deiner Anleitung beschrieben ist, leider funktioniert es dennoch nicht obwohl das Terminal das wohl installiert hat. Er findet das SDL dennoch nicht leider.

Schorsch

Supermoderator

Beiträge: 5 145

Wohnort: Wickede

Beruf: Softwareentwickler

  • Private Nachricht senden

4

01.04.2018, 14:45

ich habe es genauso gemacht wie in deiner Anleitung beschrieben ist, leider funktioniert es dennoch nicht obwohl das Terminal das wohl installiert hat. Er findet das SDL dennoch nicht leider.

Was heißt es funktioniert nicht. Du musst uns schon ein paar mehr Informationen geben. Was genau versuchst du und was funktioniert dabei nicht? Welche Fehlermeldungen gibt es?
„Es ist doch so. Zwei und zwei macht irgendwas, und vier und vier macht irgendwas. Leider nicht dasselbe, dann wär's leicht.
Das ist aber auch schon höhere Mathematik.“

Julién

Alter Hase

Beiträge: 717

Wohnort: Bayreuth

Beruf: Student | Hilfswissenschaftler in der Robotik

  • Private Nachricht senden

5

02.04.2018, 04:09

@M&M's, du musst mehr Informationen zu deinem Problem angeben. Eine Tatsache, die vielen Anfängern nicht bewusst ist, ist, dass Probleme eine schier unendliche Anzahl von Ursprüngen haben.
Also könnte es so viele Gründe geben, weshalb dein Compiler 'SDL' nicht finden kann. Wir würden dir auch gerne sagen wieso, leider geht das nicht, da uns wichtige Informationen deinerseits fehlen.

*Beliebigen Witz über kaputte Glaskugel bitte hier einfügen*
I write my own game engines because if I'm going to live in buggy crappy filth, I want it to me my own - Ron Gilbert

6

02.04.2018, 20:50

Habe erstmal versucht diese beiden Pakete zu intallieren wie in der Beschreibung beschrieben.. geht lieder nicht.
apt-get install libsdl2-2.0
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
E: Paket libsdl2-2.0 kann nicht gefunden werden.
E: Mittels regulärem Ausdruck »libsdl2-2.0« konnte kein Paket gefunden werden.

apt-get install libsdl2-dev
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
E: Paket libsdl2-dev kann nicht gefunden werden.

Ok das ging aus irgendeinem Grunde nicht..
Dann hab ich das hier leider nicht verstanden:
If you're compiling SDL yourself, here's what we refer to as "the Unix way" of building:
Vor allem das mit make und so..
Ich hatte mir das Paket runter geladen als tarball und auch entpakt.. aber ich finde die Installationsdatei nicht oder weiß überhaupt garnicht wonach ich in dem ganzen Archiv überhaupt suchen soll..
Wenn ich es versuche mit diesem ./configure und so das geht irgendwie alles nicht. :(

ich hab es unter debian 7 und unter debian 8 versucht.
Irgendwas mache ich wohl falsch aber ich bin auch kein Experte!
:fie: :fie: Wäre toll wenn mir jemand helfen könnte.. hoffe ich hab das ganz problem einigermaßen genau beschrieben.. hier hab ich es nochmal vewrsucht zu installieren mit einer anderen Datei aber auch das hat nicht geklappt.. :

7

02.04.2018, 20:51

/SDL2-2.0.8# ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... no
checking for mawk... mawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for windres... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for working volatile... yes
checking for GCC -MMD -MT option... yes
checking for linker option --no-undefined... yes
checking for ANSI C header files... (cached) yes
checking for sys/types.h... (cached) yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for memory.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for size_t... yes
checking for M_PI in math.h... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for working memcmp... yes
checking for working strtod... yes
checking for mprotect... yes
checking for malloc... yes
checking for calloc... yes
checking for realloc... yes
checking for free... yes
checking for getenv... yes
checking for setenv... yes
checking for putenv... yes
checking for unsetenv... yes
checking for qsort... yes
checking for abs... yes
checking for bcopy... yes
checking for memset... yes
checking for memcpy... yes
checking for memmove... yes
checking for wcslen... yes
checking for wcscmp... yes
checking for strlen... yes
checking for strlcpy... no
checking for strlcat... no
checking for _strrev... no
checking for _strupr... no
checking for _strlwr... no
checking for strchr... yes
checking for strrchr... yes
checking for strstr... yes
checking for itoa... no
checking for _ltoa... no
checking for _uitoa... no
checking for _ultoa... no
checking for strtol... yes
checking for strtoul... yes
checking for _i64toa... no
checking for _ui64toa... no
checking for strtoll... yes
checking for strtoull... yes
checking for atoi... yes
checking for atof... yes
checking for strcmp... yes
checking for strncmp... yes
checking for _stricmp... no
checking for strcasecmp... yes
checking for _strnicmp... no
checking for strncasecmp... yes
checking for vsscanf... yes
checking for vsnprintf... yes
checking for fopen64... yes
checking for fseeko... yes
checking for fseeko64... yes
checking for sigaction... yes
checking for setjmp... yes
checking for nanosleep... yes
checking for sysconf... yes
checking for sysctlbyname... no
checking for getauxval... no
checking for poll... yes
checking for pow in -lm... yes
checking for acos... yes
checking for acosf... yes
checking for asin... yes
checking for asinf... yes
checking for atan... yes
checking for atanf... yes
checking for atan2... yes
checking for atan2f... yes
checking for ceil... yes
checking for ceilf... yes
checking for copysign... yes
checking for copysignf... yes
checking for cos... yes
checking for cosf... yes
checking for fabs... yes
checking for fabsf... yes
checking for floor... yes
checking for floorf... yes
checking for fmod... yes
checking for fmodf... yes
checking for log... yes
checking for logf... yes
checking for log10... yes
checking for log10f... yes
checking for pow... yes
checking for powf... yes
checking for scalbn... yes
checking for scalbnf... yes
checking for sin... yes
checking for sinf... yes
checking for sqrt... yes
checking for sqrtf... yes
checking for tan... yes
checking for tanf... yes
checking for iconv_open in -liconv... no
checking for iconv... yes
checking for struct sigaction.sa_sigaction... yes
checking libunwind.h usability... no
checking libunwind.h presence... no
checking for libunwind.h... no
checking for GCC builtin atomic operations... yes
checking for GCC -mmmx option... yes
checking for GCC -m3dnow option... yes
checking for GCC -msse option... yes
checking immintrin.h usability... yes
checking immintrin.h presence... yes
checking for immintrin.h... yes
checking for Altivec with GCC altivec.h and -maltivec option... no
checking for Altivec with GCC -maltivec option... no
checking for Altivec with GCC altivec.h and -faltivec option... no
checking for Altivec with GCC -faltivec option... no
checking for GCC -Wall option... yes
checking for necessary GCC -Wno-multichar option... no
checking for GCC -fvisibility=hidden option... yes
checking for GCC -Wdeclaration-after-statement option... yes
checking for dlopen... yes
checking for dlopen in -lc... no
checking for dlopen in -ldl... yes
checking for OSS audio support... yes
checking for ALSA CFLAGS...
checking for ALSA LDFLAGS... -lasound -lm -ldl -lpthread
checking for libasound headers version >= 1.0.11... not present.
checking for snd_ctl_open in -lasound... no
checking for pkg-config... no
checking for PulseAudio 0.9 support... no
checking for pkg-config... (cached) no
checking for JACK 0.125 support... no
checking for artsc-config... no
checking for esd-config... no
checking for ESD - version >= 0.2.8... no
*** The esd-config script installed by ESD could not be found
*** If ESD was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the ESD_CONFIG environment variable to the
*** full path to esd-config.
checking audio/audiolib.h usability... no
checking audio/audiolib.h presence... no
checking for audio/audiolib.h... no
checking for AuOpenServer in -laudio... no
checking for NAS audio support... no
checking sndio.h usability... no
checking sndio.h presence... no
checking for sndio.h... no
checking for sio_open in -lsndio... no
checking for sndio audio support... no
checking samplerate.h usability... no
checking samplerate.h presence... no
checking for samplerate.h... no
checking for pkg-config... (cached) no
checking for Raspberry Pi... no
checking for X... no
checking for OpenGL (GLX) support... no
checking for EGL support... no
checking for OpenGL ES v1 headers... no
checking for OpenGL ES v2 headers... yes
checking for pkg-config... (cached) no
checking for Mir support... no
checking for pkg-config... (cached) no
checking for Wayland support... no
checking libudev.h usability... no
checking libudev.h presence... no
checking for libudev.h... no
checking for pkg-config... (cached) no
checking for pkg-config... (cached) no
checking for pkg-config... (cached) no
checking for Linux 2.4 unified input interface... yes
checking for Linux kd.h... yes
checking for Touchscreen library support... no
checking for pthreads... yes
checking for recursive mutexes... yes
checking for pthread semaphores... yes
checking for sem_timedwait... yes
checking for pthread_np.h... no
checking for pthread_setname_np... yes
checking for pthread_set_name_np... no
checking for clock_gettime in -lrt... yes
checking linux/version.h usability... yes
checking linux/version.h presence... yes
checking for linux/version.h... yes
checking for Vivante VDK API... no
checking for Vivante FB API... no
checking for linker option --enable-new-dtags... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sdl2-config
config.status: creating sdl2-config.cmake
config.status: creating SDL2.spec
config.status: creating sdl2.pc
config.status: creating include/SDL_config.h
config.status: executing libtool commands
config.status: executing sdl2_config commands
config.status: executing summary commands
SDL2 Configure Summary:
Building Shared Libraries
Building Static Libraries
Enabled modules : atomic audio video render events joystick haptic power filesystem threads timers file loadso cpuinfo assembly
Assembly Math : mmx 3dnow sse
Audio drivers : disk dummy oss
Video drivers : dummy opengl_es2 vulkan
Input drivers : linuxev linuxkd
Using libsamplerate : NO
Using libudev : NO
Using dbus : NO
Using ime : YES
Using ibus : NO
Using fcitx : NO
root@debian7:/home/cneu/SDL2-2.0.8# make
/bin/bash build-scripts/mkinstalldirs build
mkdir -p -- build
/bin/bash build-scripts/updaterev.sh
CC build/SDL.lo
CC build/SDL_assert.lo
CC build/SDL_dataqueue.lo
CC build/SDL_error.lo
CC build/SDL_hints.lo
CC build/SDL_log.lo
CC build/SDL_atomic.lo
CC build/SDL_spinlock.lo
CC build/SDL_audio.lo
CC build/SDL_audiocvt.lo
CC build/SDL_audiodev.lo
CC build/SDL_audiotypecvt.lo
CC build/SDL_mixer.lo
CC build/SDL_wave.lo
CC build/SDL_cpuinfo.lo
CC build/SDL_dynapi.lo
CC build/SDL_clipboardevents.lo
CC build/SDL_dropevents.lo
CC build/SDL_events.lo
CC build/SDL_gesture.lo
CC build/SDL_keyboard.lo
CC build/SDL_mouse.lo
CC build/SDL_quit.lo
CC build/SDL_touch.lo
CC build/SDL_windowevents.lo
CC build/SDL_rwops.lo
CC build/SDL_haptic.lo
CC build/SDL_gamecontroller.lo
CC build/SDL_joystick.lo
CC build/e_atan2.lo
CC build/e_fmod.lo
CC build/e_log.lo
CC build/e_log10.lo
CC build/e_pow.lo
CC build/e_rem_pio2.lo
CC build/e_sqrt.lo
CC build/k_cos.lo
CC build/k_rem_pio2.lo
CC build/k_sin.lo
CC build/k_tan.lo
CC build/s_atan.lo
CC build/s_copysign.lo
CC build/s_cos.lo
CC build/s_fabs.lo
CC build/s_floor.lo
CC build/s_scalbn.lo
CC build/s_sin.lo
CC build/s_tan.lo
CC build/SDL_power.lo
CC build/SDL_d3dmath.lo
CC build/SDL_render.lo
CC build/SDL_yuv_sw.lo
CC build/SDL_render_d3d.lo
CC build/SDL_shaders_d3d.lo
CC build/SDL_render_d3d11.lo
CC build/SDL_shaders_d3d11.lo
CC build/SDL_render_gl.lo
CC build/SDL_shaders_gl.lo
CC build/SDL_render_gles.lo
CC build/SDL_render_gles2.lo
CC build/SDL_shaders_gles2.lo
CC build/SDL_render_psp.lo
CC build/SDL_blendfillrect.lo
CC build/SDL_blendline.lo
CC build/SDL_blendpoint.lo
CC build/SDL_drawline.lo
CC build/SDL_drawpoint.lo
CC build/SDL_render_sw.lo
CC build/SDL_rotate.lo
CC build/SDL_getenv.lo
CC build/SDL_iconv.lo
CC build/SDL_malloc.lo
CC build/SDL_qsort.lo
CC build/SDL_stdlib.lo
CC build/SDL_string.lo
CC build/SDL_thread.lo
CC build/SDL_timer.lo
CC build/SDL_RLEaccel.lo
CC build/SDL_blit.lo
CC build/SDL_blit_0.lo
CC build/SDL_blit_1.lo
CC build/SDL_blit_A.lo
CC build/SDL_blit_N.lo
CC build/SDL_blit_auto.lo
CC build/SDL_blit_copy.lo
CC build/SDL_blit_slow.lo
CC build/SDL_bmp.lo
CC build/SDL_clipboard.lo
CC build/SDL_egl.lo
CC build/SDL_fillrect.lo
CC build/SDL_pixels.lo
CC build/SDL_rect.lo
CC build/SDL_shape.lo
CC build/SDL_stretch.lo
CC build/SDL_surface.lo
CC build/SDL_video.lo
CC build/SDL_vulkan_utils.lo
CC build/SDL_yuv.lo
CC build/yuv_rgb.lo
CC build/SDL_nullevents.lo
CC build/SDL_nullframebuffer.lo
CC build/SDL_nullvideo.lo
CC build/SDL_diskaudio.lo
CC build/SDL_dummyaudio.lo
CC build/SDL_sysloadso.lo
CC build/SDL_dspaudio.lo
CC build/SDL_ime.lo
CC build/SDL_systhread.lo
CC build/SDL_syssem.lo
CC build/SDL_sysmutex.lo
CC build/SDL_syscond.lo
CC build/SDL_systls.lo
CC build/SDL_sysjoystick.lo
CC build/SDL_steamcontroller.lo
CC build/SDL_syshaptic.lo
CC build/SDL_syspower.lo
CC build/SDL_sysfilesystem.lo
CC build/SDL_systimer.lo
CC build/SDL_evdev.lo
CC build/SDL_evdev_kbd.lo
CC build/SDL_poll.lo
LTLINK build/libSDL2.la
CC build/SDL_dummy_main.lo
LTLINK build/libSDL2main.la
CC build/SDL_test_assert.lo
CC build/SDL_test_common.lo
CC build/SDL_test_compare.lo
CC build/SDL_test_crc32.lo
CC build/SDL_test_font.lo
CC build/SDL_test_fuzzer.lo
CC build/SDL_test_harness.lo
CC build/SDL_test_imageBlit.lo
CC build/SDL_test_imageBlitBlend.lo
CC build/SDL_test_imageFace.lo
CC build/SDL_test_imagePrimitives.lo
CC build/SDL_test_imagePrimitivesBlend.lo
CC build/SDL_test_log.lo
CC build/SDL_test_md5.lo
CC build/SDL_test_memory.lo
CC build/SDL_test_random.lo
LTLINK build/libSDL2_test.la
root@debian7:/home/cneu/SDL2-2.0.8# make install
/bin/bash build-scripts/updaterev.sh
/bin/bash build-scripts/mkinstalldirs /usr/local/bin
/usr/bin/install -c -m 755 sdl2-config /usr/local/bin/sdl2-config
/bin/bash build-scripts/mkinstalldirs /usr/local/include/SDL2
mkdir -p -- /usr/local/include/SDL2
for file in SDL.h SDL_assert.h SDL_atomic.h SDL_audio.h SDL_bits.h SDL_blendmode.h SDL_clipboard.h SDL_cpuinfo.h SDL_egl.h SDL_endian.h SDL_error.h SDL_events.h SDL_filesystem.h SDL_gamecontroller.h SDL_gesture.h SDL_haptic.h SDL_hints.h SDL_joystick.h SDL_keyboard.h SDL_keycode.h SDL_loadso.h SDL_log.h SDL_main.h SDL_messagebox.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_opengl_glext.h SDL_opengles.h SDL_opengles2_gl2ext.h SDL_opengles2_gl2.h SDL_opengles2_gl2platform.h SDL_opengles2.h SDL_opengles2_khrplatform.h SDL_pixels.h SDL_platform.h SDL_power.h SDL_quit.h SDL_rect.h SDL_render.h SDL_rwops.h SDL_scancode.h SDL_shape.h SDL_stdinc.h SDL_surface.h SDL_system.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_touch.h SDL_types.h SDL_version.h SDL_video.h SDL_vulkan.h begin_code.h close_code.h SDL_test_assert.h SDL_test_common.h SDL_test_compare.h SDL_test_crc32.h SDL_test_font.h SDL_test_fuzzer.h SDL_test.h SDL_test_harness.h SDL_test_images.h SDL_test_log.h SDL_test_md5.h SDL_test_memory.h SDL_test_random.h; do \
/usr/bin/install -c -m 644 /home/cneu/SDL2-2.0.8/include/$file /usr/local/include/SDL2/$file; \
done
/usr/bin/install -c -m 644 include/SDL_config.h /usr/local/include/SDL2/SDL_config.h
if test -f include/SDL_revision.h; then \
/usr/bin/install -c -m 644 include/SDL_revision.h /usr/local/include/SDL2/SDL_revision.h; \
else \
/usr/bin/install -c -m 644 /home/cneu/SDL2-2.0.8/include/SDL_revision.h /usr/local/include/SDL2/SDL_revision.h; \
fi
/bin/bash build-scripts/mkinstalldirs /usr/local/lib
/bin/bash ./libtool --quiet --mode=install /usr/bin/install -c build/libSDL2.la /usr/local/lib/libSDL2.la
/bin/bash ./libtool --quiet --mode=install /usr/bin/install -c build/libSDL2main.la /usr/local/lib/libSDL2main.la
/bin/bash ./libtool --quiet --mode=install /usr/bin/install -c build/libSDL2_test.la /usr/local/lib/libSDL2_test.la
/bin/bash build-scripts/mkinstalldirs /usr/local/share/aclocal
mkdir -p -- /usr/local/share/aclocal
/usr/bin/install -c -m 644 /home/cneu/SDL2-2.0.8/sdl2.m4 /usr/local/share/aclocal/sdl2.m4
/bin/bash build-scripts/mkinstalldirs /usr/local/lib/pkgconfig
mkdir -p -- /usr/local/lib/pkgconfig
/usr/bin/install -c -m 644 sdl2.pc /usr/local/lib/pkgconfig
/bin/bash build-scripts/mkinstalldirs /usr/local/lib/cmake/SDL2
mkdir -p -- /usr/local/lib/cmake/SDL2
/usr/bin/install -c -m 644 sdl2-config.cmake /usr/local/lib/cmake/SDL2
root@debian7:/home/cneu/SDL2-2.0.8# vi a.c

//Hier hab ich versucht e:(in SDL Programm zu starten das ich als beispiel zum Testen genommen hab.. leider funktioniert es nicht :(

root@debian7:/home/cneu/SDL2-2.0.8# gcc a.c
a.c:1:17: fatal error: SDL.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.
root@debian7:/home/cneu/SDL2-2.0.8#

Schorsch

Supermoderator

Beiträge: 5 145

Wohnort: Wickede

Beruf: Softwareentwickler

  • Private Nachricht senden

8

02.04.2018, 21:22

Er konnte SDL nicht finden weil es nicht in den Paketquellen von Debian vorhanden ist. Du kannst es hinzufügen und dann daraus installieren. In deinem Fall ist das jetzt nicht mehr nötig da du es ja schon selbst kompiliert hast. Dein Compiler findet SDL.h nicht weil er nicht weiß wo er die Datei finden möchte. Hast du schon Erfahrung mit C++? Du musst GCC mitteilen wo er die SDL Header finden kann und was er linken muss damit SDL funktioniert. An diesem Punkt ist es eigentlich sinnvoll dich mit make oder cmake auseinander zu setzen.
„Es ist doch so. Zwei und zwei macht irgendwas, und vier und vier macht irgendwas. Leider nicht dasselbe, dann wär's leicht.
Das ist aber auch schon höhere Mathematik.“

9

08.04.2018, 18:26

Ok dann befasse ich mich mal mit make/cmake.
Und dadurch findet der Compiler das SDL?
Wusste nicht das es so kompliziert sein würde um mit C ein paar einfache Grafiken zu erstellen..

Schorsch

Supermoderator

Beiträge: 5 145

Wohnort: Wickede

Beruf: Softwareentwickler

  • Private Nachricht senden

10

08.04.2018, 18:38

Du musst deinem Compiler sagen wo er SDL findet. Entweder installierst du SDL, wobei die Header normalerweise an einen Ort geschrieben werden den dein Compiler findet, oder aber du sagst jedes mal beim kompilieren wo dein Compiler nachgucken soll. Beim gcc geht das zum Beispiel mit -I. Das sieht dann zum Beipiel so aus:

Quellcode

1
gcc main.c -I/home/User1337/SDL/include -o cool_tool


jetzt musst du ihm zusätzlich zu den Header Dateien noch die Bibliothek linken. Das geht mit -L.

Quellcode

1
gcc main.c -I/home/User1337/SDL/include -L/home/User1337/SDL/lib -o cool_tool


Jetzt weiß der Gcc wo er die Header Dateien herbekommt und wo er die kompilierte Bibliothek finden kann. Was ihm aber noch fehlt ist welche Bibliothek du denn überhaupt benutzen möchtest. Genau so wie du dem Compiler sagen musst welche cpp Dateien er benutzen soll musst du ihm mitteilen welche Bibliotheken er linken soll. Das geht mit -l.

Quellcode

1
gcc main.c -I/home/User1337/SDL/include -L/home/User1337/SDL/lib -lSDL -o cool_tool


Weil der Befehl immer größer und unverständlicher wird, du wirst mit der Zeit immer mehr Code-Dateien haben die du angeben musst, vielleicht immer mehr Bibliotheken nutzen, möchtest du ein Programm wie Make benutzen. Das ist nicht der einzige Grund, aber der zählt für dich jetzt im Moment.
Bei Make legst du ein sogenanntes Makefile an in welchem du sagst welche Codedateien der Compiler benutzen soll, welche Bibliotheken, wo er diese findet, welche Flags er benutzen soll und und und. Das ganze ist etwas übersichtlicher als wenn du alles in einem Befehl von Hand kombinierst. Es gibt da noch zig andere Vorteile, setz dich mit dem Thema einfach mal auseinander. CMake setzt jetzt oben drauf auf. In CMake legst du an sich die selben Dinge fest wie in dem Makefile, nur dass CMake am Ende das Makefile für dich generiert. Das coole ist, CMake kann nicht nur Makefiles generieren sondern auch Projektdaten für Visual Studio oder andere IDEs. Dadurch bist du beim kompilieren nicht so stark an C gebunden. Mit CMake gibt es jetzt wieder viele andere coole Dinge die du so anstellen kannst. Auch hier gilt, guck es dir einfach mal an.
Am besten suchst du erst mal nach einem Make Tutorial und wenn du damit klar kommst guckst du dir mal CMake an. Du braucht beides nicht um dein eigentliches Problem zu lösen, es macht es aber einfacher.
„Es ist doch so. Zwei und zwei macht irgendwas, und vier und vier macht irgendwas. Leider nicht dasselbe, dann wär's leicht.
Das ist aber auch schon höhere Mathematik.“

Werbeanzeige