In simple terms, to write windows DLL I have to define DllMain and do switch stuffs and then export functions using __declspec(dllexport). If I'm right the question comes what about linux? I want to write it in ubuntu box and I'm stucked! How do Coding DLLs differ from .SO?

Thanks!

DLLs and *nix shared libraries are completely different animials. Here is a link that explains how to create shared libraries. I suppose DLLs and shared libraries could use the same source files for the functions that are in them.

You don't have to define a DLL entrypoint and I don't think you need to use __declspec(dllexport) on *nix (I don't know about static libraries but shared libraries don't need that).

DLLs and *nix shared libraries are completely different animials. Here is a link that explains how to create shared libraries. I suppose DLLs and shared libraries could use the same source files for the functions that are in them.

Thanks AD for the the link. I think I have not well explained it. I meant how do I actually code a library let say is exporting below function in *nix? The link shows how to build but I use IDE to do that ;)

class MyTestClass{
    public:
        double someMath(double a, double b){
            return a*b;
        }
};

Thanks

You don't have to define a DLL entrypoint and I don't think you need to use __declspec(dllexport) on *nix (I don't know about static libraries but shared libraries don't need that).

So you are saying that executable and library are similar in source code only differ in compile/Linking?

Thanks for throwing that ;)

This article has been dead for over six months. Start a new discussion instead.