I am planning to use libraries in my C++ program. Development is happening on LINUX but application is designed to compile on both LINUX and Windows. I understand direct equivalent for shared libraries(.so) in windows is DLL, right?
In LINUX using g++, I can create shared library using -fPIC and -shared flags. AFAIK, there is no other code change required for a shared library. But things are different in a Windows DLL. There I should specify the functions which has to be exported using dllexport, right?
My question is how do I manage this situation? I mean dllexport is invalid in LINUX and compiler will give error. But it is required in windows. So how do I write the function which will compile on both platforms without any code change?
Compilers used
g++ - LINUX
VC++ - Windows
Any help would be great!