-
Notifications
You must be signed in to change notification settings - Fork 27
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
Library Linking is not Working #71
Comments
configure script tries to compile a simple C program, which should link against postgresql client library. There is a chance that the script is misguided, but more likely that's an issue with your setup You can try to debug it yourself:
or even just by trying to compile #include <libpq-fe.h>
int
main (void)
{
char conninfo[]="dbname = postgres";
PGconn *conn;
conn = PQconnectdb(conninfo);
return 0;
} program first |
It looks like I'm just having an error compiling the script you gave. I almost have everything working, but I can't do anything if I don't link the library argument like so:
I tried including "C:/Program FIles/Postgresql/17/bin" in both LIBRARY_PATH and LD_LIBRARY_PATH envs, but I haven't gotten anywhere far yet. If I don't link the library argument then I get errors like (there's a hundred more using -lpq):
Edit: I have tried changing -lpq to -llibpq because I figured out what -l actually does and this compiles fine, so if I want
Edit 2: I was messing around some more and I tried changing the configure script to use -llibpq instead of -lpq and it actually linked all the way through. I'm not sure why it should work though. Maybe on later versions it just got renamed, so for now I'll just make a copy of the library and rename it "pq," which didn't end up working. |
By the looks of it, -lpq typically works because |
I wanted to try what backend development would be like in Haskell, so I'm kind of new to this, but I keep getting this error log. I tried setting my env path to the Postgres 17 libs and bins, and a bunch of other alternatives, and it seems it found some form of a libpq file. Still, there's not enough information or context on what library linking even means here, so I'm probably missing something big (for example using Windows might just be a massive hindrance).
The text was updated successfully, but these errors were encountered: