Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-12-2017, 09:58 AM   #1
jacobr8893
Junior Member
jacobr8893 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2017
Device: Kindle Touch (K5)
Having problems compiling gtk code for kindle touch

I have a jailbroken kindle touch. I want to write native apps (for example a reddit client), so I searched for how to compile gtk code for it and found this post: https://www.mobileread.com/forums/sh...d.php?t=189372.

Everything goes fine and I can compile it with regular gcc for my laptop. I've gotten the libs from the kindle and followed the tutorial all the way up to cross compiling the test program. When I run the long command starting with arm-linux-gnueabi-gcc I get output that looks like this:

Code:
In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9:0,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/glib-2.0/gobject/gbinding.h:28,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from gtktest.c:1:
/usr/include/glib-2.0/glib/gtypes.h: In function ‘_GLIB_CHECKED_ADD_U64’:
/usr/include/glib-2.0/glib/gmacros.h:232:53: error: size of array ‘_GStaticAssertCompileTimeAssertion_0’ is negative
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                                     ^
/usr/include/glib-2.0/glib/gmacros.h:229:47: note: in definition of macro ‘G_PASTE_ARGS’
 #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
                                               ^
/usr/include/glib-2.0/glib/gmacros.h:232:44: note: in expansion of macro ‘G_PASTE’
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                            ^
/usr/include/glib-2.0/glib/gtypes.h:423:3: note: in expansion of macro ‘G_STATIC_ASSERT’
   G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
   ^
So, from searching for that error, I think that means I need to use a gtk header that is for arm. I'm not sure where to get that though or how to specify that to gcc. Does anyone know what I need to do to make sure the right arm headers and libs are used? I am new to gtk; I've written one small image sorting app before on an x84_64 machine but that's all.

Info about my os and packages:
I am using debian linux stretch (I think it's also called testing, since sid is what unstable is called). The arm-linux-gnueabi I have is arm-linux-gnueabi-5, because the version in the tutorial isn't in my apt repos.
jacobr8893 is offline   Reply With Quote
Old 01-12-2017, 10:17 AM   #2
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Just follow the directions without the changes you have introduced.

The directions are five years old and so is your Kindle Touch - they match.
Use the versions as described.

You can not expect current software to match what is on your Kindle Touch.
knc1 is offline   Reply With Quote
Old 01-12-2017, 10:19 AM   #3
jacobr8893
Junior Member
jacobr8893 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2017
Device: Kindle Touch (K5)
I think the only change I made was to use different version of gcc. So, if I use that exact version of gcc-armeabi, then that will most likely solve my problem?
jacobr8893 is offline   Reply With Quote
Old 01-12-2017, 10:35 AM   #4
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by jacobr8893 View Post
I think the only change I made was to use different version of gcc. So, if I use that exact version of gcc-armeabi, then that will most likely solve my problem?
Have you gotten the example in that post working yet?
If not, repeat, carefully, what is written.

The very first line of the code you quoted tells you the source of your problem and one of the things you are doing differently.

We really don't have anyone here with the time to teach programming or direction following.
knc1 is offline   Reply With Quote
Old 01-12-2017, 11:23 AM   #5
jacobr8893
Junior Member
jacobr8893 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2017
Device: Kindle Touch (K5)
So, I ran pkg-config by its self, and figured out that is where the x86_64 stuff is coming from. So, right now I'm going though all of those -I includes and replacing them with the ones in the lib from the touch. Some things aren't there though, so I'll see how that works when it's done. I just have no idea where to get a glibconfig.h that is for arm. I'm just going to edit the one in the x86_64 libs and try that.

Alright, those were bad ideas, but maybe if install debian armel in qemu, I could just compile there. So, that's my next trial.

Last edited by jacobr8893; 01-12-2017 at 11:55 AM.
jacobr8893 is offline   Reply With Quote
Old 01-12-2017, 12:17 PM   #6
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by jacobr8893 View Post
So, I ran pkg-config by its self, and figured out that is where the x86_64 stuff is coming from. So, right now I'm going though all of those -I includes and replacing them with the ones in the lib from the touch. Some things aren't there though, so I'll see how that works when it's done. I just have no idea where to get a glibconfig.h that is for arm. I'm just going to edit the one in the x86_64 libs and try that.

Alright, those were bad ideas, but maybe if install debian armel in qemu, I could just compile there. So, that's my next trial.
Just be sure to install one of a similar version to your Kindle so you do not have to fight libc mis-matches.

IIRC, you want Debian/Wheezy (or maybe one release newer - check libc versions to be sure).
knc1 is offline   Reply With Quote
Old 01-12-2017, 01:41 PM   #7
jacobr8893
Junior Member
jacobr8893 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2017
Device: Kindle Touch (K5)
It works!
If anyone else wants to know, I got all the qemu stuff to run debian arm here: http://http://https://people.debian....32/qemu/armel/
I used debian weezy, all the versions seemed to match up and everything ran.
Then just run the vm, install everything, compile the gtk app the normal way, and transfer to the kindle touch.

Last edited by jacobr8893; 01-12-2017 at 01:51 PM.
jacobr8893 is offline   Reply With Quote
Reply

Tags
compiling, error, gtk, gtk+, kindle touch


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling Android for Kindle Touch thatworkshop Kindle Developer's Corner 26 12-17-2013 11:28 PM
here's how to compile a gtk native app for the kindle touch chris_c Kindle Developer's Corner 9 12-21-2012 12:01 AM
Regarding Calibre source code compiling shivas Introduce Yourself 4 12-23-2009 09:52 AM
iLiad Problems porting GTK apps robinwatts iRex Developer's Corner 6 03-22-2008 06:19 AM
iLiad Compiling GTK apps for iliad rudysplif iRex Developer's Corner 3 03-17-2008 12:59 PM


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


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