linking to boost?

Oct 29, 2013 at 9:00pm
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?
Oct 29, 2013 at 9:10pm
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.
Oct 29, 2013 at 9:22pm
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?
Oct 29, 2013 at 9:46pm
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
Oct 29, 2013 at 9:47pm
> do i have to link to anything when i compile it?
No, by definition. ;)
Oct 29, 2013 at 10:08pm
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
Oct 29, 2013 at 10:16pm
Try changing the label to jade.
Oct 29, 2013 at 10:46pm
Did you already had a file named "jade" that was newer than the main.cpp, Lexer.cpp, and Debug.cpp?
Oct 29, 2013 at 10:48pm
closed account (Dy7SLyTq)
No. I did already have jade, but it had been compiled from the command line using the same command
Oct 29, 2013 at 11:16pm
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
Oct 30, 2013 at 6:14am
closed account (Dy7SLyTq)
ok thanks i will. does make support globbing?

edit: i did, but it still gives the same error
Last edited on Oct 30, 2013 at 6:15am
Oct 30, 2013 at 6:40am
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)

Oct 30, 2013 at 6:48am
closed account (Dy7SLyTq)
makefile:10: *** missing separator. Stop.
Oct 30, 2013 at 7:11am
Did you copy-paste without replacing the indentation with tab chars?
Oct 30, 2013 at 7:19am
closed account (Dy7SLyTq)
Wait is that the issue? It has to literally be \t? It cant be spaces like in python?
Oct 30, 2013 at 8:09am
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 Oct 30, 2013 at 8:38am
Oct 30, 2013 at 2:31pm
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.