Page 1 of 1

libpqxx windows 7 mingw

Posted: Sun Apr 20, 2014 3:18 am
by guzzi_jones
Does anyone have a tutorial on how to get libpqxx compiled oonwindows. I am sort of newb. I got it to compile using vc2008. That doesnt seem to work with mingw in code blocks. I get an error that t1 is not defined. Can I compile libpqxx with vc2008 and use with mingw?

Re: libpqxx windows 7 mingw

Posted: Sun Apr 20, 2014 8:32 pm
by PB
I have never used PostgreSQL so I don't know much of it, I don't even know if that library is your best choice when it comes to the C++interface it PostgreSQL.
guzzi_jones wrote:Can I compile libpqxx with vc2008 and use with mingw?
No, that is pretty much impossible. Even the first answer in [https://pqxx.org/development/libpqxx/wiki/FaqBuilding]the libpqxx building FAQ[/url] says no. The same FAQ confirms that you can build it with GCC. The very same FAQ mentions you can build it with MinGW.

I don't see why you would need to build the library with C:B, just compile it with command line mingw make and only tell C:B where the include, source and lib files are.

Assuming you have followed the instructions found in win32/install.txt and you still failed, it would be for best to ask on the libpqxx forum, it has nothing to do with wxWidgets and people there should be more knowledgeable about the issue.

Re: libpqxx windows 7 mingw

Posted: Mon Apr 21, 2014 1:06 am
by guzzi_jones
redacted

Re: libpqxx windows 7 mingw

Posted: Mon Apr 21, 2014 6:55 am
by PB
Sorry, as I said I have no experience with PostgreSQL.

On the other hand, I have a brief experience with MinGW. Based on this, I know I can't have MSYS in the path because it prevents me from compiling pretty much anything. Once I remove it and leave only MinGW\bin there, everything works for me. But as I believe I told you that before, I guess you have a reason for doing that. I am no GCC/MinGW expert so it is very likely I am missing something here.

Re: libpqxx windows 7 mingw

Posted: Mon Apr 28, 2014 1:32 am
by guzzi_jones
just fyi here. i was able to compile libpqxx with mingw
changing this line in common file: LIBPQPATH=$(PGSQLSRC)\interfaces\libpq LIBPQDLL=libpq.dll LIBPQLIB=libpqdll.lib

continue to follow other instructions in install.txt as normal

postgresql is a great database, but man is it tough to get going.