postgresql-interfaces / psqlodbc

Other
11 stars 10 forks source link

#define pg_strdup _strdup #15

Closed jboakye closed 3 months ago

jboakye commented 3 months ago

symbol lookup error: /usr/local/lib/psqlodbca.so: undefined symbol: _strdup [Debian][psqlodbc Release 16_004]

davecramer commented 3 months ago

You should report this to the debian maintainer.

jboakye commented 3 months ago

Just curious though why not define it as strdup ... that's my workaround.

df7cb commented 3 months ago

Hi,

anything in /usr/local is not a Debian problem. That's something you compiled yourself and installed there.

df7cb commented 3 months ago

The Debian package build has the same problem, though:

ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini ./reset-db < ./sampletables.sql
./reset-db: symbol lookup error: ../.libs/psqlodbcw.so: undefined symbol: _strdup
make[2]: *** [Makefile:32: installcheck] Error 127

Full build log: https://pgdgbuild.dus.dg-i.net/job/psqlodbc-binaries/83/architecture=amd64,distribution=sid/console

jboakye commented 3 months ago

I just did some research and it seems _strdup is targeted at MS windows? .. seems like the enclosing #ifdefs should make sure _strdup does not get defined for non MS systems. Thank you all for looking into it.

davecramer commented 3 months ago

enclosing #ifdefs ? We can add that to the official code if you can provide the code.

apgrucza commented 3 months ago

Prior to #6, psqlODBC only used _strdup on Windows builds. _strdup is actually part of ISO C and C++, but as it does not compile on all systems, I've created #17 to resolve this issue.

df7cb commented 3 months ago

@davecramer do you plan a new release with the fix?

davecramer commented 3 months ago

I'd like to make sure some other things are fixed first, but sure.