I figured out the problem shortly after sending out this email by examining the
config.log. Turned out I forgot the CPPFLAGS="$CPPFLAGS -I/usr/include/soci
-I/usr/include/mysql" before checking for the header.
It would be nice if the soci headers included the full path to the other
headers they depend on (for example mysql/mysql.h instead of mysql.h), but
glancing at the mailing list it seems like this is a known issue (one good way
to approach this is to split your src/ directory in your repo into a src/ and
include/ directory, and in the latter create a 'romic' subdirectory with all
your headers).
Regardless, soci is still a great library and I can use this workaround until a
fix is committed / pushed. Sorry for requesting help for such a trivial
problem, but I hope this helps anyong having the same problem.
Thanks again for soci and keep up the great work!
(BTW, shameless self promotion, but if anyone is interested, the project I'm
using soci for is called Romic, Relational Object Mapping In C++, and can be
checked out / downloaded from sourceforge / my project website:
http://morsi.org/projects/?project=romic)
-Mohammed Morsi (view my blog)
--- On Tue, 7/28/09, M. Morsi <[email protected]> wrote:
From: M. Morsi <[email protected]>
Subject: [SOCI-users] Problem detecting soci/soci-mysql.h with autoconf
To: [email protected]
Date: Tuesday, July 28, 2009, 12:36 PM
First off, thank you for this great project, it is really useful.
I apologize if this has been asked before (I searched the mailing list but
couldn't come up with anything) but I'm having a hard time detecting the
soci/soci-mysql.h and
soci/backends/mysql/soci-mysql.h headers in my configure.ac.
I'll admit I'm relatively new to both soci and the autotools build system, and
since the soci backend modules don't provide pkgconfigs (I've installed all of
them via yum on Fedora 11, including the devel versions), my current approach
to detecting if a backend is installed on my system is to check the headers
Unfortunately while the test for soci/soci.h succeeds, the other tests for the
backend headers fail for whatever reason. Here is a sample configure.ac I wrote
demonstrating the issue:
AC_PREREQ(2.61)
AC_INIT(romic, 0.1.0,
[email protected])
AC_PROG_CXX
AC_LANG(C++)
AC_CHECK_HEADERS([soci/soci.h],,
AC_MSG_ERROR([cannot find soci headers]), -)
AC_CHECK_HEADERS([soci/soci-mysql.h],,
AC_MSG_ERROR([cannot find soci mysql headers]), -)
AC_OUTPUT
Note I'm even using '-' as the last argument, which according to
http://www.gnu.org/software/autoconf/manual/html_node/Generic-Headers.html#Generic-Headers
tells autotools to just check for the existance of the file on the include
path and nothing else.
I generated the configure script using "autoreconf --force --install -I config
-I m4" , and ran it with the standard "./configure" which results in:
<snip>
checking for soci/soci.h... yes
checking for soci/soci-mysql.h...
no
configure: error: cannot find soci mysql headers
Looking at the filesystem, we see:
[mmo...@foohost]$ ls -l /usr/include/soci/soci.h
-rw-r--r--. 1 root root 1432 2009-05-23 08:26 /usr/include/soci/soci.h
[mmo...@foohost]$ ls -l /usr/include/soci/soci-mysql.h
-rw-r--r--. 1 root root 7550 2009-05-23 08:26 /usr/include/soci/soci-mysql.h
I was just wondering if anyone else ran into the problem / if it can be
reproduced, and if there is a fix / workaround, or a better way to detect which
soci backends are installed. Thank you greatly for any help.
-Mohammed Morsi (view my blog)
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
-----Inline Attachment Follows-----
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users