* * *

Author Topic: Help SDL2 Installation on Lazarus  (Read 1424 times)

DiCri

  • Full Member
  • ***
  • Posts: 151
  • My goal : Build a game
    • http://manueldicriscito.altervista.org/DinoLand.zip
Help SDL2 Installation on Lazarus
« on: September 14, 2016, 04:13:37 pm »
Hi guys, new problem.. not about programming but about installation of SDL2 unit in Lazarus ( because i finally decided to use Lazarus and not anymore FreePascal with my project ).
All i've done is this:
Installed Zip file : SDL2-win32-x86.zip
Collocated .dll file to System32 folder of Windows.
Created a new folder named "sdl2" in "units/i386-win32/win32/" folder of lazarus directory.
Copied all SDL2 Headers into this folder and the previous dll file.
Opened Lazarus with my current .pas project called DinoLand.
Added "units/i386-win32/win32/" to "Other units" section in compiler options.
Compiled with no errors.
Error 0x000007b shown after running game.
( i hate this error.. i always see it.. also on Camtasia Studio ).
Maybe i'm wrong with directories in units folder because i don't understand what are folders for 32 bit and folders for 64 bit ( i think x86 and x64... i don't know ) and so if you can help me so.. help me.
I'm a game developer.. Now studying..
Go download my game:
http://manueldicriscito.altervista.org/DinoLand.zip

lainz

  • Hero Member
  • *****
  • Posts: 1841
  • Nace una flor, todos los días sale el sol...
    • BGRABitmap
Re: Help SDL2 Installation on Lazarus
« Reply #1 on: September 14, 2016, 04:19:54 pm »
Usually you put the headers with your source, in the same folder. And the dll in the folder of the executable.

Remember if you have 32 bit dll you need to compiled with 32 bit lazarus or cross-compile to 32 bit if you have the 64 bit lazarus.

Wich lazarus you have? 32or 64? And the dll?

DiCri

  • Full Member
  • ***
  • Posts: 151
  • My goal : Build a game
    • http://manueldicriscito.altervista.org/DinoLand.zip
Re: Help SDL2 Installation on Lazarus
« Reply #2 on: September 14, 2016, 04:29:48 pm »
Usually you put the headers with your source, in the same folder. And the dll in the folder of the executable.

Remember if you have 32 bit dll you need to compiled with 32 bit lazarus or cross-compile to 32 bit if you have the 64 bit lazarus.

Wich lazarus you have? 32or 64? And the dll?
First link i saw on the website.. It says "lazarus win 32 and 64 (direct download)" i don't know if it is 32 bit or 64 bit.. SDL2 is "win32-x86".. ..so?
I'm a game developer.. Now studying..
Go download my game:
http://manueldicriscito.altervista.org/DinoLand.zip

lainz

  • Hero Member
  • *****
  • Posts: 1841
  • Nace una flor, todos los días sale el sol...
    • BGRABitmap
Re: Help SDL2 Installation on Lazarus
« Reply #3 on: September 14, 2016, 04:42:25 pm »
Search your Lazarus setup file.

If says win32 is 32 bits.
If says win64 is 64 bits.

Or you can go to Lazarus > Help > About Lazarus and tell me the last line.

SDL is 32 bits, "x86" is 32 bits.
« Last Edit: September 14, 2016, 04:44:53 pm by lainz »

DiCri

  • Full Member
  • ***
  • Posts: 151
  • My goal : Build a game
    • http://manueldicriscito.altervista.org/DinoLand.zip
Re: Help SDL2 Installation on Lazarus
« Reply #4 on: September 14, 2016, 04:44:36 pm »
Search your Lazarus setup file.

If says win32 is 32 bits.
If says win64 is 64 bits.

SDL is 32 bits, "x86" is 32 bits.
Setup file is "lazarus-1.6.0-fpc-3.0.0-win32" seems to be 32 bit.. I know error 0x000007b can be caused from contrast by 32 and 64 bit.
I'm a game developer.. Now studying..
Go download my game:
http://manueldicriscito.altervista.org/DinoLand.zip

lainz

  • Hero Member
  • *****
  • Posts: 1841
  • Nace una flor, todos los días sale el sol...
    • BGRABitmap
Re: Help SDL2 Installation on Lazarus
« Reply #5 on: September 14, 2016, 04:47:05 pm »
So it's ok, it should work.

Try this:
- create a new project (Project > New Project > Simple program)
- save it
- paste your code in the main unit
- paste the header units in the same folder you saved the project
- paste the dll in the same folder you saved the project

Run and test again.

DiCri

  • Full Member
  • ***
  • Posts: 151
  • My goal : Build a game
    • http://manueldicriscito.altervista.org/DinoLand.zip
Re: Help SDL2 Installation on Lazarus
« Reply #6 on: September 14, 2016, 05:02:59 pm »
So it's ok, it should work.

Try this:
- create a new project (Project > New Project > Simple program)
- save it
- paste your code in the main unit
- paste the header units in the same folder you saved the project
- paste the dll in the same folder you saved the project

Run and test again.
I told it's not a compile error.. Exe file doesn't work.. 0x000007b encountered
I'm a game developer.. Now studying..
Go download my game:
http://manueldicriscito.altervista.org/DinoLand.zip

DiCri

  • Full Member
  • ***
  • Posts: 151
  • My goal : Build a game
    • http://manueldicriscito.altervista.org/DinoLand.zip
Re: Help SDL2 Installation on Lazarus
« Reply #7 on: September 14, 2016, 05:06:58 pm »
That's strange.. After compiling. In the project directory there's a new folder called "lib" in which there is another folder called "x86_x64-win32" with sdl units and my game title with .compiled extension.. So why it compiles in 64 bits?
I'm a game developer.. Now studying..
Go download my game:
http://manueldicriscito.altervista.org/DinoLand.zip

DiCri

  • Full Member
  • ***
  • Posts: 151
  • My goal : Build a game
    • http://manueldicriscito.altervista.org/DinoLand.zip
Re: Help SDL2 Installation on Lazarus
« Reply #8 on: September 14, 2016, 05:11:49 pm »
That's strange.. After compiling. In the project directory there's a new folder called "lib" in which there is another folder called "x86_x64-win32" with sdl units and my game title with .compiled extension.. So why it compiles in 64 bits?
I'm wrong.. It was "x86_64 win64"...
I tried to go on about button in lazarus and it says
x86_64-win64-win32/win64, as i told "win32 and win64".. So how to set win32 and not win64? Reinstall it again?
I'm a game developer.. Now studying..
Go download my game:
http://manueldicriscito.altervista.org/DinoLand.zip

lainz

  • Hero Member
  • *****
  • Posts: 1841
  • Nace una flor, todos los días sale el sol...
    • BGRABitmap
Re: Help SDL2 Installation on Lazarus
« Reply #9 on: September 14, 2016, 05:38:38 pm »
That's strange.. After compiling. In the project directory there's a new folder called "lib" in which there is another folder called "x86_x64-win32" with sdl units and my game title with .compiled extension.. So why it compiles in 64 bits?
I'm wrong.. It was "x86_64 win64"...
I tried to go on about button in lazarus and it says
x86_64-win64-win32/win64, as i told "win32 and win64".. So how to set win32 and not win64? Reinstall it again?

So you have lazarus x64.

There is a cross-compiler to compile with it to 32 bits. However it's broken and you need to download separate files (At least I needed to do that, cpp.exe, gcc.exe and windres.exe are missing).

I recommend you to uninstall the 64 bit one and install the 32 bit one:
https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%201.6/

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus