GTK+ Compile: MIssing Libraries (PARTIALLY SOLVED)

New to FreeBASIC? Post your questions here.
KFlux
Posts: 8
Joined: Jan 14, 2014 20:13

GTK+ Compile: MIssing Libraries (PARTIALLY SOLVED)

Postby KFlux » Jan 14, 2014 20:21

Hi,

This is my first post here. I'm completely new to FreeBASIC. I've been using QuickBASIC and Python for some time, but I wanted a QBasic-like language that lets me play around with code in a fun way but without the fundamental limitations of QB.

Anyway, I thought I'd try out some GTK+ examples to see how the implementation of the toolkit differs from Python. Trouble is, I can't seem to solve the compilation errors.

Code: Select all

ld: cannot find -lgtk-3
ld: cannot find -lgdk-3
ld: cannot find -lglib-2.0
ld: cannot find -lgio-2.0
ld: cannot find -lgobject-2.0
ld: cannot find -lgmodule-2.0
ld: cannot find -lpango-1.0
ld: cannot find -lcairo
ld: cannot find -lgdk_pixbuf-2.0
ld: cannot find -lpangocairo-1.0
ld: cannot find -latk-1.0


I installed lgtk-x11-2.0 but the errors remain. I also tried adding #DEFINE __USE_GTK3__ to the top of the source, but the errors keep coming up.

For reference I am running Xubuntu 13.10.

Regards,

KFlux
Last edited by KFlux on Jan 20, 2014 10:44, edited 1 time in total.
marcov
Posts: 2770
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: GTK+ Compile: MIssing Libraries

Postby marcov » Jan 15, 2014 19:48

You might want to install -dev (or -devel, don't know how Ubuntu names them) packages too. The packages without -dev are the ones needed for runtime. For developing you also need the -devel ones, or manually set some symlinks.
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Re: GTK+ Compile: MIssing Libraries

Postby sir_mud » Jan 16, 2014 3:10

marcov wrote:You might want to install -dev (or -devel, don't know how Ubuntu names them) packages too. The packages without -dev are the ones needed for runtime. For developing you also need the -devel ones, or manually set some symlinks.
They will be the package name + -dev (and then add :i386 if you're using a 64bit debian based linux)
TJF
Posts: 3481
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: GTK+ Compile: MIssing Libraries

Postby TJF » Jan 16, 2014 6:58

Hello KFlux, welcome at the forum!

Your error messages are not really compilation errors. They're coming from the linker (ld:) --> binaries are missing. As mentioned in the previous posts you need -dev packages to compile (Python as an interpreter only needs runtime).

GTK+ bindings in FreeBasic support version 2.24 and 3.4. In your error messages I see you #DEFINE __USE_GTK3__, so you need to install
    sudo apt-get install libgtk-3-dev:i386

Or, when you also want to try the old version, install both
    sudo apt-get install libgtk2.0-dev:i386 libgtk-3-dev:i386
(Package naming is a bit inconsistent here.)
KFlux
Posts: 8
Joined: Jan 14, 2014 20:13

Re: GTK+ Compile: MIssing Libraries

Postby KFlux » Jan 16, 2014 10:32

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.
libgtk-3-dev:i386 : Depends: libgtk-3-0:i386 (= 3.8.6-0ubuntu3.1) but it is not going to be installed
Depends: gir1.2-gtk-3.0:i386 (= 3.8.6-0ubuntu3.1) but it is not going to be installed
Depends: libgdk-pixbuf2.0-dev:i386 (>= 2.27.1) but it is not going to be installed
Depends: libpango1.0-dev:i386 (>= 1.32.4) but it is not going to be installed
Depends: libatk1.0-dev:i386 (>= 2.7.5) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


This is what I get when I try to install the unment dependencies. In order to repair the broken packages I ran the autoclean and autoremove functions, and then installed the libraries again but get the same message. It won't let me install the unment dependencies at all. So...I'm stumped!

KFlux
marcov
Posts: 2770
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: GTK+ Compile: MIssing Libraries

Postby marcov » Jan 16, 2014 10:33

(fyi The devel libs contain (afaiK)

- static libs -> only important when statically linking which is usually rare
- headers -> only needed if you want to convert or use them from C. ( I assume not needed for the C backend, since then C headers will be generated from the FB ones?)
- a symlink from the libxxx.so to libxxx.so.x.y, running ldconfig after.

in this case, the last bit is mostly what is needed and intermediate users can do this manually (e.g. on embedded systems with limited (flash) root file systems)
TJF
Posts: 3481
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: GTK+ Compile: MIssing Libraries

Postby TJF » Jan 16, 2014 15:44

KFlux wrote:Depends: gir1.2-gtk-3.0:i386 (= 3.8.6-0ubuntu3.1) but it is not going to be installed

How did you run GTK+ in Python without this package?

Anyway, obviously there is an issue in the Ubuntu 13.10 packages. Try installing the runtime first (I've no 64 bit installation, so I cannot test here)
    sudo apt-get install libgtk-3-0:i386 libgtk-3-0-dev:i386

In worst case you'll have to install each dependency separately by
    sudo apt-get install libatk1.0-dev:i386 libpango1.0-dev:i386 libgdk-pixbuf2.0-dev:i386 gir1.2-gtk-3.0:i386 libgtk-3-0:i386 libgtk-3-dev:i386
KFlux
Posts: 8
Joined: Jan 14, 2014 20:13

Re: GTK+ Compile: MIssing Libraries

Postby KFlux » Jan 17, 2014 14:38

When I try to install the package(s) independently I get the same error message. With regards to running GTK+ in Python, I have no idea. All I know is when I create a frame in Python it works and when I try to do the same thing in FreeBASIC it doesn't.

I'm pretty dubious about some of these messages though. It was spitting out a message about the Xrandr-dev package not being there and I know for a fact that it is because I installed it manually. Also, the file had already been compiled and run successfully but when I made a change and went to re-compile I got
ld: cannot find -lXrandr
I suspect it's an issue with 13.10 as there are other instabilities cropping up too.

I have Windows 7 on another partition so I'll give it a go there and see how things go.

Thanks for all the replies. I hope a solution presents itself soon.

KFlux
KFlux
Posts: 8
Joined: Jan 14, 2014 20:13

Re: GTK+ Compile: MIssing Libraries

Postby KFlux » Jan 17, 2014 16:16

OK, same problem on Windows 7 so it's not an Ubuntu-specific issue I'm having. Think I may have to find another dialect to use because I don't know what else I can do to get FreeBASIC to just work. I'm used to having to fix up ways to get things running on Linux but in Windows it's usually just a case of installing and running.

Thanks for all the advice guys.


KFlux
TJF
Posts: 3481
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: GTK+ Compile: MIssing Libraries

Postby TJF » Jan 17, 2014 18:04

Working with GTK+ on wodniws is more complicated than under UNIX. You've to care about the path for the linker. Either you copy all GTK+ binaries (and the configuration files) in to the FB include folder or you use a standard installation and #LIBPATH in your program (or compiler option -p).

Where did you install which GTK+ package and how did you handle the library path?

BTW: on a 32-bit Ubuntu system there're no issues at all. Is testing in a virtual mashine an option for you?
KFlux
Posts: 8
Joined: Jan 14, 2014 20:13

Re: GTK+ Compile: MIssing Libraries

Postby KFlux » Jan 17, 2014 21:56

OK, bit of an extreme solution...but I've completely re-installed Xubuntu 13.10 using the 32-bit build instead of the 64-bit one. I've installed all required libraries and also all GTK+ libraries and it seems to be compiling source with no linker errors.

Clearly there are a lot of compatibility issues with 64-bit systems, so for the time being I'll stick with 32-bit.

Thanks for all the assistance! :-)

KFlux
TJF
Posts: 3481
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: GTK+ Compile: MIssing Libraries

Postby TJF » Jan 18, 2014 7:01

Fine, you're welcome.

Usually we mark threads as solved when we found a solution, so that other users know from the headline that they'll find not only a question but also an answer in this thread. Therefor the owner of the thread edits his initial post and appends the [solved] text to the subject.

Here I'm unsure, since we didn't find a solution for 64-bit.
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Re: GTK+ Compile: MIssing Libraries

Postby sir_mud » Jan 18, 2014 7:13

I'm on Debian wheezy 64bit and when i try to install gtk3 it wants to remove 75% of gnome, so yea I can see that causing an inexperienced user or even an experienced one problems.

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 14 guests