Question about the details of Importing and Linking

My project has taken a turn because Qt is just insufficient for the GUI for my application. Therefore, I am using .NET now. However, this is NOT a .NET question.

I have written a wrapper for a few of my classes in the original C++ project. That wrapper imports the entire class needed as the class is declared like this (I have included the method relevant to this question):

1
2
3
4
5
6
class GEOSIMCORE_EXPORT CvPlot
{
	...
	const bool isAdjacentToLand();
	...
};


Here is the implementation of that method. Please note that the StaticPlotStack class is NOT exported.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const bool CvPlot::isAdjacentToLand() 
{
	StaticPlotStack stack;
	CELL_FORMAT->getSearchGrid(&stack, this);
	bool foundLand = false;

	CvPlot* plot = stack.pop();
	while (plot != NULL)
	{
		if (!plot->isWater())
			foundLand = true;
		plot = stack.pop();
	}

	return foundLand;
}


Why is the linker for my wrapper class trying to link to the details of the method? As far as I know the implementation should not matter. Specifically, it is trying to link to all the methods of the StaticPlotStack class yet this is not an inline method... (in which case it would make sense). Is my assumption about importing incorrect?

EDIT: Corrected the mistake of not getting the next plot.
Last edited on
If you export a class, you're exporting everything in the class.
If you want to export selectively, you'll need to use the "pimpl idiom".
Topic archived. No new replies allowed.