Hi Artyom,

Thanks for the reply.

> Subject: Re: [SOCI-users] SOCI runtime backend error : - Windows,     MS 
> Visual 2005, PostgreSQL, Lib
> 
> The message means that SOCI could not find the dll to load.
> Have you build SOCI PostgreSQL backend as dll?

Actually, I have built it as a static library , in order to stay consistent 
with the mac version.

After successful compilation, I got 2 .lib files
libsoci_core-vc80-d-2_2.lib
libsoci_postgresql-vc80-d-2_2.lib

I added those 2 library files in my VS2005 project, along with all the 
necessary include files
#include "include/soci.h"
#include "include/soci-config.h"
#include "include/soci-postgresql.h"

It compiles just fine.

The runtime did require that I copy several Postgresql DLL (libpq.dll, 
ssleay32.dll, etc) in the current directory.
After that, the final executable launched successfully... 
But it couldn't find the backend ("failed to find shared library" message).

> By name, it would try to load dll dynamically as plugin,
> 
> If you have backend compiled in then just use provided
> factory as is:
>    #include <soci/soci-post...>
>    session sql(postgresql,...)
> 
> If you do use dll, backend name by convention should be
> "libsoci_BACKENDNAME.dll" and dll should be placed in current
> directory.

Just to be on the safe side, I tried your suggestion, by copying both static 
library files .lib in the current directory.
No luck : whether they're present or not doesn't change the error message.

I'm really puzzled, as the error message I saw  is a strong indication that 
libsoci_core.lib is correctly included in my project IMHO.
I don't know why the core would be included correctly, and the backend is not.

I had another idea : is there a particular #define to change, to signal
VC2005 that I want the output be recognized as a static library? Maybe
the executable is expecting DLL output, hence the message?

(and before you ask, I did build SOCI with the project branch 
soci\build\msvc80\lib\ ;-)


Any suggestion is most welcome.

Have a nice day


Andrew
                                          
_________________________________________________________________
Découvrez Windows 7 en 7 secondes !
http://clk.atdmt.com/FRM/go/181574577/direct/01/
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to