[FWTools] Probably did something stupid...

Mike Toothaker mtoothaker at milcord.com
Tue Jul 24 15:34:58 EDT 2007


Hello,

 

I am having a problem which is probably just me and linux not getting along.
We are trying to use FWTools 1.3.4 on Fedora 7.  The problem we are having
is that we are trying to use to libraries in the same program, if you are
interested it is smile for belief network interaction and fwtools for
database interaction.  I don't believe that either library is a problem in
itself as we can use them each in programs individually. If I try to use
them in the same program all goes to hell in a hand basket at compile time. 

 

Below is my Makefile for just FWTools, which works:

 

 

CC = g++

CMBN = cmilcordbn

SMILE = Smile

CMDB = cmilcorddb

FWLIB = FWTools/lib

FWINC = FWTools/include

 

test: milcorddb.o milcordpgisdb.o test.cpp

            $(CC) -o test.exe test.cpp      \

            milcorddb.o milcordpgisdb.o     \

            -I$(CMDB) -I$(FWINC) -L$(FWLIB) \

            -lgdal -Wl,-rpath,$(FWLIB)

 

milcordpgisdb.o: milcorddb.o $(CMDB)/MilcordPGISDB.cpp
$(CMDB)/MilcordPGISDB.h

            $(CC) -c $(CMDB)/MilcordPGISDB.cpp -I$(FWINC) -o milcordpgisdb.o

 

milcorddb.o: $(CMDB)/MilcordDBBase.cpp $(CMDB)/MilcordDBBase.h

            $(CC) -c $(CMDB)/MilcordDBBase.cpp -o milcorddb.o

 

 

clean:

            rm -rf *.o

 

 

This is the Makefile for both which will not compile.  The problem seems to
be connected to the "-Wl,-rpath,$(FWLIB)" part, and the error lines seem to
indicate that it is trying to find the libraries for smile even though it
cannot.  So my question is maybe it is because I am trying to mix shared and
static libraries as the smile libraries are .a and the libraries for FWTools
are .so, is it possible to get statically built copies of the FWTools
libraries?  Is there some way that I can have it link in the static
libraries for smile and use the shared ones for FWTools at run time?  If I
leave off the -Wl stuff then I get errors that it has unreferenced function
calls for my gdal functions.

 

 

CC = g++

CMBN = cmilcordbn

SMILE = Smile

CMDB = cmilcorddb

FWLIB = FWTools/lib

FWINC = FWTools/include

 

test: milcordsmilebn.o milcordbn.o test.cpp

            $(CC) -o test.exe test.cpp milcordsmilebn.o milcordbn.o \

            -L$(SMILE) -I$(SMILE) -I$(CMBN) -lsmilearn -lsmilexml -lsmile \

            -L$(FWLIB) -I$(CMDB) -I$(FWINC) -lgdal -Wl,-rpath,$(FWLIB)

 

milcordsmilebn.o: $(CMBN)/MilcordSmileBN.cpp milcordbn.o

            $(CC) -c $(CMBN)/MilcordSmileBN.cpp -I$(SMILE) -o
milcordsmilebn.o

 

milcordbn.o: $(CMBN)/MilcordBN.cpp $(CMBN)/MilcordBN.h 

            $(CC) -c $(CMBN)/MilcordBN.cpp -o milcordbn.o

 

milcordpgisdb.o: milcorddb.o $(CMDB)/MilcordPGISDB.cpp
$(CMDB)/MilcordPGISDB.h

            $(CC) -c $(CMDB)/MilcordPGISDB.cpp -I$(FWINC) -o milcordpgisdb.o

 

milcorddb.o: $(CMDB)/MilcordDBBase.cpp $(CMDB)/MilcordDBBase.h

            $(CC) -c $(CMDB)/MilcordDBBase.cpp -o milcorddb.o

 

clean:

            rm -rf *.o

 

 

Thanks for any help you can give.

 

Mike

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20070724/03f145c9/attachment.html


More information about the FWTools mailing list