borzunov / remoteink

📖 🖥️ Turns PocketBook E-Ink reader into a computer monitor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remoteinkd: How to "BUILD=emu" : issues and helps

calcreg opened this issue · comments

How to manage the "build=emu" on compiling the executable (of remoteinkd) for emulation of a pocketbook application under linux.

Sound easy but you might encounter problems. That is to say the BUILD=gnueabi works fine, but when it is time to compile the application with BUILD=emu for emulation and test it on linux desktop, lots of problems occur.

  1. Doesn't find the libinkview.so, problems of freetype/freetype.h, ft2build.h, etc.
    exemple : inkview.h:25:22: fatal error: ft2build.h: Aucun fichier ou dossier de ce type

  2. in the linkers'pass, it just doesn't have the dependancies with other libraries or can't find them..

  3. Once he application is compiled fine : when it is time to run it, it just doesn't find the shared libray libinkview.so .

The idea is to start from scratch with the SDK downloadable from github for pocketbook (link).
Assuming you have placed the SDK in the drawer : $HOME/project

ls $HOME/project may give you more or less something like :
development ldconfig.txt readme.txt sources
FRSCSDK ldconf.txt PBSDK releases system

PBSDK/lib contains the important shared library : libinkview.so .

For compiling, you will need to know where to find the freetype on your computer.
Use : freetype-config --cflags
on my config i get : -I/usr/include/freetype2
for linker's pass :
Use : freetype-config --libs
on my config i get : -L/usr/lib/i386-linux-gnu -lfreetype -lz -lpng12

if you don't have freetype-config installed, just do : sudo apt-get install freetype-config

for the compiler to locate inkview.h  : -I$(SDKDIR)/FRSCSDK/include/

Therefore the file common.mk has to be updated with the following changes : ---------------------

Make sure SDKDIR points to the right drawer SDKDIR=…/project

ifeq ($(BUILD), emu)
PROJECT = $(OBJDIR)/$(OUT)
LIBS += -linkview
INCLUDES += -I$(SDKDIR)/FRSCSDK/include/ `freetype-config --cflags`
CC = gcc
CFLAGS += -O0 -D__EMU__ -DIVSAPP -g -m32
CXX = g++
CXXFLAGS += -O0 -D__EMU__ -DIVSAPP -g -m32
LD = g++
LDFLAGS += -m32
endif


When compiled correctly, launch the executable file found in ./obj_emu
If it doesn't find the shared library libinkview.so then you will need to copy libinkview.so to a directory where the program is looking for it.
To know where, just type in a terminal :

export LD_DEBUG=libs

Then launch the program in the terminal. You will see all the locations where it is searching for the library. Just find one place and copy libinkview.so from PBSDK to this new location.

One of the locations where you can copy libinkview.so is :
/usr/lib

(export LD_DEBUG = ) to remove the option.

Your emulation of the application for pocketbook should launch correctly now.

Thank you! I've added a link to these instructions to the readme.