Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 04-24-2024, 03:11 AM   #1
Maimun Ahmed
Mr. Developer
Maimun Ahmed began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Feb 2024
Device: Kindle Voyage
Exclamation How to use my custom Shared object(.so) file in Koreader

Hi there guys. I wanted to use my custom .so file in koreader. Is there any way I can achieve it. I tried putting the file inside of "koreader\base\build\x86_64-linux-gnu-debug\libs" and that works, but just in development.

When I try to put into the file to the libs folder of the actual release version that is installed into my kindle it doesn't work.

Note: I included ffi.load to get the .so file.

Here is an extract of how I am trying to use it (actual code is not in this exact sequence):
Code:
local example = ffi.load("libexample.so")
ffi.cdef("void hello();")

example.hello()
I am unable to describe the terms accurately so i attached the links for reference.

Anyone for help please.
Maimun Ahmed is offline   Reply With Quote
Old 04-24-2024, 04:40 AM   #2
Maimun Ahmed
Mr. Developer
Maimun Ahmed began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Feb 2024
Device: Kindle Voyage
Am I putting the file under wrong directory?
Maimun Ahmed is offline   Reply With Quote
Old 04-24-2024, 04:26 PM   #3
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,675
Karma: 730583
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
When you say "the file," do you mean the exact same file in both cases?

By which I mean the file should be different for amd64 vs arm.
Frenzie is offline   Reply With Quote
Old 04-24-2024, 08:58 PM   #4
Maimun Ahmed
Mr. Developer
Maimun Ahmed began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Feb 2024
Device: Kindle Voyage
Yeah, the same .so file. Firstly, I built the .so file with Golang selecting the OS as linux and architecture as 32 bit/386 (was getting an error in the emulator that 64 bit .so file is not supported).

Everything works fine in the emulator, the .so works exactly as expected but, my kindle says something like:

Code:
Failed to load dynamic library libs/libexample.so. No such file or directory.
As mentioned in the setupkoenv.lua, i am putting the file in the libs folder.
Maimun Ahmed is offline   Reply With Quote
Old 04-25-2024, 06:45 AM   #5
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,675
Karma: 730583
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Kindle requires an ARM 32-bit build.

I don't know Go, but a quick check locally shows:
Code:
go tool dist list | grep linux
linux/386
linux/amd64
linux/arm
linux/arm64
linux/loong64
linux/mips
linux/mips64
linux/mips64le
linux/mipsle
linux/ppc64
linux/ppc64le
linux/riscv64
linux/s390x
The only one that might work is arm.
Frenzie is offline   Reply With Quote
Old 04-29-2024, 09:36 PM   #6
Maimun Ahmed
Mr. Developer
Maimun Ahmed began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Feb 2024
Device: Kindle Voyage
Quote:
Originally Posted by Frenzie View Post
Kindle requires an ARM 32-bit build.
Thanks brother. It indeed solved the problem. Building the .so file for arm completely solves the problem. I wonder why the error message was so misdirecting.
Maimun Ahmed is offline   Reply With Quote
Reply

Tags
developement, kindle, koreader


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
error metawidget file object has no attribute ''opf file'' noemiri Conversion 5 01-10-2024 03:52 PM
Help with "Shared Universe" custom column zaroz Library Management 3 11-24-2021 12:30 PM
Koreader/Nickel Shared Folders jbenwell KOReader 17 06-09-2021 12:35 PM
Error message: Invalid image: cannot identify image file <_io.BytesIO object at 0x000 bkleine Calibre 0 12-11-2020 05:39 PM
HD where is the shared file located? renswic Kindle Fire 0 07-10-2013 12:18 AM


All times are GMT -4. The time now is 11:59 PM.


MobileRead.com is a privately owned, operated and funded community.