简体   繁体   中英

libpq: which lib files should I use

I used the PostgreSQL as my data base and I am coding a c++ project, so I have to use the libpq to connect it.

I have already found the include file and lib file in the PostgreSQL file but there are too many files. I think I don't need to add them all.
For the include file, I just added libpq-fe.h , pg_config_ext.h and postgres_ext.h , then I included the libpq-fe.h , it seems that everything goes well, I can call some functions such as PQconnectdb , PQexec etc. But when I compile it, I get some LNK errors, meaning that I didn't add the right lib files.
I've tried to add libpq.lib and libpq.dll , but I still got the LNK errors.
Does someone know which lib files should I add?

I got this error because of the wrong version.
Here is a same problem which has been solved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM