Search code examples
c++visual-studio-200864-bitlibpqxx

libpqxx under Visual Studio 2008 x64


Is anybody here who built libpqxx under Visual Studio 2008 x64? I have built it. Debug with libpqxx_staticD.lib works fine, but Release with libpqxx_static.lib fails at

pqxx::connection conn(...);

Call stack:

postgres.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,pqxx::notification_receiver *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,pqxx::notification_receiver *> >,1> >::_Init()  + 0x60 bytes 
postgres.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,pqxx::notification_receiver *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,pqxx::notification_receiver *> >,1> >::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,pqxx::notification_receiver *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,pqxx::notification_receiver *> >,1> >()  + 0x6c bytes    
postgres.exe!std::multimap<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,pqxx::notification_receiver *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,pqxx::notification_receiver *> > >::multimap<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,pqxx::notification_receiver *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,pqxx::notification_receiver *> > >()  + 0x3f bytes    
postgres.exe!pqxx::connection_base::connection_base()  + 0x83 bytes 
postgres.exe!pqxx::basic_connection<pqxx::connect_direct>::basic_connection<pqxx::connect_direct>(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & opt="host=localhost user=tka4 password=sga19791988 dbname=sfMakseq")  Line 65 + 0x2d bytes   C++
postgres.exe!main(int argc=5, char * * argv=0x00000000003470b0)  Line 36 + 0x40 bytes   C++
postgres.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes

Error message:

"Unhandled exception at 0x000000013f0612e0 in postgres.exe: 0xC0000005: Access violation writing location 0x0000000077225418."

May be you know what do I wrong?


Solution

  • So, first I used /machine:x64 instead of /machine:I386. It was my mistake. It should be /machine:amd64 with "vcvarsall.bat amd64".