Bjarne Stroustrup's header files not working

Hi, i am having huge problem right now. I'm learning C++ from his book "Programming Principles and Practice Using C++" and now im at chapter 12. He uses his own header files what are available on his website.

http://www.stroustrup.com/Programming/Graphics/
http://www.stroustrup.com/Programming/PPP2code/

Also here people can download his own code from chapter 12 what he used (and any other chapter)
http://www.stroustrup.com/Programming/Programming-code.zip

None of these codes are working.

The Problem is i cant compile my program when im using them and i dont really know how to make it all work.

Maybe anyone has learned from his book and know where to get working header and cpp files.

PS : i got my FLTK library to work so its not problem there


EDIT : got it to compile but im having linker error now (32 of them)


Error 54 error LNK1120: 32 unresolved externals C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\Debug\testing3.exe testing3
Error 41 error LNK2001: unresolved external symbol "class Fl_Graphics_Driver * fl_graphics_driver" (?fl_graphics_driver@@3PAVFl_Graphics_Driver@@A) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Graph.obj testing3
Error 10 error LNK2001: unresolved external symbol "protected: virtual void __thiscall Fl_Window::flush(void)" (?flush@Fl_Window@@MAEXXZ) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\chapter.12.7.6.obj testing3
Error 11 error LNK2001: unresolved external symbol "protected: virtual void __thiscall Fl_Window::flush(void)" (?flush@Fl_Window@@MAEXXZ) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Simple_window.obj testing3
Error 12 error LNK2001: unresolved external symbol "protected: virtual void __thiscall Fl_Window::flush(void)" (?flush@Fl_Window@@MAEXXZ) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Window.obj testing3
Error 14 error LNK2001: unresolved external symbol "public: virtual __thiscall Fl_Window::~Fl_Window(void)" (??1Fl_Window@@UAE@XZ) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Simple_window.obj testing3
Error 15 error LNK2001: unresolved external symbol "public: virtual __thiscall Fl_Window::~Fl_Window(void)" (??1Fl_Window@@UAE@XZ) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Window.obj testing3
Error 31 error LNK2001: unresolved external symbol "public: virtual class Fl_Image * __thiscall Fl_Image::copy(int,int)" (?copy@Fl_Image@@UAEPAV1@HH@Z) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Graph.obj testing3
Error 16 error LNK2001: unresolved external symbol "public: virtual int __thiscall Fl_Window::handle(int)" (?handle@Fl_Window@@UAEHH@Z) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\chapter.12.7.6.obj testing3
Error 17 error LNK2001: unresolved external symbol "public: virtual int __thiscall Fl_Window::handle(int)" (?handle@Fl_Window@@UAEHH@Z) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Simple_window.obj testing3
Error 18 error LNK2001: unresolved external symbol "public: virtual int __thiscall Fl_Window::handle(int)" (?handle@Fl_Window@@UAEHH@Z) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Window.obj testing3
Error 32 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Image::color_average(unsigned int,float)" (?color_average@Fl_Image@@UAEXIM@Z) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Graph.obj testing3
Error 33 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Image::desaturate(void)" (?desaturate@Fl_Image@@UAEXXZ) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Graph.obj testing3
Error 36 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Image::draw(int,int,int,int,int,int)" (?draw@Fl_Image@@UAEXHHHHHH@Z) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Graph.obj testing3
Error 34 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Image::label(class Fl_Widget *)" (?label@Fl_Image@@UAEXPAVFl_Widget@@@Z) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Graph.obj testing3
Error 35 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Image::label(struct Fl_Menu_Item *)" (?label@Fl_Image@@UAEXPAUFl_Menu_Item@@@Z) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Graph.obj testing3
Error 37 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Image::uncache(void)" (?uncache@Fl_Image@@UAEXXZ) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Graph.obj testing3
Error 26 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::hide(void)" (?hide@Fl_Window@@UAEXXZ) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\chapter.12.7.6.obj testing3
Error 27 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::hide(void)" (?hide@Fl_Window@@UAEXXZ) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Simple_window.obj testing3
Error 28 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::hide(void)" (?hide@Fl_Window@@UAEXXZ) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Window.obj testing3
Error 19 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::resize(int,int,int,int)" (?resize@Fl_Window@@UAEXHHHH@Z) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\chapter.12.7.6.obj testing3
Error 20 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::resize(int,int,int,int)" (?resize@Fl_Window@@UAEXHHHH@Z) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Simple_window.obj testing3
Error 21 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::resize(int,int,int,int)" (?resize@Fl_Window@@UAEXHHHH@Z) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\Window.obj testing3
Error 23 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::show(void)" (?show@Fl_Window@@UAEXXZ) C:\Users\Girts\Documents\Visual Studio 2013\Projects\BJARNE STROUSTRUP\CHAPTER_12_USING SHAPE PRIMITIVES\testing3\testing3\chapter.12.7.6.obj testing3
Error 24 error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::show(void)" (?show@Fl_Window@@UAEXXZ)



Some of the errors. What could they mean?
Last edited on
Linker error. The linker has to see all the necessary object files / libraries that contain the compiled implementations of symbols. Do you include all the necessary object files on the link command?
u mean are all files included in each other somehow?

I dont know what link command is

So linker doesnt know where all the object files are?
(i see that there are all the object files created in my debug folder. Shouldnt it know what to do with them?)

Also i have some kind of file called - Makefile (type - File) Maybe thats supposed to do something?

Inside of Makefile
#
# This is a common Makefile for code examples from the book
# "Software - Principles and Practice using C++" by Bjarne Stroustrup
#

#
# Usage:
# make - Build all examples
# make clean - Clean all examples
#

INCLUDES = -I"$(FLTK)"
LIBS = -lstdc++
CXXFLAGS = $(INCLUDES) -Wall -time -O3 -DNDEBUG
LIBFLAGS =
AR = ar

.SUFFIXES: .cpp .o

# Create a list of source files.
SOURCES = $(shell ls *.cpp)
# Create a list of object files from the source file lists.
OBJECTS = ${SOURCES:.cpp=.o}
# Create a list of targets.
TARGETS = libbookgui.a

# Build all targets by default
all: $(TARGETS)

%.a: $(OBJECTS)
$(AR) rcs $@ $(OBJECTS)

# A rule to build .o file out of a .cpp file
%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<

# A rule to clean all the intermediates and targets
clean:
rm -rf $(TARGETS) $(OBJECTS) *.out *.stackdump
Last edited on
That makefile isn't for Visual Studio 2013's compiler. The VS2013 has different project management (of which I know nothing about, and you have to learn properly).
Hi i checked that on bigger projects when im using just FLTK library it wont compile so there is actualy problem with my fltk not Stroustrup's files. I'll try to add this library so it all works and than will ask for help if something is not going right
So far, thanks for showing interest in this question and have a nice day :)
Topic archived. No new replies allowed.