I'm attempting to build a project that uses both PostgreSQL (libpq.dll) and CuRL
(libcurl.dll), but I have run into a issue when both are linked into the same
executable. I have a simple test case that I am attaching that demonstrates the
problem.
The resulting binary will not run. Windows or Wine will complain that it cannot
find libpq.dll even though libpq and libcurl are in the same directory.
If you comment out the code that calls curl_global_init() then the resulting
binary runs fine.
Any ideas?
Thanks,
Michael
/* gcc -o libpqtest libpq-test.c -lcurl -lpq */
#include <libpq-fe.h>
#include <curl/curl.h>
int main( int argc, char *argv[] )
{
PGconn *conn = NULL;
const char *conninfo = "host=localhost dbname=db user=db password=test";
conn = PQconnectdb( conninfo );
if ( PQstatus( conn ) != CONNECTION_OK ) {
return -1;
}
PQfinish( conn );
return 0;
}
void foo( void )
{
curl_global_init( CURL_GLOBAL_DEFAULT );
}
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public