Executable Format:Linux makes shared library
Executable Format:Linux makes shared library
I am using PureBasic 5.50 on Linux 18.04. Worked fine on 14.04. Now with the Executable Format set to Linux I get a shared library from Create Executable. Don't know how to make that an executable instead.
Re: Executable Format:Linux makes shared library
What about trying with PB 6.12 ?
Re: Executable Format:Linux makes shared library
Thanks for your reply, Fred. I had tried v6.11 and it would not run at all. Same with v6.12. All the install libraries are the newest version. The setup I have created for v6.12 is exactly the same as for v5.50 apart from the version numbers. v5.50 runs and compiles fine but the problem is Create Executable creates a shared library - probably a DLL - and not an executable program. Info in the INSTALL file cryptically suggests there might be a problem with 18.04. I don't know what is being suggested. I would be happy to stick with v5.50 if it worked.
Info: Required Webkit not available on Ubuntu bigger version 18.04. Support of Webkit2gtk with Purebasic v6.00 (Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04 with gtk3)
Info: Required Webkit not available on Ubuntu bigger version 18.04. Support of Webkit2gtk with Purebasic v6.00 (Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04 with gtk3)
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: Executable Format:Linux makes shared library
There is no Linux 18.04 or 14.04.
Please open a terminal, cd to the executable/shared object and write
Post the output here, please. Then try:
There have been problems in the past with Ubuntu and default PIC/PIE compiler settings in gcc. This made the GUI file browsers sometimes think executables are libraries or something like that .. it has been a long time since I used Ubuntu.
Please open a terminal, cd to the executable/shared object and write
Code: Select all
file your_executable_filename
Code: Select all
chmod +x your_executable_filename
./your_executable_filename
bye,
Daniel
Daniel
Re: Executable Format:Linux makes shared library
There is if you're not being pedantic, Ubuntu does have an 18.04 version, and PB officially supports it.
Re: Executable Format:Linux makes shared library
Happy days, DD! That worked. Thanks a lot|
Ubuntu has been very good for me. What do you use now? Don't say Windows!
Tom
Ubuntu has been very good for me. What do you use now? Don't say Windows!
Tom
Re: Executable Format:Linux makes shared library
For completeness and because DarkDragon requested it here is the output from
file executable_filename
executable_filename: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=6d2303d8b0fba7aa7fe6572b7ac8cb614033e031, stripped
Certainly seems to have been a Ubuntu, g++ clash
file executable_filename
executable_filename: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=6d2303d8b0fba7aa7fe6572b7ac8cb614033e031, stripped
Certainly seems to have been a Ubuntu, g++ clash
Re: Executable Format:Linux makes shared library
chmod -x exec_filename is not required. The executable runs from the terminal anyway. But not from the Files application.
However I can run it from the GUI by creating a .desktop file for it. It's a workaround.
Disappointed v6.12 does not even start to run but v5.50 will probably be all I need.
Thanks again, DarkDragon, for pointing me in the right direction.
However I can run it from the GUI by creating a .desktop file for it. It's a workaround.
Disappointed v6.12 does not even start to run but v5.50 will probably be all I need.
Thanks again, DarkDragon, for pointing me in the right direction.
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: Executable Format:Linux makes shared library
I'm not entirely sure about this, I hoped at least file would be able to identify it as executable, but it doesn't seem to do so. Did you compile it as 32bit executable? Maybe that's a hint, too. Did you try the same as 64bit?kaleid wrote: Tue Sep 17, 2024 11:40 pmfile executable_filename
executable_filename: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=6d2303d8b0fba7aa7fe6572b7ac8cb614033e031, stripped
Certainly seems to have been a Ubuntu, g++ clash
bye,
Daniel
Daniel
Re: Executable Format:Linux makes shared library
DD, the PureBasic software is x86. I did copy the source from a 64bit m/c. But I get the same problem with source that was always in a 32bit m/c.
Wonder if I need a linker options file.
Tom
Wonder if I need a linker options file.
Tom
Re: Executable Format:Linux makes shared library
Pretty sure now the problem is that position-independent executables (PIE) has been enabled for gcc in Ubuntu 18.04. Solution is to provide the -no-pie option for the gcc compiler. But I have no idea how that can be done when using PureBasic. The problem is not confined to executables created by PureBasic. The result is that some executables cannot be run by Files which sees them as shared library files. The executables can be run from the terminal or via a .desktop file.
Any easy fix? DarkDragon?
Tom
Any easy fix? DarkDragon?
Tom
- deeproot
- Enthusiast
- Posts: 284
- Joined: Thu Dec 17, 2009 12:00 pm
- Location: Llangadog, Wales, UK
- Contact:
Re: Executable Format:Linux makes shared library
I don't think this is needed for newer versions, but I have sources that were compiled with many older versions of PB and various OS releases, I simply have the following as the first line of the main source file:
From a tip posted here on the forum some years ago!
Code: Select all
ImportC "-no-pie" : EndImport
Re: Executable Format:Linux makes shared library
Thanks very much, deeproot! That fixed it. And such a simple fix!
Tom
Tom