inline methods not available as symbols of shared library-Collection of common programming errors
If I have a class which will be compiled to a shared object. The class is declared in a .h file and implemented in a .cpp file.
This class contains a couple of inline methods.
If I write some program that links with this shared library and includes the .h file, I will get undefined reference errors when linking it.
Is that because there are no symbols exported for inline methods ?
Am I understanding this correctly ?
UPDATE: some example code below
somelib.h
#ifndef __ABC_LIB_H
#define __ABC_LIB_H
#include
class ABC {
ABC();
~ABC();
inline void not_callable_outside_library();
void callable_outside_library();
};
#endif
somelib.cpp
#include "somelib.h"
ABC::ABC() {}
ABC::~ABC() {}
void ABC::not_callable_outside_library(){ std::cout
Originally posted 2013-11-09 23:30:35.