Recent

Author Topic: any one knows how to set the environment in linux?  (Read 1765 times)

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
any one knows how to set the environment in linux?
« on: June 03, 2023, 10:59:03 am »
any one knows how to set the environment in linux?
i want to install the SDL2 libs.
all files and libs is downed and installed to the /usr/ folders.
but when i input "sudo make"to switch game examples sourcecodes,
 allways show no sdl2 packages found.
need to set the PKG_CONFIG_PATH to do that.
i do not know how to get it.

Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Re: any one knows how to set the environment in linux?
« Reply #1 on: June 03, 2023, 01:09:05 pm »
Under nixes it is called export.
https://linuxhandbook.com/export-command/
« Last Edit: June 03, 2023, 01:11:26 pm by Thaddy »
Specialize a type, not a var.

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: any one knows how to set the environment in linux?
« Reply #2 on: June 03, 2023, 02:14:24 pm »
If you want the env var set just for one command, just set it on the command line before the command -

Code: Pascal  [Select][+][-]
  1. PKG_CONFIG_PATH="/some/path"  sudo make [enter]

If you want it always set, for your session, set it, with export, as Thaddy mentioned, in your .bashrc file, and call source on it (or restart session).

Code: Pascal  [Select][+][-]
  1. echo "export PKG_CONFIG_PATH="/some/path" >> ~/.bashrc  [enter]
  2. source ~/.bashrc   [enter]

Note, that will not set it for a GUI app started from the linux GUI (as opposed from the command line). To do that you can add it in places like .xsessionrc

But, as Thaddy suggests, reading manuals is a good idea.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
Re: any one knows how to set the environment in linux?
« Reply #3 on: June 03, 2023, 02:18:01 pm »
thanks for reply
you have compiled the SDL2 libs?
my first problem is now can not find <SDL.h>
but this file is in /usr/include folder
the second is that said can not found sdl2.pc package in
the PKG_CONFIG_PATH

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
Re: any one knows how to set the environment in linux?
« Reply #4 on: June 03, 2023, 05:17:51 pm »
may be the include file is the important.
how to slove it?

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: any one knows how to set the environment in linux?
« Reply #5 on: June 04, 2023, 01:10:22 am »
No, I have never used SDL.

It sounds to me like you need to speak to the SDL people, not here.

The 'normal' model is you would build something like sdl in a dir inside you own space, using the source tree and running make from the right place. That way, the make file knows where everything it needs is. Once built correctly, you may then install it into places like /use/include. 

If the include files have got to /usr/include, then you must have already compiled (successfully) sdl and now want to compile your own app, dependent on the sdl libraries. ??

But, as I said, never built or used SDL.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
Re: any one knows how to set the environment in linux?
« Reply #6 on: June 04, 2023, 06:51:53 am »
No, I have never used SDL.

It sounds to me like you need to speak to the SDL people, not here.

The 'normal' model is you would build something like sdl in a dir inside you own space, using the source tree and running make from the right place. That way, the make file knows where everything it needs is. Once built correctly, you may then install it into places like /use/include. 

If the include files have got to /usr/include, then you must have already compiled (successfully) sdl and now want to compile your own app, dependent on the sdl libraries. ??

But, as I said, never built or used SDL.

Davo

yes, i feel it very hard.

Seenkao

  • Hero Member
  • *****
  • Posts: 544
    • New ZenGL.
Re: any one knows how to set the environment in linux?
« Reply #7 on: June 04, 2023, 11:41:41 pm »
any one knows how to set the environment in linux?
i want to install the SDL2 libs.
all files and libs is downed and installed to the /usr/ folders.
but when i input "sudo make"to switch game examples sourcecodes,
 allways show no sdl2 packages found.
need to set the PKG_CONFIG_PATH to do that.
i do not know how to get it.
Установите пакет libsdl2-dev.
В любой ситуации, если не хватает каки-то библиотек, проверьте установлены у вас данные библиотеки с окончанием -dev.

Google translate:
Install the libsdl2-dev package.
In any situation, if some libraries are missing, check if you have installed these libraries with the ending -dev.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

TRon

  • Hero Member
  • *****
  • Posts: 2398
Re: any one knows how to set the environment in linux?
« Reply #8 on: June 05, 2023, 08:54:37 am »
As user Seenkao already wrote: You do not need to compile our own version of libsdl2 unless your distro does not provide libsdl2 (as a package) or in case you want to 'build' something special.

First try to find a (valid/safe) repository for your distribution that does provide the libsdl2(-dev) package or follow lib sdl build instructions.

In order for the Free Pascal compiler to pick up on the correct versioning of the libsdl2 related .so files the -dev package installation is required unless you know what you are doing.

Questions that arise are most probably related to your distribution rather than related to Free Pascal and/or libSDL2.

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
Re: any one knows how to set the environment in linux?
« Reply #9 on: June 18, 2023, 04:31:02 pm »
thanks all.

 

TinyPortal © 2005-2018