Recent

Author Topic: Linux, the compiled program does not start.  (Read 1787 times)

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Linux, the compiled program does not start.
« on: November 24, 2020, 09:45:18 pm »
Всем привет!
Компилирую программу и запускаю в IDE - работает.

Запускаю скомпилированную программу из графической оболочки, не запускается.
Запускаю из командной строки - работает.

Раньше программы работали и из графической оболочки.
(просьба не предлагать создавать *.sh файл для запуска, это я знаю)

google translate:
Hello!
I compile the program and run it in the IDE - it works.

I run the compiled program from the graphical shell, it does not start.
I run it from the command line - it works.

Previously, programs worked from the graphical shell.
(please do not offer to create a * .sh file to run, I know that)
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

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

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Re: Linux, the compiled program does not start.
« Reply #1 on: November 24, 2020, 09:50:41 pm »
Что происходит? Несколько часов мучаюсь с этой проблемой. Только отписался и всё стало запускаться как надо. %)

google translate:
What's happening? I have been suffering with this problem for several hours. I just unsubscribed and everything started to run as it should.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

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

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Linux, the compiled program does not start.
« Reply #2 on: November 24, 2020, 09:56:07 pm »
Maybe misses the execute attribute somehow, and GDB doesn't care?

Try

chmod +x <executable>

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Re: Linux, the compiled program does not start.
« Reply #3 on: November 24, 2020, 10:07:54 pm »
Как я это буду объяснять пользователям программы или программистам использующим мою библиотеку?

Google translate:
How will I explain this to program users or programmers using my library?
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

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

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Linux, the compiled program does not start.
« Reply #4 on: November 24, 2020, 10:30:37 pm »
The problems of binary distribution on Linux are not FPC specific, ask on a Linux forum.

zoltanleo

  • Sr. Member
  • ****
  • Posts: 486
Re: Linux, the compiled program does not start.
« Reply #5 on: November 25, 2020, 08:34:02 am »
[rus]
Соглашусь с предыдущим оратором. Это фишки линуха, некоторым файлам необходимо присваивать аттрибут исполняемого файла. Пользователи Линукса обычно об этом осведомлены.

[eng]
I agree with marcov. This is a Linux feature, some files need to be assigned an executable file attribute. Linux users are usually aware of this.
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Linux, the compiled program does not start.
« Reply #6 on: November 25, 2020, 08:59:20 am »
Freepascal also creates files executable as such. If it isn't, it is an atypical Linux configuration thing (umask, readonly filesystem or security systems)
« Last Edit: November 25, 2020, 10:36:03 am by marcov »

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Linux, the compiled program does not start.
« Reply #7 on: November 25, 2020, 09:04:02 am »
Yes. But sometimes we need chmod +x
Specialize a type, not a var.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Linux, the compiled program does not start.
« Reply #8 on: November 25, 2020, 09:04:48 am »
Yes. But sometimes we need chmod +x

Usually after network transfer, but that is not a FPC issue.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Linux, the compiled program does not start.
« Reply #9 on: November 25, 2020, 09:26:51 am »
Yes. But sometimes we need chmod +x

sftp preserves attributes, ftp doesn't. EAs such as POSIX capabilities are lost in both cases. If the program runs from the shell then that's the end of the FPC/Lazarus responsibilities.

Statements like "I just unsubscribed and everything started to run as it should" hardly help resolve the problem.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Re: Linux, the compiled program does not start.
« Reply #10 on: November 25, 2020, 11:01:24 am »
Благодарю за помощь. Но хотелось бы чтоб всё работало стабильно! И знать в чём именно проблема, чтоб всё вернуть в стабильное положение.

Зачастую бывают какие-то глюки. И я переустанавливаю Lazarus, FPC, чтоб понять, что именно не так.
А то ткнул - работает, ткнул - не работает.
В угадайку играем?

Google translate:
Thank you for your help. But I would like everything to work stably! And to know what exactly the problem is, in order to return everything to a stable position.

Often there are some glitches. And I reinstall Lazarus, FPC to figure out what exactly is wrong.
And then poked - works, poked - does not work.
Are we playing a guessing game?
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

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

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Re: Linux, the compiled program does not start.
« Reply #11 on: November 25, 2020, 11:34:33 am »
Я бы не писал о проблеме. Но выявилась она довольно странно.
Я запустил приложение в Lazarus (OpenGL) и оно запустилось нормально. Но, когда я запустил это же приложение из графической оболочки, оно запустилось, а вот текстуры не работали. Как показывали логи, текстуры загружались, но на экране не прорисовывались. И если не было примитивов (линий, треугольников и прочего), то было бы непонятно, что приложение достаточно нормально работает.

Возможно проблема в том что я периодически запускал оболочку с правами супер-пользователя?

google translate:
I would not write about the problem. But it turned out to be rather strange.
I ran the application in Lazarus (OpenGL) and it started up fine. But, when I launched the same application from the graphical shell, it started, but the textures did not work. As the logs showed, the textures were loaded, but they were not drawn on the screen. And if there were no primitives (lines, triangles, etc.), then it would be incomprehensible that the application works well enough.

Perhaps the problem is that I periodically run the shell with super-user rights?
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

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

zoltanleo

  • Sr. Member
  • ****
  • Posts: 486
Re: Linux, the compiled program does not start.
« Reply #12 on: November 25, 2020, 12:19:06 pm »
[rus]
Ты бы выложил минимально воспроизводимый пример. Поверь, так решения находятся гораздо быстрее.

[eng]
A minimal test case is needed that reproduces the problem.
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Re: Linux, the compiled program does not start.
« Reply #13 on: November 25, 2020, 01:43:51 pm »
Video
И после всех этих действий начинает всё нормально запускаться из графической оболочки.

google translate:
And after all these actions, everything starts to start normally from the graphical shell.

ZenGL 3.25 - any demo.
« Last Edit: November 25, 2020, 01:49:28 pm by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

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

justnewbie

  • Sr. Member
  • ****
  • Posts: 292
Re: Linux, the compiled program does not start.
« Reply #14 on: November 25, 2020, 01:48:57 pm »
Я бы не писал о проблеме. Но выявилась она довольно странно.
Я запустил приложение в Lazarus (OpenGL) и оно запустилось нормально. Но, когда я запустил это же приложение из графической оболочки, оно запустилось, а вот текстуры не работали. Как показывали логи, текстуры загружались, но на экране не прорисовывались. И если не было примитивов (линий, треугольников и прочего), то было бы непонятно, что приложение достаточно нормально работает.

Возможно проблема в том что я периодически запускал оболочку с правами супер-пользователя?

google translate:
I would not write about the problem. But it turned out to be rather strange.
I ran the application in Lazarus (OpenGL) and it started up fine. But, when I launched the same application from the graphical shell, it started, but the textures did not work. As the logs showed, the textures were loaded, but they were not drawn on the screen. And if there were no primitives (lines, triangles, etc.), then it would be incomprehensible that the application works well enough.

Perhaps the problem is that I periodically run the shell with super-user rights?
I'm not sure at all, but isn't it a $PATH problem?
https://linuxize.com/post/how-to-add-directory-to-path-in-linux/
https://opensource.com/article/17/6/set-path-linux

 

TinyPortal © 2005-2018