FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

link X11 automatically

 
   Mac (Home) -> Programmer Help RSS
Related Topics:
Help! Static library won't link - I need some help here. I'm in the process of porting a project over to XCode. I've gone through the of making the beast Mach-O on and that works fine. Trouble is that the project contains a Static Library. Even..

How to type in ASCII? - Stupid question #2 of the week. I'm trying to avoid writing a printer driver for a barcode label printer. It responds to commands, and I want to embed a command in a page that tells the printer to cut the paper. It's o STX, of course..

applications and windows - Hello. I'm primarily a system unix one. Currently I have to implement the following logic: On Mac OS X enumerate all running only those that are windows. Find which of them is where is defined as..

[ANN] Vice - Graphical Program Priority Adjustment Tool fo.. - Vice is an that allows the user to adjust the priority of programs running on Mac OS X. Normal users can lower the priority of their own programs, while can adjust the priority of any..

NSCursorAttributeName and NSTextView - Well, I've been playing around a little bit with getting URLs in my to actually become clickable links. So far, so good. I set the for my strings that get inserted into the text view: for the link..
Next:  Programmer Help: CFPreferencesAppSynchronize failed  
Author Message
Frank Swarbrick

External


Since: Jun 28, 2008
Posts: 5



(Msg. 1) Posted: Sat Jun 28, 2008 11:49 pm
Post subject: link X11 automatically
Archived from groups: comp>sys>mac>programmer>help (more info?)

I was trying to compile (make) a program that uses X11. Below is the
compile line followed by the error message:

gcc hi.o s7_comp.a s7_data.a seed7_05.a -lX11 -lncurses -lm -o hi
/usr/bin/ld: can't locate file for: -lX11

After some searching I found the location of libX11:
/usr/X11R6/lib/libX11.dylib

So I made this change to the makefile:

LFLAGS = -L/usr/X11R6/lib

And now it works:
gcc -L/usr/X11R6/lib hi.o s7_comp.a s7_data.a seed7_05.a -lX11 -lncurses
-lm -o hi

So my question is, is there a way to have /usr/X11R6/lib added to the
standard ld lib search chain? This program is built on Linux, which I
assume has X11 in the standard search chain. (Perhaps a bad assumption!)

Thanks,
Frank
Back to top
Login to vote
Ben Artin

External


Since: Aug 26, 2005
Posts: 38



(Msg. 2) Posted: Sun Jun 29, 2008 2:48 am
Post subject: Re: link X11 automatically [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <6com4eF3fleqpU1 DeleteThis @mid.individual.net>,
Frank Swarbrick <fswarbrick DeleteThis @gmail.com> wrote:

> /usr/bin/ld: can't locate file for: -lX11
>
> LFLAGS = -L/usr/X11R6/lib
>
> So my question is, is there a way to have /usr/X11R6/lib added to the
> standard ld lib search chain?

The standard way to solve this problem on UNIX-based systems (of which Mac OS X
is one) is to use autoconf. See
<http://www.gnu.org/software/autoconf/autoconf.html>. IMO it's kinda painful.

--
If this message helped you, consider buying an item
from my wish list: <http://artins.org/ben/wishlist>
Back to top
Login to vote
Frank Swarbrick

External


Since: Jun 28, 2008
Posts: 5



(Msg. 3) Posted: Sun Jun 29, 2008 9:07 pm
Post subject: Re: link X11 automatically [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ben Artin wrote:
> In article <6com4eF3fleqpU1.TakeThisOut@mid.individual.net>,
> Frank Swarbrick <fswarbrick.TakeThisOut@gmail.com> wrote:
>
>> /usr/bin/ld: can't locate file for: -lX11
>>
>> LFLAGS = -L/usr/X11R6/lib
>>
>> So my question is, is there a way to have /usr/X11R6/lib added to the
>> standard ld lib search chain?
>
> The standard way to solve this problem on UNIX-based systems (of which Mac OS X
> is one) is to use autoconf. See
> <http://www.gnu.org/software/autoconf/autoconf.html>. IMO it's kinda painful.

Yoikes!
Smile

I will look at it.

Thanks,
Frank
Back to top
Login to vote
Paul Floyd

External


Since: Feb 23, 2007
Posts: 8



(Msg. 4) Posted: Mon Jun 30, 2008 7:37 pm
Post subject: Re: link X11 automatically [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 29 Jun 2008 21:07:05 -0600, Frank Swarbrick <fswarbrick DeleteThis @gmail.com>
wrote:
> Ben Artin wrote:
>> In article <6com4eF3fleqpU1 DeleteThis @mid.individual.net>,
>> Frank Swarbrick <fswarbrick DeleteThis @gmail.com> wrote:
>>
>>> /usr/bin/ld: can't locate file for: -lX11
>>>
>>> LFLAGS = -L/usr/X11R6/lib
>>>
>>> So my question is, is there a way to have /usr/X11R6/lib added to the
>>> standard ld lib search chain?
>>
>> The standard way to solve this problem on UNIX-based systems (of which Mac OS X
>> is one) is to use autoconf. See
>> <http://www.gnu.org/software/autoconf/autoconf.html>. IMO it's kinda painful.
>
> Yoikes!
>Smile
>
> I will look at it.

Be warned, it's not called autohell for nothing. In particular, libtool,
IMO, is spectacularly bloated and grotesque piece of software. To top it
all, autohell works very badly with compilers other than GCC. And I
wouldn't count on it being that well tested on OSes other than Linux
either.

A bientot
Paul
--
Paul Floyd http://paulf.free.fr
Back to top
Login to vote
Frank Swarbrick

External


Since: Jun 28, 2008
Posts: 5



(Msg. 5) Posted: Fri Jul 04, 2008 10:59 pm
Post subject: Re: link X11 automatically [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Frank Swarbrick wrote:
> I was trying to compile (make) a program that uses X11. Below is the
> compile line followed by the error message:
>
> gcc hi.o s7_comp.a s7_data.a seed7_05.a -lX11 -lncurses -lm -o hi
> /usr/bin/ld: can't locate file for: -lX11
>
> After some searching I found the location of libX11:
> /usr/X11R6/lib/libX11.dylib
>
> So I made this change to the makefile:
>
> LFLAGS = -L/usr/X11R6/lib
>
> And now it works:
> gcc -L/usr/X11R6/lib hi.o s7_comp.a s7_data.a seed7_05.a -lX11 -lncurses
> -lm -o hi
>
> So my question is, is there a way to have /usr/X11R6/lib added to the
> standard ld lib search chain? This program is built on Linux, which I
> assume has X11 in the standard search chain. (Perhaps a bad assumption!)

I'm not sure if I didn't ask my question correctly, because I've found a
different answer to my question. Maybe it's so obvious? Anyway, all I
had to do is create an environment variable LIBRARY_PATH and place
/usr/X11R6/lib in it.

Here it is in my .profile member:
LIBRARY_PATH=/opt/local/lib:/opt/local/lib/db46:/usr/X11R6/lib
export LIBRARY_PATH

(The other two libraries are to pick up libs installed using MacPorts.)

Anyway, that does everything I require. Or seems to at least! Smile

Frank
Back to top
Login to vote
Sherman Pendley

External


Since: Oct 31, 2007
Posts: 7



(Msg. 6) Posted: Sat Jul 05, 2008 2:08 am
Post subject: Re: link X11 automatically [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Frank Swarbrick <fswarbrick.TakeThisOut@gmail.com> writes:

> Here it is in my .profile member:
> LIBRARY_PATH=/opt/local/lib:/opt/local/lib/db46:/usr/X11R6/lib
> export LIBRARY_PATH

Interesting - I've always exported LDFLAGS for that. Even after 20+
years of programming, I *still* learn something new every day. Smile

> (The other two libraries are to pick up libs installed using
> MacPorts.)

It's worth noting, if you link against dynamic libraries with this,
then your users will also need to have those libraries installed, and
in the same location. X11 is optional, although it is installed by
default IIRC. MacPorts is of course a completely separate install.

It's not a *huge* problem; you can simply document that your app
requires the X11 install. For MacPorts libraries, you can simply copy
them into your .app bundle in a "copy files" build phase, and use
install_name_tool in a "run script" build phase to tweak your app
binary so that the loader looks there for them instead of under /opt.

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
Back to top
Login to vote
Frank Swarbrick

External


Since: Jun 28, 2008
Posts: 5



(Msg. 7) Posted: Sat Jul 05, 2008 12:47 pm
Post subject: Re: link X11 automatically [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Sherman Pendley wrote:
> Frank Swarbrick <fswarbrick.DeleteThis@gmail.com> writes:
>
>> Here it is in my .profile member:
>> LIBRARY_PATH=/opt/local/lib:/opt/local/lib/db46:/usr/X11R6/lib
>> export LIBRARY_PATH
>
> Interesting - I've always exported LDFLAGS for that. Even after 20+
> years of programming, I *still* learn something new every day. Smile

Do you mean something like this?
export LDFLAGS=-L/usr/X11R6/lib

>> (The other two libraries are to pick up libs installed using
>> MacPorts.)
>
> It's worth noting, if you link against dynamic libraries with this,
> then your users will also need to have those libraries installed, and
> in the same location. X11 is optional, although it is installed by
> default IIRC. MacPorts is of course a completely separate install.
>
> It's not a *huge* problem; you can simply document that your app
> requires the X11 install. For MacPorts libraries, you can simply copy
> them into your .app bundle in a "copy files" build phase, and use
> install_name_tool in a "run script" build phase to tweak your app
> binary so that the loader looks there for them instead of under /opt.

I'm not really a C programmer, so I don't know most of the tricks. My
need here for X11 was to install the Seed7 programming language.
MacPorts was used to install the gmp and db46 packages required to
install OpenCobol.

But if I ever do develop a program that I want to install elsewhere I
will keep you information in mind. Thanks!

Frank
Back to top
Login to vote
Sherman Pendley

External


Since: Oct 31, 2007
Posts: 7



(Msg. 8) Posted: Sat Jul 05, 2008 3:18 pm
Post subject: Re: link X11 automatically [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Frank Swarbrick <fswarbrick.RemoveThis@gmail.com> writes:

> Sherman Pendley wrote:
>> Frank Swarbrick <fswarbrick.RemoveThis@gmail.com> writes:
>>
>>> Here it is in my .profile member:
>>> LIBRARY_PATH=/opt/local/lib:/opt/local/lib/db46:/usr/X11R6/lib
>>> export LIBRARY_PATH
>>
>> Interesting - I've always exported LDFLAGS for that. Even after 20+
>> years of programming, I *still* learn something new every day. Smile
>
> Do you mean something like this?
> export LDFLAGS=-L/usr/X11R6/lib

Yep, exactly. There's nothing wrong with your approach though, I just
thought it was an interesting side note. And the fact that I'm still
learning new things after so long is part of what makes programming
fun, at least for me. Smile

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
Back to top
Login to vote
Display posts from previous:   
       Mac (Home) -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact