I have pkgconfig installed, I had to update the env variable but I did get the flags. So xcode uses this compile line
/Developer/usr/bin/g++-4.0 -arch i386
-L/Users/MacBook/Code/testing/build/Debug -F/Users/MacBook/Code/testing/build/Debug -F/Developer/Library/Frameworks -filelist /Users/MacBook/Code/testing/build/testing.build/Debug/testing.build/Objects-normal/i386/testing.LinkFileList -L/opt/local/lib -L/usr/local/lib -lgretl-1.0 -lxml2 -lpthread -lz -liconv -lm -framework TALib -o /Users/MacBook/Code/testing/build/Debug/testing
Undefined symbols:
"libgretl_init()", referenced from:
_main in main.o
"libgretl_cleanup()", referenced from:
_main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
specifically I added -L/opt/local/lib -L/usr/local/lib -lgretl-1.0 -lxml2 -lpthread -lz -liconv -lm based on the result from pkgconfig. And I have confirmed libgretl-1.0.0.dylib is in /usr/local/lib
Thanks again!
Joel
> Date: Fri, 18 Jun 2010 14:37:38 -0400
> From: cottrell@wfu.edu
> To: gretl-users@lists.wfu.edu
> Subject: Re: [Gretl-users] Using Gretl API for C++ Program
>
>
> On Fri, 18 Jun 2010, Joel Bycraft wrote:
>
> > Hi, I have done the install for the Gretl 1.9.0 and I'm now
> > trying to compile and run the sample client program in xcode
> > 3.1.3 IDE, in order to learn how I can use gretl commands and
> > retirn datasets from OLS and ADF tests. I'm on Mac Osx 10.5.8
> > Leopard.
> >
> > I have set header and library search paths at
> > /usr/local/include/gretl and /usr/local/lib, and my cpp build
> > does recognize the libgretl.h fine. However I am receiving
> > errors that all the functions referenced in the sample client
> > are not found:
> >
> > i.e. "gretl_model_new()" referenced from _main in main.o.
> >
> > ... Can someone describe the full set of additional linker flags
> > i should have to properly build the sample client, or other
> > library locations I should be referencing?
>
> If pkg-config is installed and /usr/local/lib/pkconfig is in
> PKG_CONFIG_PATH, then
>
> pkg-config --libs gretl
>
> will give the required linker line. But in your case it should
> probably read
>
> -L/usr/local/lib -lgretl-1.0 -lxml2
>
> The essential part is "-lgretl-1.0" which says to link against
> libgretl-1.0.
>
> > Thanks, this is a great package of tools, I am glad I found it!
>
> Have fun with it!
>
> Allin Cottrell
> _______________________________________________
> Gretl-users mailing list
> Gretl-users@lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
Your Photo on Bing.ca: You Could WIN on Canada Day! Submit a Photo Now!