Recent

Author Topic: [Solved] SDL2 compiling problem  (Read 4039 times)

mrguzgog

  • Jr. Member
  • **
  • Posts: 71
[Solved] SDL2 compiling problem
« on: July 20, 2016, 08:13:48 pm »
I've been following the instructions on this page: http://www.freepascal-meets-sdl.net/chapter-2-installation-configuration-linux-version/

I downloaded and installed the latest fpc/source/lazarus .debs. SDL2 development files are already installed. My paths are identical to that shown, but when I try to compile  the most basic SDL program I get this error:

Code: Pascal  [Select][+][-]
  1. Hint: (11030) Start of reading config file /etc/fpc.cfg
  2. Hint: (11031) End of reading config file /etc/fpc.cfg
  3. Free Pascal Compiler version 3.0.0 [2015/12/05] for x86_64
  4. Copyright (c) 1993-2015 by Florian Klaempfl and others
  5. (1002) Target OS: Linux for x86-64
  6. (3104) Compiling project1.lpr
  7. /home/paul/pascal/project1.lpr(4,6) Fatal: (10022) Can't find unit SDL2 used by project1
  8. Fatal: (1018) Compilation aborted
  9. Error: /usr/bin/ppcx64 returned an error exitcode
  10.  

I didn't need to create the symlinks to the SDL libraries as they already exist on my system (see attachment).

I can compile a simple console program in Lazarus so no issues there.

I've re-started my system (just in case!) but to no effect.

As a long shot, I've tried putting the path to the libraries in the project options->compiler options->paths->Libraries (-Fl): field (no idea if that's what it's for!) but that doesn't work either.

Any help appreciated :D

Paul.

« Last Edit: July 20, 2016, 09:32:28 pm by mrguzgog »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: SDL2 linking problem
« Reply #1 on: July 20, 2016, 08:47:51 pm »
This is not a linking problem. It can't find an unit SDL2, which is probably the header to SDL2.

mrguzgog

  • Jr. Member
  • **
  • Posts: 71
Re: SDL2 compiling problem
« Reply #2 on: July 20, 2016, 09:04:04 pm »
This is not a linking problem. It can't find an unit SDL2, which is probably the header to SDL2.

Thanks for the quickly reply. I'm pretty new to this but I assume that means sdl2.pas which is in the folder /usr/local/share/sdl2 and that path is specified in the 'other unit files' field as per this screenshot. Any idea where I'm might be going wrong?

Paul.

mrguzgog

  • Jr. Member
  • **
  • Posts: 71
Re: SDL2 compiling problem
« Reply #3 on: July 20, 2016, 09:32:09 pm »
I've fixed it, it was a permissions issue on /usr/local/share/sdl2

Grrrr!

 

TinyPortal © 2005-2018