Solved it. I went back to the config.log and fixed a few things that were out of place,
installed a few things. Still had issues though, however I came across this post about
fftw, that explains all the additional errors I was encountering when I tried to
troubelshoot source of the source directly in the IDE :
http://www.dsprelated.com/showmessage/2636/1.php
I was all set to start casting all these mallocs returns everywhere when it clicked: I
just needed to explicitly declare the "C" linkage to my C++ code:
extern "C"
{
#include "libgretl.h"
}
For reference, many adapted C libraries have added this functionality as part of thier
header macro guards. e.g
#ifdef __cplusplus
extern "C" {
#endif
... /* body of header */
#ifdef __cplusplus
} /* closing brace for extern "C" */
#endif
Works now, the simple_client produces the desired output. Perhaps you may want to add this
note for C++ users of the API, or comment it into the client sample. (or add it to the
source in a future release if you're ambitious).
Cheers,
Joel Bycraft
Date: Sat, 26 Jun 2010 21:33:57 -0400
From: cottrell(a)wfu.edu
To: gretl-users(a)lists.wfu.edu
Subject: Re: [Gretl-users] Using Gretl API for C++ Program
On Sat, 26 Jun 2010, Joel Bycraft wrote:
> 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
This may be something to do with not using libtool. There should
be a symbolic link from libgretl-1.0.0.dylib to
libgretl-1.0.dylib, and maybe that's missing?
cd /usr/local/lib && \
sudo ln -s libgretl-1.0.0.dylib libgretl-1.0.dylib
Allin Cottrell
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
_________________________________________________________________
Game on: Challenge friends to great games on Messenger
http://go.microsoft.com/?linkid=9734387