View Single Post
Old 09-15-2012, 09:28 PM   #629
Kai771
Just a Noob
Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.
 
Kai771's Avatar
 
Posts: 140
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
Hi,

I tried to compile KPDFViewer, but I was unsuccessful. I'm a total noob with this, so don't be surprised if you read something stupid. This is what I did:

I have a Windows 7 64-bit box, so I made a Virtual machine using VirtualBox and installed Ubuntu 12.04 Desktop 32-bit, with default settings. (It shouldn't matter that I'm using a virtual machine, but I'm stating it for completeness sake).

In my previous attempts I realised that default installation lacked some packets, so this time I added them first:

Code:
$ sudo apt-get install git

$ sudo apt-get install g++

$ sudo apt-get install lua5.1

$ sudo apt-get install cmake

$ sudo apt-get install libsdl1.2-all

$ sudo apt-get install libsdl1.2-dev

$ sudo apt-get install gcc-arm-linux-gnueabi

$ sudo apt-get install g++-arm-linux-gnueabi
(I know I could've added them all in one line, but since I added them one by one... )


Then, I cloned the repository (I hope this is the correct terminology... I never used git before):

and then

Code:
$ cd kindlepdfviewer
Then I edited Makefile, changing

Code:
HOST:=arm-none-linux-gnueabi
into
Code:
HOST:=arm-linux-gnueabi
after that, I did:

Code:
$ make fetchthirdparty
This far everything seemed to be ok. From this point on, I did 2 separate attempts: A - make for ARM and B - make for emulation.


A - Make for ARM
-----------------

Code:
$ make thirdparty
I had some warnings here, mostly "defined but not used", but it seemingly went ok, too. I have full log files, but since they're kinda long, I'm reluctant to attach them if it's not necessary. Here are a few of the last lines:

Code:
[ 96%] Building CXX object crengine/crengine/CMakeFiles/crengine.dir/src/chmfmt.cpp.o
[ 97%] Building CXX object crengine/crengine/CMakeFiles/crengine.dir/src/epubfmt.cpp.o
[ 98%] Building CXX object crengine/crengine/CMakeFiles/crengine.dir/src/pdbfmt.cpp.o
[100%] Building CXX object crengine/crengine/CMakeFiles/crengine.dir/src/wordfmt.cpp.o
Linking CXX static library libcrengine.a
make[3]: Leaving directory `/home/kai771/kindlepdfviewer/kpvcrlib'
[100%] Built target crengine
make[2]: Leaving directory `/home/kai771/kindlepdfviewer/kpvcrlib'
make[1]: Leaving directory `/home/kai771/kindlepdfviewer/kpvcrlib'
Then I did

Code:
$ make kpdfview
This didn't end that well. A few of the last lines:

Code:
crtxtenc.cpp:(.text._ZN16CDoubleCharStat25CloseEv[CDoubleCharStat2::Close()]+0x10): undefined reference to `operator delete[](void*)'
crtxtenc.cpp:(.text._ZN16CDoubleCharStat25CloseEv[CDoubleCharStat2::Close()]+0x20): undefined reference to `operator delete[](void*)'
kpvcrlib/crengine/crengine/libcrengine.a(crtxtenc.cpp.o):(.rodata._ZTI16CDoubleCharStat2[typeinfo for CDoubleCharStat2]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
kpvcrlib/crengine/thirdparty/libpng/libpng.a(pngrtran.c.o): In function `png_build_gamma_table':
pngrtran.c:(.text+0x35a4): undefined reference to `pow'
pngrtran.c:(.text+0x36d8): undefined reference to `pow'
pngrtran.c:(.text+0x380a): undefined reference to `pow'
pngrtran.c:(.text+0x3914): undefined reference to `pow'
pngrtran.c:(.text+0x39d8): undefined reference to `pow'
kpvcrlib/crengine/thirdparty/libpng/libpng.a(pngrtran.c.o):pngrtran.c:(.text+0x3a70): more undefined references to `pow' follow
collect2: ld returned 1 exit status
make: *** [kpdfview] Error 1
Now, I should've probably used Code Sourcery toolchain here instead of Linaro that goes with Ubuntu? Do I need to use scratchbox2? Copy libraries from Kindle? How? Anyone cares to explain?




B - Make for Emulation
-----------------------

Unrelated to the A above, I did this for emulation:

Code:
$ EMULATE_READER_W=600 EMULATE_READER_H=800 EMULATE_READER=1 make thirdparty
Similar to previous attempt, some warnings, but seemingly ok. Few of the last log lines:

Code:
[ 96%] Building CXX object crengine/crengine/CMakeFiles/crengine.dir/src/chmfmt.cpp.o
[ 97%] Building CXX object crengine/crengine/CMakeFiles/crengine.dir/src/epubfmt.cpp.o
[ 98%] Building CXX object crengine/crengine/CMakeFiles/crengine.dir/src/pdbfmt.cpp.o
[100%] Building CXX object crengine/crengine/CMakeFiles/crengine.dir/src/wordfmt.cpp.o
Linking CXX static library libcrengine.a
make[3]: Leaving directory `/home/kai771/kindlepdfviewer/kpvcrlib'
[100%] Built target crengine
make[2]: Leaving directory `/home/kai771/kindlepdfviewer/kpvcrlib'
make[1]: Leaving directory `/home/kai771/kindlepdfviewer/kpvcrlib'
Then, I did:

Code:
$ EMULATE_READER_W=600 EMULATE_READER_H=800 EMULATE_READER=1 make kpdfview
and got this in the end

Code:
kpvcrlib/crengine/crengine/libcrengine.a(crtxtenc.cpp.o):(.rodata._ZTI16CDoubleCharStat2[typeinfo for CDoubleCharStat2]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
kpvcrlib/crengine/crengine/libcrengine.a(crtxtenc.cpp.o):(.eh_frame+0xdb): undefined reference to `__gxx_personality_v0'
kpvcrlib/crengine/thirdparty/libpng/libpng.a(pngrtran.c.o): In function `png_build_gamma_table':
/home/kai771/kindlepdfviewer/kpvcrlib/crengine/thirdparty/libpng/pngrtran.c:4041: undefined reference to `pow'
/home/kai771/kindlepdfviewer/kpvcrlib/crengine/thirdparty/libpng/pngrtran.c:4171: undefined reference to `pow'
/home/kai771/kindlepdfviewer/kpvcrlib/crengine/thirdparty/libpng/pngrtran.c:4143: undefined reference to `pow'
/home/kai771/kindlepdfviewer/kpvcrlib/crengine/thirdparty/libpng/pngrtran.c:4197: undefined reference to `pow'
/home/kai771/kindlepdfviewer/kpvcrlib/crengine/thirdparty/libpng/pngrtran.c:4220: undefined reference to `pow'
kpvcrlib/crengine/thirdparty/libpng/libpng.a(pngrtran.c.o):/home/kai771/kindlepdfviewer/kpvcrlib/crengine/thirdparty/libpng/pngrtran.c:4057: more undefined references to `pow' follow
collect2: ld returned 1 exit status
make: *** [kpdfview] Error 1
So, what am I doing wrong? Am I wrong to think that the choice and even presence of ARM compiler has nothing to do with building it for device emulation? Again, I have the full logs of the make output, and I can attach them if needed, but I get the feeling that I'm missing something simple, something that an experienced developer would spot from a mile away .

Thanks for your patience.
Kai771 is offline   Reply With Quote