linking to boost?

closed account (Dy7SLyTq)
so im making a makefile generator for a project, and decided to use boost.filesystem. do i have to link to anything when i compile it?
do i have to link to anything when i compile it?
I'm not sure what you mean, but you'll need to build the boost filesystem library and link to it.
Boost does describe which parts of it are header-only and which have libraries to link.

"makefile generator"? As in GNU automake, cmake, qmake, etc configuration?
closed account (Dy7SLyTq)
kbw wrote:
link to it.

thanks thats what i wanted to know

"makefile generator"? As in GNU automake, cmake, qmake, etc configuration?

yeah i was going to make one but i didnt realize there were ones already out there. ill just use that
> do i have to link to anything when i compile it?
No, by definition. ;)
closed account (Dy7SLyTq)
quick questions about makefiles. i made one real quick
1
2
all:
    ../gcc-4.8.1/bin/g++ -std=c++11 main.cpp Lexer.cpp Debug.cpp -o jade

and saved it as makefile, and ran make, but it said nothing to be done for all
Try changing the label to jade.
Did you already had a file named "jade" that was newer than the main.cpp, Lexer.cpp, and Debug.cpp?
closed account (Dy7SLyTq)
No. I did already have jade, but it had been compiled from the command line using the same command
Try
all: main.cpp Lexer.cpp Debug.cpp
    ../gcc-4.8.1/bin/g++ -std=c++11 main.cpp Lexer.cpp Debug.cpp -o jade
closed account (Dy7SLyTq)
ok thanks i will. does make support globbing?

edit: i did, but it still gives the same error
Last edited on
There is a lot of documents about GNU make.
http://makepp.sourceforge.net/1.19/makepp_tutorial.html

You could:
CXX := ../gcc-4.8.1/bin/g++
# or add ../gcc-4.8.1/bin to PATH before running make
CXXFLAGS := -std=c++11
LIBS := ... # the -Lpath -llib options to get your boost.filesystem

OBJECTS := main.o Lexer.o Debug.o

all: jade

jade: $(OBJECTS)
    $(CXX) -o $@ $(CXXFLAGS) $(OBJECTS) $(LIBS)

clean:
    rm jade $(OBJECTS)

closed account (Dy7SLyTq)
makefile:10: *** missing separator. Stop.
Did you copy-paste without replacing the indentation with tab chars?
closed account (Dy7SLyTq)
Wait is that the issue? It has to literally be \t? It cant be spaces like in python?
No, it has to be indented by tabs.

I'd like to tweak keskiverto's makefile, by adding the Boost Filesystem stuff.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Point to your Boost top level directory
BOOST_ROOT = ../boost_1_54_0

# Hardcode compiler
CXX := ../gcc-4.8.1/bin/g++

CXXFLAGS := -std=c++11 -I$(BOOST_ROOT)
LDFLAGS := -L$(BOOST_ROOT)/stage/lib -lboost_filesystem

SRCS = main.cpp Lexer.cpp Debug.cpp

all: jade

jade: $(SRCS:.cpp=.o)

clean:
	jade: $(SRCS:.cpp=.o)
Last edited on
closed account (Dy7SLyTq)
actually im not using boost anymore. i was using it to generate makefiles for this project, but then i found there are ones already made
Topic archived. No new replies allowed.