I have a static library project and a exe project. The exe project uses the static lib. In my static lib I have several classes split into seperate .h and .cpp files. However the project is that some of the classes require __declspec(dllexport) and some don't. All of the classes are used in the exe in a similar fasion. If I don't put __declspec(dllexport) on the classes that some reason require it I get the error:

error LNK2001: unresolved external symbol "public: __thiscall EffectObjectBase:perator char const *(void)" (??BEffectObjectBase@@QAEPBDXZ) Main.obj

Of course if I don't use that class in the exe the error doesn't exist. The class looks like this:

class EffectObjectBase
friend class Effect;
friend class EffectTechnique;

	Effect* effect;
	D3DXHANDLE handle;

	__forceinline Effect* GetEffect();
	__forceinline D3DXHANDLE GetHandle();

	__forceinline operator D3DXHANDLE();
Just a note, both Effect and EffectTechnique also require __declspec(dllexport).

Does anyone have an idea why some of the classes require it and the others don't?