I am learning C++ from the book of stroustrup: programming practice and principles using C++. I program on ubuntu 8.10 using the gcc compiler with the g++ script to compile c++ code. I fail to run the first example program of chapter 12 of this book (section 12.3, page 411), is is freely available on the website: stroustrup.com/Programming/, also the libs needed are available there.
I compile the programming using this command:
g++ -lfltk -lfltk_images -o 12_3 12_3.cpp -I ../lib -L../lib -lbookgui
Compling goes fine, but if I run the program I get into trouble:
*** glibc detected *** ./12-3: free(): invalid size: 0x00007fffb4bb4b50 ***
======= Backtrace: =========
and so on...
I was a bit surprised because I ran exactly the example given in the book, I get the same problems with other examples of this chapter, but not of previous chapters. Anyone a clue how I can trace this the cause of this memory problem?