pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedLinker Confusion.....
3+ messages / 3 participants
[nested] [flat]
* Linker Confusion.....
@ 2009-07-23 19:47 Ralf Hasemann <rhasemann@mac.com>
0 siblings, 1 reply; 3+ messages in thread
From: Ralf Hasemann @ 2009-07-23 19:47 UTC (permalink / raw)
To: pgsql-interfaces
Hello,
I am wirting an application that uses the libpq interface to access
the PostgreSQL database. My system is Mac OS X.
I have set up my project in Xcode and everything works fine. DB access
is flawless and very fast. But I often like to dig deeper into things
to get knowledge on how things work. What confuses me is, when I use
otool to inspect my executable, I get the information that my app is
linked against libpq.5.dylib (which is a symlink to libpq.5.1.dylib),
which is probably the dynamic library that does the work in
communicating with the database server.
But what I don't understand: In my Xcode project, I have put libpq.a
(and not libpq.5.dylib!) into the linked frameworks of my project and
the project is build against it.
How does the linker know to link against libpq.5.dylib when libpq.a is
the only lib in my project?
I hope my problem description is not too confusing....
Thank you for any answer and thank you to the PostgreSQL team for the
great database! ;-)
Best regards,
Ralf
^ permalink raw reply [nested|flat] 3+ messages in thread
* Linker Confusion.....
@ 2009-07-23 20:19 osxdeveloper@mac.com
0 siblings, 0 replies; 3+ messages in thread
From: osxdeveloper@mac.com @ 2009-07-23 20:19 UTC (permalink / raw)
To: pgsql-interfaces
Hello,
I am wirting an application that uses the libpq interface to access
the PostgreSQL database. My system is Mac OS X.
I have set up my project in Xcode and everything works fine. DB access
is flawless and very fast. But I often like to dig deeper into things
to get knowledge on how things work. What confuses me is, when I use
otool to inspect my executable, I get the information that my app is
linked against libpq.5.dylib (which is a symlink to libpq.5.1.dylib),
which is probably the dynamic library that does the work in
communicating with the database server.
But what I don't understand: In my Xcode project, I have put libpq.a
(and not libpq.5.dylib!) into the linked frameworks of my project and
the project is build against it.
How does the linker know to link against libpq.5.dylib when libpq.a is
the only lib in my project?
I hope my problem description is not too confusing....
Thank you for any answer and thank you to the PostgreSQL team for the
great database! ;-)
Best regards,
Ralf
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Linker Confusion.....
@ 2009-07-23 21:39 Tom Lane <tgl@sss.pgh.pa.us>
parent: Ralf Hasemann <rhasemann@mac.com>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 2009-07-23 21:39 UTC (permalink / raw)
To: Ralf Hasemann <rhasemann@mac.com>; +Cc: pgsql-interfaces
Ralf Hasemann <rhasemann@mac.com> writes:
> How does the linker know to link against libpq.5.dylib when libpq.a is
> the only lib in my project?
You'd be best advised to ask that on an OSX development list; it's not
particularly a Postgres question, but a question of the behavior of the
development tools on that platform.
Mind you, the above behavior is probably *good*, and I don't recommend
you try to override it. Statically linked libraries are a real pain
in the neck when it comes time for a software update. But exactly how
the toolchain you're using finds the dynamic library, I don't know.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2009-07-23 21:39 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-07-23 19:47 Linker Confusion..... Ralf Hasemann <rhasemann@mac.com>
2009-07-23 21:39 ` Tom Lane <tgl@sss.pgh.pa.us>
2009-07-23 20:19 Linker Confusion..... osxdeveloper@mac.com
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox