This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Making functions visible from a shared library
- To: gcc-help at gcc dot gnu dot org
- Subject: Making functions visible from a shared library
- From: "Szabolcs Borbely" <szabolcs_borbely at hotmail dot com>
- Date: Tue, 15 May 2001 12:59:50 -0400
I have a problem making functions visible from a shared library, so when the
library is loaded from an executable --with dlopen()-- it could call them
via a pointer.
I have tried to recompile with g++ and link with ld, but after dlopen() I
got the error "PT_LOAD segments not page-aligned".
Does anyone have an idea what this could be? Or mey it be simply a
compiler/linker switch?
As a reference here is my compiler command:
g++ -g -c -v -nostdlib -lgcc -I/home/headers -D unix -o <lib_name>.o
<lib_name>.c
And linker command:
ld -nostdlib -export-dynamic -shared -lgcc -lm <obj_to_link>.o -lm
<obj_to_link2>.o -o <lib_name> <lib_name>.o
Thank you all.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com