I use Qt5, msvc2010, windows7 64bit.
I want to test if i can link libpq.lib.
http://www.postgresql.org/docs/9.2/static/libpq-example.html
I build the above example in QtCreator.
And get
error LNK2019: unresolved external symbol _PQconnectdb in function "_main"
I check my libpq.lib use dumpbin libpq.lib /exports
And get
1 PQconnectdb
156 PQconnectdbParams
How to See the Contents of Windows library (*.lib)
so difference is PQconnectdb and _PQconnectdb
.
Is that underscore that makes the linker can't find the real symbol PQconnectdb? Why the compiler add an underscore to the symbol?
How can I solve this problem?