David,

Thanks for the info on linux shared libraries.  I 
compiled and linked using the Makefile below. 
Unfortunately, on execution the results are the same as 
with inlining; same "ignoring redefinition" messages 
and same "function does not exist" message.

-Ned

#  Makefile to generate a new dxexec executable with
#  the OTI spin routines as loadable modules.

OBJ =   ColorList.o \
        CylArea.o \
        EditCamera.o \
        FixContourOrientation.o \
        Insideout.o \
        ProcessBnd.o \
        RemovePlane.o \
        ShiftCamera.o \
        SortLoops.o \
        SpinLines.o \
        SweepCylinder.o \
        user_loadable.o

BASE = /usr/local/dx
ARCH = linux
CFLAGS=  -I$(BASE)/include
LDFLAGS = -Wall -I/usr/X11R6/include -D_GNU_SOURCE --shared -eDXEntry

LIBS_1 = -L$(BASE)/lib_$(ARCH) -L/usr/lib -L/usr/X11R6/lib
-L/usr/local/lib -lDX
LIBS_2 = /home/ned/a.cvs/dx/src/exec/hwrender/opengl/.libs/libOPENGL.a
LIBS_3 = -lnsl  -lXpm -ldl -lXm -lXp -lGLU -lGL
LIBS_4 = -lMagick -ltiff -lfreetype -ljpeg -lpng -ldpstk -ldps -lXext
LIBS_5 = -lXt -lSM -lICE -lX11 -lz -lpthread -lm
LIBS = $(LIBS_1) $(LIBS_2) $(LIBS_3) $(LIBS_4) $(LIBS_5)

CC = gcc

dxexec: $(OBJ)
        $(CC) $(LDFLAGS) $(OBJ) $(OBJ2)  $(LIBS) -o dxexec

user_loadable.c:        OTI_loadable.mdf
        $(BASE)/bin/mdf2c -m OTI_loadable.mdf > user_loadable.c

clean:
        -rm -f core $(OBJ) user_loadable.c
===============================================================

David Thompson wrote:
> 
> For Linux its actually quite easy. Using a similar setup, shown below:
> 
> BASE = /usr/local/dx
> LDFLAGS = --shared -eDXEntry
> CFLAGS = -I$(BASE)/include
> LIBS = "$LIBS -L$(BASE)/lib_$ARCH"
> CC = cc
> 
> OTI_loadable: $(OBJ)
>         $(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o OTI_loadable
> 
> Of course you may need to add more libraries.
> 
> David
> 
> >On the broader question; no, I'm not wedded to the use
> >of inboard modules.  I used loadables on the DEC ALPHA
> >under OSF1 but the last time I visited this question
> >for linux, sharable modules were not an option.  Below
> >are the linker options that I used for the ALPHA, can
> >you tell me what the syntax is for linux?
> >
> >BASE = /usr/lpp/dx
> >LDFLAGS = -shared -all -e DXEntry -expect_unresolved main
> >-expect_unresolved DX*
> >CFLAGS= -O -Dalphax -I$(BASE)/include
> >LIBS = -lDX -ly -ll -lm -lX11
> >SYSLIBS = -lm -lc
> >CC = cc
> >
> >OTI_loadable: $(OBJ)
> >       $(CC) $(LDFLAGS) $(OBJ) $(SYSLIBS) -o OTI_loadable
> >
> >Best,
> >Ned
> >
> 
> --
> .............................................................................
> David L. Thompson                   Visualization and Imagery Solutions, Inc.
> mailto:[EMAIL PROTECTED]    5515 Skyway Drive, Missoula, MT 59804
>                                      Phone : (406)756-7472

Reply via email to