Category Archives: cpp

C++11 reading list

C++11 (formerly known as C++0x) is the most recent version of the standard of the C++ programming language. After it was approved by ISO in 2011, many books have been published to embrace the updates. Here are THREE core books that I recommend: one language tutorial, one library tutorial, and one bible.

C++ Primer (5th Edition)

Although it is called “primer”, this book is actually written for both beginners and experienced C++ programmers. The 5th Edition is fully updated and recast for C++11 standard as well. As a real tutorial of C++ programming language, it provides authoritative and comprehensive introduction to C++11. Another highlight is its huge amount of examples to help readers learn and understand the language fast.

Undefined reference to Sqrt — A quick note to compile SVM-multiclass

When I compiled SVM-multiclass using make, I got an error msg saying “undefined reference to sqrt“. I check the makefile and found that -lm is included in the gcc flags.

The trick here is to put the library AFTER the module you are compiling. The problem is a reference thing. The linker resolves references in order, so when the library is BEFORE the module being compiled, the linker gets confused and does not think that any of the functions in the library are needed. By putting the library AFTER the module, the references to the library in the module are resolved by the linker. read more