HI all-

I entered in the following code and it compiles with no errors but then I
get linker errors. Below is the code and the linker errors. Please provide
any tips so that I can link correctly. I tried to include all the paths
libraries and include directories in my environment. I put the following
link line in the IDE:
-Wl,--stack,20000000 -o cyclone.exe
-LC:/msys64/usr/local/firebird-3.0/lib64  -lsoci_empty_4_0 -lsoci_core_4_0
-lsoci_firebird_4_0

I think it is something that I am missing and I don't blame it on MinGW or
SOCI. My cmake to build worked perfectly!

#include "soci/soci.h"
#include "soci-firebird.h"
#include <iostream>
#include <istream>
#include <ostream>
#include <string>
#include <exception>
using namespace soci;
using namespace std;

int main()
{
    try
    {
        session sql(firebird, "service=C:/Program
Files/Firebird/Firebird_3_0/examples/empbuild/EMPLOYEE.FDB user=SYSDBA
password=masterkey");
        int count;
        sql << "select count(*) from phonebook", into(count);
        cout << "We have " << count << " entries in the phonebook.\n";

    }
    catch (exception const &e)
    {
        cerr << "Error: " << e.what() << '\n';
    }

----- madness ( MAIN GCC DEBUG DEBUG_FULL WIN32 )
Linking...
C:/Ultimate++/upp/out/MyApps/madness/MINGWx64.Debug.Debug_Full.Main.Noblitz\madness.o:
In function `main':
C:/Ultimate++/upp/MyApps/madness/madness.cpp:17: undefined reference to
`soci::session::session(soci::backend_factory const&,
std::__cxx11::basic_string<char, std::ch
    ar_traits<char>, std::allocator<char> > const&)'
C:/Ultimate++/upp/MyApps/madness/madness.cpp:19: undefined reference to
`soci::details::once_temp_type::~once_temp_type()'
C:/Ultimate++/upp/MyApps/madness/madness.cpp:17: undefined reference to
`soci::session::~session()'
C:/Ultimate++/upp/MyApps/madness/madness.cpp:19: undefined reference to
`soci::details::once_temp_type::~once_temp_type()'
C:/Ultimate++/upp/MyApps/madness/madness.cpp:17: undefined reference to
`soci::session::~session()'
C:/Ultimate++/upp/out/MyApps/madness/MINGWx64.Debug.Debug_Full.Main.Noblitz\madness.o:
In function `soci::details::once_temp_type
soci::details::once_type::operator<<
     <char [31]>(char const (&) [31])':
C:/msys64/usr/local/firebird-3.0/include/soci/once-temp-type.h:78:
undefined reference to
`soci::details::once_temp_type::once_temp_type(soci::session&)'
C:/msys64/usr/local/firebird-3.0/include/soci/once-temp-type.h:80:
undefined reference to `soci::details::once_temp_type::~once_temp_type()'
C:/Ultimate++/upp/out/MyApps/madness/MINGWx64.Debug.Debug_Full.Main.Noblitz\madness.o:
In function `void
soci::details::ref_counted_statement_base::accumulate<char [3
    1]>(char const (&) [31])':
C:/msys64/usr/local/firebird-3.0/include/soci/ref-counted-statement.h:58:
undefined reference to
`soci::details::ref_counted_statement_base::get_query_stream[abi:cxx1
    1]()'
C:/Ultimate++/upp/out/MyApps/madness/MINGWx64.Debug.Debug_Full.Main.Noblitz\madness.o:madness.cpp:(.rdata$_ZTVN4soci7details9into_typeIiEE[_ZTVN4soci7details9into_typ
    eIiEE]+0x20): undefined reference to
`soci::details::standard_into_type::define(soci::details::statement_impl&,
int&)'
C:/Ultimate++/upp/out/MyApps/madness/MINGWx64.Debug.Debug_Full.Main.Noblitz\madness.o:madness.cpp:(.rdata$_ZTVN4soci7details9into_typeIiEE[_ZTVN4soci7details9into_typ
    eIiEE]+0x28): undefined reference to
`soci::details::standard_into_type::pre_exec(int)'
C:/Ultimate++/upp/out/MyApps/madness/MINGWx64.Debug.Debug_Full.Main.Noblitz\madness.o:madness.cpp:(.rdata$_ZTVN4soci7details9into_typeIiEE[_ZTVN4soci7details9into_typ
    eIiEE]+0x30): undefined reference to
`soci::details::standard_into_type::pre_fetch()'
C:/Ultimate++/upp/out/MyApps/madness/MINGWx64.Debug.Debug_Full.Main.Noblitz\madness.o:madness.cpp:(.rdata$_ZTVN4soci7details9into_typeIiEE[_ZTVN4soci7details9into_typ
    eIiEE]+0x38): undefined reference to
`soci::details::standard_into_type::post_fetch(bool, bool)'
C:/Ultimate++/upp/out/MyApps/madness/MINGWx64.Debug.Debug_Full.Main.Noblitz\madness.o:madness.cpp:(.rdata$_ZTVN4soci7details9into_typeIiEE[_ZTVN4soci7details9into_typ
    eIiEE]+0x40): undefined reference to
`soci::details::standard_into_type::clean_up()'
C:/Ultimate++/upp/out/MyApps/madness/MINGWx64.Debug.Debug_Full.Main.Noblitz\madness.o:
In function `soci::details::into_type<int>::~into_type()':
C:/msys64/usr/local/firebird-3.0/include/soci/into-type.h:134: undefined
reference to `soci::details::standard_into_type::~standard_into_type()'
C:/Ultimate++/upp/out/MyApps/madness/MINGWx64.Debug.Debug_Full.Main.Noblitz\madness.o:madness.cpp:(.rdata$.refptr._ZN4soci8firebirdE[.refptr._ZN4soci8firebirdE]+0x0):
     undefined reference to `soci::firebird'
C:/Ultimate++/upp/out/MyApps/madness/MINGWx64.Debug.Debug_Full.Main.Noblitz\madness.o:madness.cpp:(.rdata$.refptr._ZTVN4soci7details18standard_into_typeE[.refptr._ZTV
    N4soci7details18standard_into_typeE]+0x0): undefined reference to
`vtable for soci::details::standard_into_type'
collect2.exe: error: ld returned 1 exit status
There were errors. (0:00.47)

}
_______________________________________________
soci-users mailing list
soci-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to