AsmBB

Power
Login Register
Threads Categories Chat

Help importing shared library

tomb (ツ)

Hi,

Using Fresh IDE I have been having trouble using shared c library GLFW.

Currently I have a blank file in freshlib/equates/_glfw.inc, and modified allequates.inc to have the line

include '_glfw.inc'

In freshlib/imports/Linux I have glfw.inc

import_proto 'libglfw.so.3.4',\ glfwInit, <VOID>, 'glfwInit',\ glfwTerminate, <VOID>, 'glfwTerminate'

Then in my test program I have simply

include "%lib%/freshlib.inc" @BinaryType GUI, compact include "%lib%/freshlib.asm" uses glfw start: InitializeAll cinvoke glfwInit FinalizeAll stdcall TerminateAll, 0

This assembles fine but when running the executable I get

Terminal

error while loading shared libraries: libglfw.so.3.4: cannot open shared object file: No such file or directory

The shared lib libglfw.so.3.4 in in the local directory(with the executable) as well as usr/local/lib so it should be found.

Any idea what I might be doing wrong?

tomb (ツ)

Ok so it only seems to be looking in usr/lib directory I put the file in there and it gives a new error.

Terminal

./main: error while loading shared libraries: libglfw.so.3.4: wrong ELF class: ELFCLASS64

Guess it needs recompiling.

johnfound (ツ)
tomb

Ok so it only seems to be looking in usr/lib directory I put the file in there and it gives a new error.

Terminal

./main: error while loading shared libraries: libglfw.so.3.4: wrong ELF class: ELFCLASS64

Guess it needs recompiling.

Unfortunately, FreshLib is for now a 32bit library and it creates a 32bit executable. That is why it can't dynamically link to the 64bit library libglfw.so.3.4;

So you need to have the 32bit version of this library. If this is standard Linux (OpenGL?) library there should be 32bit version in the Linux repository. If not, you should compile it yourself.

ganuonglachanh (ツ)

It's good to see someone interested in FreshLib rofl

I'm reading it's document and Asmbb source code, since I'm still learning Asm ( from the very beginning level :'-( )

May I ask how you are using FreshIDE : Windows with andLinux or only Linux with Wine?

I'm using WinXP but the help function does not run correctly, still figuring it out :-)

tomb (ツ)
ganuonglachanh

It's good to see someone interested in FreshLib rofl

I'm reading it's document and Asmbb source code, since I'm still learning Asm ( from the very beginning level :'-( )

May I ask how you are using FreshIDE : Windows with andLinux or only Linux with Wine?

I'm using WinXP but the help function does not run correctly, still figuring it out :-)

I'm also new to Asm. Currently using FreshIDE on linux with wine. It works really well no issues so far, assembled Windows executables run without a problem on my Linux system.

johnfound (ツ)
ganuonglachanh

It's good to see someone interested in FreshLib rofl

I'm reading it's document and Asmbb source code, since I'm still learning Asm ( from the very beginning level :'-( )

May I ask how you are using FreshIDE : Windows with andLinux or only Linux with Wine?

I'm using WinXP but the help function does not run correctly, still figuring it out :-)

I am using Fresh IDE in Linux (Manjaro/Arch), with WINE. This settings allows me to work simultaneously on Windows and Linux (and portable) applications.

This is impossible in Windows right now, because andLinux and generally coLinux are deprecated and not working anymore on 64bit Windows. I have made some attempt to use WSL like a Linux compatible layer in Windows, but unsuccessfully so far.

Anyway, I am not planning to implement new features in Fresh IDE v2.x. Only critical bug fixes will be provided. Right now the development is focused on the portable Fresh IDE v3.0;

But anyway, what is wrong with the help function? I am asking, because the codebase for the help functions is pretty portable and will be used in v3.0 as well. So fixing possible bugs is OK then.

Help importing shared library

©2016..2020 John Found; Licensed under EUPL; AsmBB v2.8 (check-in: 6d0d9d4bca1af5dd); SQLite v3.31.1 (check-in: 3bfa9cc97da10598); Powered by Assembly language; Created with Fresh IDE;