AsmBB

Power
Login Register

Help importing shared library
0

#16006 (ツ) tomb
Created 15.02.2020, read: 4974 times

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?

#16007 (ツ) tomb
Created 15.02.2020, read: 4972 times

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.

#16008 (ツ) johnfound
Created 16.02.2020, read: 4968 times
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.

#16009 (ツ) ganuonglachanh
Created 18.02.2020, read: 4948 times

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 :-)

#16010 (ツ) tomb
Created 18.02.2020, read: 4944 times
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.

#16011 (ツ) johnfound
Created 18.02.2020, read: 4935 times
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
0

AsmBB v3.0 (check-in: a316dab8b98d07d9); SQLite v3.42.0 (check-in: 831d0fb2836b71c9);
©2016..2023 John Found; Licensed under EUPL. Powered by Assembly language Created with Fresh IDE