The Dynamic Shared Object library on Linux is approximately equal the dll in Windows. That’s what I found online. But there are some differences and they are explained here: Architecturally what is the difference between a shared object (SO) and a dynamic link library (DLL)?
Then I am confused:
-
In linux one can use -shared to create a DSO library, then link with -lmylib. But in windows, things are different. One have to add dllexport into the code. Only the “exported” part can be linked (If I am correct). Is there a option to make windows dll link-able without adding dllexport? (I tried to make a dll with just functions and no dllexport, but what I can tell so far is that the dll without dllexport is something useless, right?)
-
What does MinGW do? I thought it create dlls in the days when I used it. But now I think the library that created by MinGW-gcc -shared is something else. Is it windows version lib.so? Can MSVS/intel compiler do the similar thing?
I am asking these because of cross platform issues. For example, a linux code can be compiled without any changes on windows machine. But if one want to create a dll by using the code (compiled with MSVS) which is equivalent to the .so without modifying code (adding dllexport), it is impossible. Am I right?
No, you need
dllexport.I have no idea what you mean by the second question, sorry.
Correct me if I’m wrong but you’re restating your first question. So yes you’re right, you can’t do that. you need
dllexport.