Hi,

We're a group of new users to SOCI, trying to find some basic footing.
We've run into a compilation stumbling block & can't grok our way around it.
Specifically, when building the postgresql backend using the cmake build
system, we receive the following error:

[ 63%] Building CXX object
backends/postgresql/CMakeFiles/soci_postgresql.dir/statement.cpp.o
/usr/local/CN/src/soci/src/backends/postgresql/statement.cpp: In member
function 'virtual long long int
soci::postgresql_statement_backend::get_affected_rows()':
/usr/local/CN/src/soci/src/backends/postgresql/statement.cpp:448: error:
'strtoll' was not declared in this scope
*** Error code 1

We see at the top of the code, strtoll() is pulled in from #include
<cstdlib>, but the compiler can't seem to resolve the declaration.

Details:

        FreeBSD 8.2-RELEASE-p4
        gcc version 4.2.1 20070719

We used a fresh copy of SOCI was pulled from git.

        cd /usr/local/CN/src
        git clone git://soci.git.sourceforge.net/gitroot/soci/soci

The cmake procedure we used was:

        cd /usr/local/CN/src/soci
        mkdir build
        cd build
        cmake -G "Unix Makefiles" -DWITH_ODCB=OFF ../
        make

Here's what we've tried so far:

At first, we thought it was as simple as just adding an include directive to
the compile (-I), but lack of familiarity with the cmake system made it
impossible to quickly figure out how todo this (the cmake system looks
really interesting - especially in light of our own internal need for
multi-platform builds - will need to research this much much more carefully
later). After awhile, we realized it was not the include path, so we moved
onto other tries.

Next, we thought maybe it was a namespace issue, so we tried to edit the
offending line to specify scope. We tried:

        Line 448:       long long result = ::strtoll(resultStr, &end, 0)

And we tried:

        Line 448:       long long result = std::strtoll(resultStr, &end, 0)

But still got the same error.

We wrote a quick program to confirm we didn't have something fundamentally
broken with our compiler, and confirmed the following code can compile
without any trouble:

        #include <cstdlib>
        long long f(const char* r, char* e) {
                return strtoll(r, &e, 0);
                }

No problem.

Clearly this is our own flat-out mis-understanding of cmake and how SOCI is
put together. But because we're new to both systems, we're having trouble
finding our way. But SOCI looks so fantastic, we're not willing to give up.

Could anyone shed a little light on what we might be doing wrong, or point
us to an RTFM that might push us in the right direction?

Thanks
Jim




------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to