Problem solved :)

it was clearly a linking problem,

added '-L/usr/lib/mysql -lmysqlclient' to the list of parameters in /
build/src/cc/Tools/hypertable/CMakeFiles/hypertable.dir/link.txt
file.

don't know if this was needed but also changed the way hypertable.cc
was getting compiled in /build/src/cc/Tools/hypertable/CMakeFiles/
hypertable.dir/build.make file.

On Apr 29, 2:04 pm, Harshada <[email protected]> wrote:
> After including mysql.h with complete path like @include "<path>/
> mysql.h" the "mysql.h header file not found" error is gone. But there
> are problems during linking.
>
> I get errors for all mysql.h related functions like:
>
> /home/erts/hypertable/hypertable-0.9.2.8-alpha/src/cc/Tools/hypertable/
> hypertable.cc:544: undefined reference to `mysql_init'
> /home/erts/hypertable/hypertable-0.9.2.8-alpha/src/cc/Tools/hypertable/
> hypertable.cc:547: undefined reference to `mysql_real_connect'
> /home/erts/hypertable/hypertable-0.9.2.8-alpha/src/cc/Tools/hypertable/
> hypertable.cc:549: undefined reference to `mysql_error'
> /home/erts/hypertable/hypertable-0.9.2.8-alpha/src/cc/Tools/hypertable/
> hypertable.cc:559: undefined reference to `mysql_query'
> /home/erts/hypertable/hypertable-0.9.2.8-alpha/src/cc/Tools/hypertable/
> hypertable.cc:561: undefined reference to `mysql_error'
> /home/erts/hypertable/hypertable-0.9.2.8-alpha/src/cc/Tools/hypertable/
> hypertable.cc:566: undefined reference to `mysql_query'
>
> On Apr 29, 2:15 am, Doug Judd <[email protected]> wrote:
>
>
>
> > If you're just trying to see the link line for hypertable, try re-building
> > as follows:
>
> > make VERBOSE=1
>
> > This will display every command that gets executed.
>
> > - Doug
>
> > On Wed, Apr 28, 2010 at 2:02 PM, Harshada <[email protected]> wrote:
> > > Thanks for the reply Doug, I am running cmake and make along side.
>
> > > But I doubt it will work w/o modifying the compilation statement.
>
> > > As per
> > >http://www.cyberciti.biz/tips/linux-unix-connect-mysql-c-api-program....,
> > > I ll have to compile and link hypertable.cc against MySQL libs and for
> > > that I need to pass $(mysql_config --cflags) & $(mysql_config --libs)
> > > to gcc/g++.
>
> > > On Apr 29, 1:27 am, Doug Judd <[email protected]> wrote:
> > > > Hi Harshada,
>
> > > > We use cmake to build Hypertable.  To add an include directory, add the
> > > > following line to the src/cc/Tools/hypertable/CMakeLists.txt file:
>
> > > > include_directories( <put-mysql-include-dir-here> )
>
> > > > and then re-run cmake and re-build.
>
> > > > - Doug
>
> > > > On Wed, Apr 28, 2010 at 1:18 PM, Harshada <[email protected]>
> > > wrote:
> > > > > Hi All,
>
> > > > > I am using Hypertable as the back end to the system that I am
> > > > > designing.
>
> > > > > I need to connect to local mySQL database using C APIs from src/cc/
> > > > > Tools/hypertable/hypertable.cc file (using #include<mysql.h> file).
>
> > > > > When I include it in src/cc/Tools/hypertable/hypertable.cc I get error
> > > > > as "mysql.h header file not found".
> > > > > I understand that the error is because of not setting proper flags
> > > > > during compilation of hypertable.cc file.
>
> > > > > The proper way is:
>
> > > > > g++ -o <object_file> $(mysql_config --cflags) hypertable.cc $
> > > > > (mysql_config --libs)
>
> > > > > (I have tried the interfaces in a standalone file, where such
> > > > > compilation does work.)
>
> > > > > I tried searching in the Make files, but could not locate the file
> > > > > where I can change the way hypertable.cc is getting compiled.
>
> > > > > Please let me know the path of the makefile which has the g++/gcc
> > > > > statement for compilation of hypertable.cc so that I can change it as
> > > > > per required.
>
> > > > > Thanks & Regards,
> > > > > Harshada
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "Hypertable Development" group.
> > > > > To post to this group, send email to [email protected].
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<hypertable-dev%[email protected]>
> > > <hypertable-dev%[email protected]<hypertable-dev%[email protected]>
>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/hypertable-dev?hl=en.
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups
> > > "Hypertable Development" group.
> > > > To post to this group, send email to [email protected].
> > > > To unsubscribe from this group, send email to
> > > [email protected]<hypertable-dev%[email protected]>
> > > .
> > > > For more options, visit this group athttp://
> > > groups.google.com/group/hypertable-dev?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Hypertable Development" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<hypertable-dev%[email protected]>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/hypertable-dev?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Hypertable Development" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/hypertable-dev?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Hypertable Development" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/hypertable-dev?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Hypertable Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hypertable-dev?hl=en.

Reply via email to