Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux, FPC] Cannot run my program #151

Open
rchastain opened this issue Jul 6, 2022 · 9 comments
Open

[Linux, FPC] Cannot run my program #151

rchastain opened this issue Jul 6, 2022 · 9 comments

Comments

@rchastain
Copy link

Hello! I am discovering SplashKit. I could install SplashKit and compile a program, but I cannot execute the program.

[roland@localhost splashkit]$ skm fpc example1.pas
Free Pascal Compiler version 3.2.0 [2020/07/05] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling example1.pas
Compiling /home/roland/.splashkit/fpc/SplashKit.pas
SplashKit.pas(1578,13) Note: Call to subroutine "function strpas(p:PChar):ShortString;" marked as inline is not inlined
SplashKit.pas(2089,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2141,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2187,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2233,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2279,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2325,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2371,19) Warning: function result variable of a managed type does not seem to be initialized
Linking example1
15175 lines compiled, 0.8 sec
7 warning(s) issued
1 note(s) issued
🎉  fpc command run successfully 🎉
[roland@localhost splashkit]$ ./example1
bash: ./example1: Aucun fichier ou dossier de ce type
[roland@localhost splashkit]$ file ./example1
./example1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld64.so.1, BuildID[sha1]=6d894d0f7ad7b8eec9e3399f9b30e61ea4054565, for GNU/Linux 2.4.0, stripped

Would you have an explanation (and a solution)?

Regards.

Roland

skm-install.log

@rchastain
Copy link
Author

rchastain commented Jul 6, 2022

Another (maybe related) issue.

I created a Makefile with the following content.

demo: example1.pas
	fpc -Mobjfpc -Sh example1 -Fu/home/roland/.splashkit/fpc/ -k-L/home/roland/.splashkit/lib/linux/ -k-lSplashKit -FUunits

When I type make, I get this error:

[roland@localhost splashkit]$ make
fpc -Mobjfpc -Sh example1 -Fu/home/roland/.splashkit/fpc/ -k-L/home/roland/.splashkit/lib/linux/ -k-lSplashKit -FUunits
make: fpc: Permission non accordée
make: *** [Makefile:3 : demo] Erreur 127
[roland@localhost splashkit]$ 

If I type the command directly in the terminal, it works, I don't understand why.

[roland@localhost splashkit]$ fpc -Mobjfpc -Sh example1 -Fu/home/roland/.splashkit/fpc/ -k-L/home/roland/.splashkit/lib/linux/ -k-lSplashKit -FUunits
Free Pascal Compiler version 3.2.0 [2020/07/05] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling example1.pas
Compiling /home/roland/.splashkit/fpc/SplashKit.pas
SplashKit.pas(1578,13) Note: Call to subroutine "function strpas(p:PChar):ShortString;" marked as inline is not inlined
SplashKit.pas(2089,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2141,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2187,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2233,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2279,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2325,19) Warning: function result variable of a managed type does not seem to be initialized
SplashKit.pas(2371,19) Warning: function result variable of a managed type does not seem to be initialized
Linking example1
15175 lines compiled, 0.9 sec
7 warning(s) issued
1 note(s) issued
[roland@localhost splashkit]$

@rchastain
Copy link
Author

Another thing, not very important, but while I am here...

I had to convert line endings of all text files in .splashkit directory. Before that, the skm command didn't work:

[roland@localhost pascal]$ skm linux install
bash: /home/roland/.splashkit/skm : /bin/sh^M : mauvais interpréteur: Aucun fichier ou dossier de ce type

Thanks for your attention.

@rchastain
Copy link
Author

Another (maybe related) issue.

I created a Makefile with the following content.

demo: example1.pas
	fpc -Mobjfpc -Sh example1 -Fu/home/roland/.splashkit/fpc/ -k-L/home/roland/.splashkit/lib/linux/ -k-lSplashKit -FUunits

If I replace, in the Makefile, fpc with /usr/bin/fpc, it solves the problem. I wonder whether there isn't a conflict with the folder named fpc in .splashkit directory.

@rchastain
Copy link
Author

Hello! I am discovering SplashKit. I could install SplashKit and compile a program, but I cannot execute the program.

I found why the program couldn't be executed. The file /lib/ld64.so.1 didn't exist.

[roland@localhost splashkit]$ file example1
example1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld64.so.1, BuildID[sha1]=2156e9b0a3bf00355dcaeb803f8d82226103dee9, for GNU/Linux 2.4.0, stripped

I made this and now I can execute the program:

sudo ln -s /usr/lib64/ld-linux-x86-64.so.2 /lib/ld64.so.1

@rchastain
Copy link
Author

The other issue remains. Since I installed SplashKit, I no longer can call fpc or clang++ from a Makefile. It would be good to have a solution for that.

@rchastain
Copy link
Author

The other issue remains. Since I installed SplashKit, I no longer can call fpc or clang++ from a Makefile. It would be good to have a solution for that.

It looks like I found a solution. I made the following modification in ~/.bash_profile and in ~/.bashrc.

##export PATH="/home/roland/.splashkit:$PATH"
export PATH="$PATH:/home/roland/.splashkit"

No I can call fpc (or clang++) from a Makefile. And skm fpc myprog still works.

Regards.

Roland

@jakerenzella jakerenzella reopened this Jul 9, 2022
@jakerenzella
Copy link
Member

Thanks @rchastain - I think this is worth re-opening to address the path issue. Seems like a reasonable change to me to append splashkit to the end of the path.

Let us know if you end up building something!

@rchastain
Copy link
Author

rchastain commented Jul 9, 2022

Thanks @rchastain - I think this is worth re-opening to address the path issue. Seems like a reasonable change to me to append splashkit to the end of the path.

Good!

Let us know if you end up building something!

Yes I will let you know. As an exercise, I started to translate to Pascal a game that I found on GitHub. I will create a repository when it is done.

@rchastain
Copy link
Author

Let us know if you end up building something!

I finished my adaptation of Chicken Hunt. It was very easy. Great library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants