Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2006, 08:16 AM
giorgio.tani giorgio.tani is offline
Junior Member
 
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Lazarus (installed from .pbi) problem while linking
Hi, I higly appreciate the .pbi installer but I recently ran into a problem while installing the Lazarus .pbi provided in the PC-BSD site (http://www.pbidir.com/packages.php?code=162); my system is PC-BSD 1.0-rc1 x86 on a VMWare virtal machine.
The installation went right and Lazarus seemed ok (it started, proper links on desk and taskbar were created) but when trying to compile an application it failed while linking not finding -lglib12 in usr/bin/ld.
I tested it even with: an empty application (only the form windows, without custom code), saving the project, rebototing the system, installing on a freshly installed PC-BSD on a diffrent virtual machine with no third parts software installed... nothing worked.
On the web I found documents that points out that it may be a misconfiguration of gtk or gtk-devel package.
Can you help me in fixing it? Someone of you has ran in the same problem before?
Thank you!
Reply With Quote
  #2  
Old 01-12-2006, 08:19 AM
Almindor Almindor is offline
Member
 
Join Date: Dec 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Yes this is known and I'm afraid unfixable (via PBIs tho).

The problem is that while the PBI packed (in this case Lazarus) application uses it's own "lib" dir in which it has all required libraries prepared, any "product" (your compiled application) will NOT use that directory.

This is not fixable easily via PBI. I could copy those .so files into your /usr/local/lib but it could make a horrible library hell that way.

The only valid solution is to install both gtk12 and glib packages from ports.
You can do so by doing "make" and "make install" as root in:
/usr/ports/devel/glib12
and
/usr/ports/x11-toolkits/gtk12

I've asked the PBIDIR maintainer to add a warning about these requirements on the webpage with Lazarus PBI.

Also note that ANYONE who wants to use your programs (if you don't prepack them) will also have to have glib and gtk12 installed. This is not a fault of Lazarus or gtk but a design limitation of PBI.
Reply With Quote
  #3  
Old 01-12-2006, 12:14 PM
giorgio.tani giorgio.tani is offline
Junior Member
 
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Hi, thank you for the response, I'll try to do it as soon as possible.
For what I can see from the error message, I think it will definitely fix the problem I'm experiencing but however I hope to be useful pointing out that the problem I'm facing is somewhat different from:
Originally Posted by Almindor
The problem is that while the PBI packed (in this case Lazarus) application uses it's own "lib" dir in which it has all required libraries prepared, any "product" (your compiled application) will NOT use that directory.
since I experienced the impossibility of Lazarus (installed form .pbi) itself to complete the creation of an executable.
Compiling an application would progress properly (in the message window of lazarus I see that all the lines of the application copiles well) until the linking stage, then as usual I'll see the message that Lazarus is trying to link the application but after a while I see that linking failed because ld didn't found -lglib12.
In file manager I can see that in that way Lazarus was able to create the .o objects for the application but not the binary.
It seem that Lazarus itself has problem to access to gtk / glib if installed with the .pbi (however, afaik installing the required libraries from ports would fix that kind of problem too).
Reply With Quote
  #4  
Old 01-12-2006, 01:51 PM
Almindor Almindor is offline
Member
 
Join Date: Dec 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default
No this is because the LINKER doesn't find glib (because it's not installed properly).

Let me explain:

When the compiler is finished making .o file the linker goes in and scans the symbols to see which libs need to be linked in. It looks for these libs in certain directories specified in various config files on various systems.

You COULD specify the path to /Programs/Lazarus/lib or such and it would work for linking stage and you'd get your binary. If you specify it in the config file of your linker it should also work when you run the binary. If you only specify it in the linker options of Lazarus (use "additional" editbox and -k-Lpath IIRC) it will link but probably not run.

This is a design problem. PBIs are a nice idea but not good for additional "tools" and "libs".
Reply With Quote
  #5  
Old 01-12-2006, 02:57 PM
giorgio.tani giorgio.tani is offline
Junior Member
 
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Thank you for the support, now I've a clearer picture of the problem, I'm going to fix my system ASAP!
Reply With Quote
  #6  
Old 02-23-2006, 07:33 PM
pepecito pepecito is offline
Member
 
Join Date: Nov 2005
Location: Torino, Italy
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to pepecito
Default
I have just installed Lazarus0.9.12-PV0.2.pbi and added the libs with the commands:
Code:
pkg_add -r glib
pkg_add -r gtk
When I try to compile a simple form I get the following error:
Code:
/usr/bin/ld: cannot find -lgdk_pixbuf
project1.lpr(14,1) Error: Error while linking
Am I missing something? :cry:
Reply With Quote
  #7  
Old 02-23-2006, 08:56 PM
madman madman is offline
Senior Member
 
Join Date: Jan 2006
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
Default
It looks like some linux users are having the same problem, look through these links and see if you can find a solution
http://www.google.com/search?q=%22%2Fus ... 8&oe=UTF-8
Reply With Quote
  #8  
Old 06-26-2006, 10:03 AM
Almindor Almindor is offline
Member
 
Join Date: Dec 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default
The problem with latest "missing" glib12 and so on if you installed them from ports or packages is that FreeBSD broke backwards compatibility with no warning. (Ok it was "written in a bulleting somewhere 3 stories down for 6 months)

In other words, they renamed "glib12.so" to "glib-12.so" and others too (gtk and so on).

You can fix this by symlinking them back to their "-"less names.

We're working on a more smart way with oliebol but it's a FPC issue so don't expect a fix soon.

P.S: this is only valid for PCBSD 1.1 (as freeBSD 6.1)
in freeBSD 6.0 (unupdated ports) you still get the OLD glib12.so which works.
Reply With Quote
  #9  
Old 07-05-2006, 09:22 AM
Almindor Almindor is offline
Member
 
Join Date: Dec 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Ok I got some good news.

FPC 2.0.4 is going out soon (month at max) and it has lots of nice new "features" one of them being able to "alias" libnames from commandline or fpc.cfg. This means that I can fix this "problem" in an elegant way.

I'll release a FPC-2.0.4/Lazarus-0.9.16 (or later if it comes out till then) right when fpc goes out.
Reply With Quote
  #10  
Old 07-10-2006, 09:23 AM
miba miba is offline
Member
 
Join Date: Jul 2006
Location: Budapest, Hungary
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default
I can't get Lazarus 0.9.12 working on PCBSD 1.11.
I have followed the instructions in this thread: installing glib12 and gtk12 from ports. I have also made symlinks in /usr/local/lib:

libglib12.a -> libglib-12.a
libglib12.so -> libglib-12.so
libglib12.so.3 -> libglib-12.so

I still get the linker error when trying to compile and run a program.
What can be wrong?

TIA,
Mikael
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Linking Problems after Update 7.1 -> 8.0 rfolkerts Installing PC-BSD 5 03-10-2010 04:09 AM
Linking to a pdf ranran The Lounge 3 05-27-2007 03:31 AM
linking time errors CarlosOmar General Questions 2 06-24-2006 08:19 AM
Lazarus IDE JMan General Questions 2 01-11-2006 06:29 AM


All times are GMT. The time now is 08:03 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Copyright 2005-2010, The PC-BSD Project. PC-BSD and the PC-BSD logo are registered trademarks of iXsystems.
All other content is freely available for sharing under the terms of the Creative Commons Attribution License.