GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Jul 22, 2014 11:38 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Ubuntu 12, 64 bits, compiling for 32 bits applications
PostPosted: Wed Jun 12, 2013 7:24 am 
Offline
Familiar Face

Joined: Tue Jun 11, 2013 7:08 am
Posts: 8
Hi,

I've just finish a migration from Ubuntu 10 32 bits to Ubuntu 12 64 bits.
For a lot of technical reasons, some of my applications should remain in 32 bits mode (some dameons which send or receive datas from GTK frontend must be compiled as 32 bit mode).

When I compile/link with -m32 option to force 32 bits mode, ld doesn't find libs (Gtk+3 as well as gtk+2 installation).
pkg-config --libs gtk+-3.0 returns -lgtk3, and some others -l (glib, cairo, ...), but ld cannot find them.

The query 32 bits keyword in that forum does not return pertinent responses. The GTK FAQ none.
Using ubuntu website, and others, I find how to install ia32-libs et gcc multi-arch packages. But it is not sufficient.
Somewhere, I found that 32 bits libs may be stored in /usr/lib32 or in /lib32.

If those directories are populated, there are no gtk libs therein.


Where can I find gtk libs for 32 bits compiling ? and where should I put them in my Ubuntu ?

Thanks.


Top
 Profile  
 
 Post subject: Re: Ubuntu 12, 64 bits, compiling for 32 bits applications
PostPosted: Wed Jun 12, 2013 9:02 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 733
Location: UK
Hello,

I have never done this as everything I do now is under 64 bit.

These links may be of help to you
http://www.maketecheasier.com/run-32-bit-apps-in-64-bit-linux/2009/08/10
http://stackoverflow.com/questions/8258778/compiling-32-bit-gtk-applications-of-64-bit-linux

Is there any way to port the code so that it can work under 64 bit mode?

_________________
E.


Top
 Profile  
 
 Post subject: Re: Ubuntu 12, 64 bits, compiling for 32 bits applications
PostPosted: Wed Jun 12, 2013 9:32 am 
Offline
Familiar Face

Joined: Tue Jun 11, 2013 7:08 am
Posts: 8
errol wrote:
Hello,

Is there any way to port the code so that it can work under 64 bit mode?


Hi, errol.

Thanks for the answer. Il will have a look at your links and post the result later.

My applications are integrated in industrial processes for automotive factories. It is not easier to force customers to move to 64 bits their industrial installations running 24h/24. There are mirgations steps planned, for 2015 :)

But since this period, I've to go on in development, for some 64 bits applications and some 32 bits. I'm not enjoyed in having two PCs:)


Top
 Profile  
 
 Post subject: Re: Ubuntu 12, 64 bits, compiling for 32 bits applications
PostPosted: Wed Jun 12, 2013 11:07 am 
Offline
Familiar Face

Joined: Tue Jun 11, 2013 7:08 am
Posts: 8
So,

I visit the links you provide.

All things proposed are done here.

For example, ia32-libs (and related ia32-libs-multiarch) are installed.
But, in my installation, the following sentence extracted from the stackoverflow forum listed above

"I do have all of the proper 32-bit versions of the libraries in my lib32 folders."

this sentence is false, here... I don't know why, but the package ia32-libs does not install gtk libraries....
and when I try installing ia32-libs-gtk, sometime suggested, apt-get outputs :

"Note : sélection of « ia32-libs » instead of « ia32-libs-gtk »"

So, should I think that the ia32-libs package supplied by Ubuntu 12.04 does not contain gtk libs ?


Top
 Profile  
 
 Post subject: Re: Ubuntu 12, 64 bits, compiling for 32 bits applications
PostPosted: Wed Jun 12, 2013 11:22 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 733
Location: UK
ia32-libs is just the bits to glue things together for the C library there is also Similar for the GTK libraries. You will still need to install the 32 bit GTK binaries to make things work.

If you can get the port done then that would be much better as you will then not be trying to mix two very different ways the processor works. Also in 64 bit mode security and run time checks can be compiled into the code with very little performance degradation unlike in 32 bit mode.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Ubuntu 12, 64 bits, compiling for 32 bits applications
PostPosted: Wed Jun 12, 2013 11:32 am 
Offline
Familiar Face

Joined: Tue Jun 11, 2013 7:08 am
Posts: 8
errol wrote:
ia32-libs is just the bits to glue things together for the C library there is also Similar for the GTK libraries. You will still need to install the 32 bit GTK binaries to make things work.


Hi...

Where can I find these libs ?

I try all linux and ubuntu tools to install packages (apt-cache search, synaptic, ...) ...

Should I download gtk sources and re-make them as this site explain ?
https://developer.gnome.org/gtk3/stable ... lding.html


Top
 Profile  
 
 Post subject: Re: Ubuntu 12, 64 bits, compiling for 32 bits applications
PostPosted: Wed Jun 12, 2013 11:57 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 733
Location: UK
If you do not have easy access to pre-built binaries then you will need to build from source. It may also make sense to link with the static libraries and not the dynamic libraries to make things a little easier and that you are getting to the right library every time.

I have never built GTK from source so can not help you there. You may want to look under the 32 bit repositories for Ubuntu and manually install from there.

_________________
E.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group