I have a project build in Microsoft Visual Studio and I want to port it in Linux(OpenSuse 12.2) using Eclipse IDE.
The project is using OpenCV and I have managed to build OpenCV in Linux. It is not that huge, it contains 3 .cpp files and 4 .h files which actually defines the classes used in the project and one of the .cpp files contains the main()
function.
However, there is one additional instances.inc
file with the following content:
#include "graph.h"
#ifdef _MSC_VER
#pragma warning(disable: 4661)
#endif
// Instantiations: <captype, tcaptype, flowtype>
// IMPORTANT:
// flowtype should be 'larger' than tcaptype
// tcaptype should be 'larger' than captype
template class Graph<int,int,int>;
template class Graph<short,int,int>;
template class Graph<float,float,float>;
template class Graph<double,double,double>;
where graph.h
which contains the declaration of Graph
class.
I changed the extension of the instances.inc
file to instances.h
file. However, when I try to build the project I receive the following error:
../src/BranchAndMincut.cpp:246: undefined reference to `Graph<int, int, int>::maxflow(bool, Block<int>*)'
which I guess that it is related to the .inc
file. Do you know how to solve this problem?
EDIT:
I also want to mention that instanes.inc
files was included at the end of the graph.cpp
file.