Boost logo

Boost Users :

From: Shan (blackfin_at_[hidden])
Date: 2006-11-30 16:05:17


Hi,

I'm trying to use boost in a cygwin enviroment. I've installed the
boost-1_33_1 libraries using the cygwin setup program. I have a
makefile to compile a simple program but I keep getting the error.

$ make
g++ -c -O3 cash_flow.cpp
In file included from cash_flow.cpp:6:
cash_flow.h:12: error: `boost' has not been declared
cash_flow.h:12: error: ISO C++ forbids declaration of `shared_ptr' with
no type
cash_flow.h:12: error: expected `;' before '<' token
make: *** [cash_flow.o] Error 1

I'm new to Unix like environments and am not able to setup the makefile
properly. Below is what I have

TARGET = main
CPP = g++
CPPFLAGS = -O3
INCLUDES = -I/usr/include/boost-1_33_1
LDFLAGS =
LIBS = -lboost_1_33_1
SOURCES = $(wildcard *.cpp)
DEPENDS = $(SOURCES:%.cpp=%.d)
OBJECTS = $(DEPENDS:%.d=%.o)
TMPS = $(wildcard *.hpp~) $(wildcard *.cpp~)

$(TARGET) : $(OBJECTS)
    $(CPP) -o $@ $(LDFLAGS) $(OBJECTS) $(LIBS)

clean :
    rm -rf $(TARGET) $(DEPENDS) $(OBJECTS) $(TMPS)

$(DEPENDS) : %.d : %.cpp
    set -e; $(CPP) -MM $(CPPFLAGS) $< \
        | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
        [ -s $@ ] || rm -f $@

$(OBJECTS) : %.o : %.cpp
    $(CPP) -c $(CPPFLAGS) $<

.PHONY : clean

include $(DEPENDS)

I also tried using the includes/library names

I tried that as well

INCLUDES = -I/usr/include/boost-1_33_1
LDFLAGS = -L/usr/lib
LIBS = -lboost_1_33_1

and

$(OBJECTS) : %.o : %.cpp
    $(CPP) -c $(CPPFLAGS) $(INCLUDES) $<

Still get the same error ..

Can someone tell me which libboost*.a should I point to as there are many .. for
eg to use boost::shared_ptr?

Thanks
S.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net