Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please tell me how to use it in Xcode #38

Closed
ly886 opened this issue Nov 3, 2017 · 2 comments
Closed

please tell me how to use it in Xcode #38

ly886 opened this issue Nov 3, 2017 · 2 comments

Comments

@ly886
Copy link

ly886 commented Nov 3, 2017

i can't install it in my mac computer

liyudeMBP:Desktop liyu$ g++ link.cpp -lpqxx -lpq
liyudeMBP:Desktop liyu$ g++ link.cpp -lpqxx -lpq
liyudeMBP:Desktop liyu$ g++ link.cpp -lpq
Undefined symbols for architecture x86_64:
"pqxx::connection_base::disconnect()", referenced from:
_main in link-f6a0e9.o
"pqxx::connection_base::init()", referenced from:
pqxx::basic_connectionpqxx::connect_direct::basic_connection(char const*) in link-f6a0e9.o
"pqxx::connection_base::close()", referenced from:
pqxx::basic_connectionpqxx::connect_direct::~basic_connection() in link-f6a0e9.o
"pqxx::connection_base::dbname()", referenced from:
_main in link-f6a0e9.o
"pqxx::connection_base::connection_base(pqxx::connectionpolicy&)", referenced from:
pqxx::basic_connectionpqxx::connect_direct::basic_connection(char const*) in link-f6a0e9.o
"pqxx::connectionpolicy::connectionpolicy(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
pqxx::connect_direct::connect_direct(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in link-f6a0e9.o
"pqxx::connectionpolicy::~connectionpolicy()", referenced from:
pqxx::connect_direct::~connect_direct() in link-f6a0e9.o
"pqxx::connection_base::is_open() const", referenced from:
_main in link-f6a0e9.o
"vtable for pqxx::connect_direct", referenced from:
pqxx::connect_direct::connect_direct(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in link-f6a0e9.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
liyudeMBP:Desktop liyu$ g++ link.cpp -lpq -lpqxx

it always have some erro please help me !
thanks

@ly886
Copy link
Author

ly886 commented Nov 3, 2017

i just want use my xcode to finish a homework how can i link my postgresql with c++ thanks a lot!

@jtv
Copy link
Owner

jtv commented Nov 13, 2017

The last command failed, and that's normal because you didn't link with libpqxx. But what went wrong with the first two commands? I don't see any errors.

@jtv jtv closed this as completed Dec 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants