Tag Archives: svm multiclass

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