Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Getting failed when connecting to postgresql

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Getting failed when connecting to postgresql
#3375
Posted by: mooncake 2004-02-15 17:22:51
Hi,
   I had make a linked the libpq.a to the linker there, and copied libpq.dll to the test.cpp same folder, but it prompt me this:  8 C:testmain.cpp
`PQhost' undeclared (first use this function)

Anythings i missed to call it to the compiler?

Thanks.
Meow~
Message2. Re: Getting failed when connecting to postgresql
#3376
Posted by: upCASE 2004-02-15 19:38:42
Hi!
Guess not. Judging from the compiler error you gave you missed to include some header file in your source.
"8 C:testmain.cpp `PQhost' undeclared (first use this function)" -> Means: In linhe 8 in main.cpp you're using the class/struct/type/variable PQhost, but it hasn't been declared yet. So, you can't use it :)
Check if PQhost is a variable. If so, declare it right before you use it. If it is a PQ internal type, include the header where it is 'typedef'ed.

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: Getting failed when connecting to postgresql
#3377
Posted by: mooncake 2004-02-15 20:47:00
Hi UpCase,

     PQHost() is a function where it is one of the prototype in libpq.dll.  Meanwhile, i can't use libpq++ and libpqxx, it seems like compile failed... :'(
     I don't know what files i have to include now....

Thank you.
Meow~
Message4. Re: Getting failed when connecting to postgresql
#3378
Posted by: upCASE 2004-02-15 21:06:52
Hi!
Never used Postgres before, but maybe this helps:
http://www.postgresql.org/docs/7.4/interactive/libpq-status.html

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message5. Re: Getting failed when connecting to postgresql
#3379
Posted by: mooncake 2004-02-15 21:34:17
Hi UpCase,
    THank you.  But, it seems like i am calling the library failed, so that i can't use those functions.. :(
    PostgreSQL is powerful than mySQL, and most of the functions that mySQL doesn't support, but PostgreSQL do support.. :)

Meow~
Message6. Re: Getting failed when connecting to postgresql
#3386
Posted by: mooncake 2004-02-16 21:57:44
Hi UpCase,
    Finally... i had successfully connected to postgreSQL with Dev-Cpp

:)
Meow~
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sun 2024-10-6  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0