image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #17  
Old September 15th, 2006, 10:29 AM
Registered User
 
Join Date: Sep 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
reussinger is on a distinguished road
I've already done all of that. Gnuplot is in /usr/local/bin which is set in the file environment.plist. I can also launch gnuplot from any location via terminal, but gnuplot_i cannot find it in Xcode.
Reply With Quote
  #18  
Old September 17th, 2006, 08:00 AM
Registered User
 
Join Date: Jun 2005
Location: London, UK.
Posts: 278
Thanks: 0
Thanked 0 Times in 0 Posts
boyfarrell is on a distinguished road
Hi folks,

How have you installed gnuplot_i? Have you compiled it and installed the binary in /usr/local/lib/ and the header in /usr/local/include/ ?

You will then need to link against using something like: -lgnuplot_i.o or -lgnuplot_i or -gnuplot_i.o in the other linker flag section I think (not to sure about this, it's been a while but I did the above and got it working at some point in the past!).

However, if you don't want to mess around with all that linking stuff (this is what I currently do):

Just import the gnuplot_i.h and gnuplot_i.c into your xcode project that way xcode handles it all for you.

Cheers,

Last edited by boyfarrell; September 17th, 2006 at 08:05 AM.
Reply With Quote
  #19  
Old September 23rd, 2006, 05:58 AM
Registered User
 
Join Date: Sep 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
reussinger is on a distinguished road
Hi,
it's not a problem of getting to run gnuplot_i from within Xcode.
When I try to call gnuplot_init() I get the message mentioned in my first post ("cannot find DISPLAY variable", "cannot find gnuplot in your PATH"). This is a result of gnuplot_get_program_path() failing, obviously.

The strange thing is that I can call gnuplot from anywhere in the terminal and it works. I guess this tells me that the path to gnuplot is set, as far as I understand it.

Thanks.
Reply With Quote
  #20  
Old September 25th, 2006, 07:39 PM
Registered User
 
Join Date: Jun 2005
Location: London, UK.
Posts: 278
Thanks: 0
Thanked 0 Times in 0 Posts
boyfarrell is on a distinguished road
Hi,

As an experiment I deleted the gnuplot directory from my .MacOS/environment.plist file. I then logged out and back in again and managed to replicate your error:
Quote:
cannot find gnuplot in your PATH
Seems like your enviroment.plist is setup incorrectly, can you post it?

If this isn't the answer, I'm not to sure what is? Are you using a new version of gnuplot and aquaterm? The only other thing I can think of is that you are using X11 terminal rather that 'termial'; you see they have seperate enviromental variables. I ran into this problem once, I set the the DYLD_LIBRARY_PATH in the terminal and then when I changed to X11 terminal it didn't have clue what I was meaning! I really don't think that is the case here I'm just racking my brain for possibilties.

Dan.

Last edited by boyfarrell; September 25th, 2006 at 07:46 PM.
Reply With Quote
  #21  
Old September 26th, 2006, 04:28 PM
Registered User
 
Join Date: Sep 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
reussinger is on a distinguished road
Hi,
there was indeed a problem with my environment.plist file. Seems like I had accidentally saved it as .rtf instead of .txt before I changed the extension to .plist. It had a RTF preamble that did not show up in TextEdit, but was obvious when I opened the file with BBEdit. Stupid me. Anyway, works fine now.

Thanks a lot for your help!
Reply With Quote
  #22  
Old September 27th, 2006, 04:24 AM
Registered User
 
Join Date: Jun 2005
Location: London, UK.
Posts: 278
Thanks: 0
Thanked 0 Times in 0 Posts
boyfarrell is on a distinguished road
Great!

Happy plotting :0)

Dan.
Reply With Quote
  #23  
Old July 30th, 2007, 02:07 PM
Registered User
 
Join Date: Jul 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
HonestIago is on a distinguished road
Hello,
I've the same problem with XCode and gnuplot_i ...
When I try to run my program (in C++) I get
Quote:
terminate called after throwing an instance of 'GnuplotException'
what(): cannot find DISPLAY variable
My gnuplot works well with Aquaterm; I tried to follow the instructions in this thread about the file environment.plist but nothing changes.
Is it possible the reason is I installed gnuplot using fink? Could be I don't write the right adress in environment.plist?
Please help me!
Reply With Quote
  #24  
Old August 1st, 2007, 07:16 AM
Registered User
 
Join Date: Jun 2005
Location: London, UK.
Posts: 278
Thanks: 0
Thanked 0 Times in 0 Posts
boyfarrell is on a distinguished road
Hi,

You will need to edit the .plist file originally posted by Viro so that it links to where fink stores the binary files. If I remember correctly fink would put it in /sw/bin so try this:

Quote:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.
com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GNUTERM</key>
<string>aqua</string>
<key>PATH</key>
<string>/sw/bin</string>
</dict>
</plist>
Make sure this text is saved as a .txt and not an .rtf, name/save it here:
~/.MacOS/environment.plist
Reply With Quote
Reply

Thread Tools

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 09:01 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.