LINUX.ORG.RU

История изменений

Исправление af5, (текущая версия) :

Да, щастье быстро закончилось

oglpg-8th-edition/04/ch04_shadowmap$ make
g++ -g  -I../../include -c ../../lib/LoadShaders.cpp
g++ -g  -I../../include ch04_shadowmap.cpp LoadShaders.o   -lglut -lGLEW -o ch04_shadowmap
In file included from ch04_shadowmap.cpp:8:0:
../../include/vapp.h: In member function ‘virtual void VermillionApplication::Initialize(const char*)’:
../../include/vapp.h:33:23: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
In file included from ch04_shadowmap.cpp:11:0:
../../include/vmath.h: In function ‘vmath::Tmat4<T> vmath::lookat(vmath::vecN<T, 3>, vmath::vecN<T, 3>, vmath::vecN<T, 3>)’:
../../include/vmath.h:650:16: error: ‘translate’ was not declared in this scope
../../include/vmath.h:650:27: error: expected primary-expression before ‘>’ token
ch04_shadowmap.cpp: In member function ‘virtual void ShadowMapExample::Display(bool)’:
ch04_shadowmap.cpp:175:34: error: ‘GetTickCount’ was not declared in this scope
make: *** [ch04_shadowmap] Error 1

собираю таким Makefile:

#! make

TARGETS = $(basename $(wildcard *.cpp))

LOAD_SHADERS.src = ../../lib/LoadShaders.cpp
LOAD_SHADERS.obj = LoadShaders.o

CXXOPTS = -g
CXXDEFS = 
CXXINCS = -I../../include

ifdef DEBUG
CXXDEFS += -DDEBUG
endif

CXXFLAGS = $(CXXOPTS) $(CXXDEFS) $(CXXINCS)

LDOPTS =
#LDDIRS = -L../../lib
LDLIBS = -lglut -lGLEW

LDFLAGS = $(LDOPTS) $(LDDIRS) $(LDLIBS)

DIRT = $(wildcard *~ *.o)

#-----------------------------------------------------------------------------

default all: $(TARGETS)

%: %.cpp $(LOAD_SHADERS.obj)
	$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) -o $@

%.i: %.cpp
	$(CXX) $(CXXFLAGS) -E $< | uniq > $@

$(LOAD_SHADERS.obj): $(LOAD_SHADERS.src)
	$(CXX) $(CXXFLAGS) -c $(LOAD_SHADERS.src)

#-----------------------------------------------------------------------------

clean:
	$(RM) $(DIRT)

clobber: clean
	$(RM) $(TARGETS)

Исходная версия af5, :

Да, щастье быстро закончилось

oglpg-8th-edition/04/ch04_shadowmap$ make
g++ -g  -I../../include -c ../../lib/LoadShaders.cpp
g++ -g  -I../../include ch04_shadowmap.cpp LoadShaders.o   -lglut -lGLEW -o ch04_shadowmap
In file included from ch04_shadowmap.cpp:8:0:
../../include/vapp.h: In member function ‘virtual void VermillionApplication::Initialize(const char*)’:
../../include/vapp.h:33:23: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
In file included from ch04_shadowmap.cpp:11:0:
../../include/vmath.h: In function ‘vmath::Tmat4<T> vmath::lookat(vmath::vecN<T, 3>, vmath::vecN<T, 3>, vmath::vecN<T, 3>)’:
../../include/vmath.h:650:16: error: ‘translate’ was not declared in this scope
../../include/vmath.h:650:27: error: expected primary-expression before ‘>’ token
ch04_shadowmap.cpp: In member function ‘virtual void ShadowMapExample::Display(bool)’:
ch04_shadowmap.cpp:175:34: error: ‘GetTickCount’ was not declared in this scope
make: *** [ch04_shadowmap] Error 1

собираю таким Marefile:

#! make

TARGETS = $(basename $(wildcard *.cpp))

LOAD_SHADERS.src = ../../lib/LoadShaders.cpp
LOAD_SHADERS.obj = LoadShaders.o

CXXOPTS = -g
CXXDEFS = 
CXXINCS = -I../../include

ifdef DEBUG
CXXDEFS += -DDEBUG
endif

CXXFLAGS = $(CXXOPTS) $(CXXDEFS) $(CXXINCS)

LDOPTS =
#LDDIRS = -L../../lib
LDLIBS = -lglut -lGLEW

LDFLAGS = $(LDOPTS) $(LDDIRS) $(LDLIBS)

DIRT = $(wildcard *~ *.o)

#-----------------------------------------------------------------------------

default all: $(TARGETS)

%: %.cpp $(LOAD_SHADERS.obj)
	$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) -o $@

%.i: %.cpp
	$(CXX) $(CXXFLAGS) -E $< | uniq > $@

$(LOAD_SHADERS.obj): $(LOAD_SHADERS.src)
	$(CXX) $(CXXFLAGS) -c $(LOAD_SHADERS.src)

#-----------------------------------------------------------------------------

clean:
	$(RM) $(DIRT)

clobber: clean
	$(RM) $(TARGETS)