• Forum
  • Lounge
  • Different library version depending on c

 
Different library version depending on compiler -- why?

There is a library for helping with things like opening a window, rendering to it, playing audio and handling events, called SDL2.

Their download page has two separate links for downloading the development library:
(+) One for (Visual C++ 32/64-bit)
(+) Another for (MinGW 32/64-bit)

Why are these versions specific to a particular compiler? Are the object files of the library specific to a compiler? Why would that be?
It could be that one library version is for Windows (Visual C++) and the other is for Linux/Mac (MinGW).
Last edited on
zapshe wrote:
It could be that one library version is for Windows (Visual C++) and the other is for Linux/Mac (MinGW).
It is not so. These both versions of the library are for Windows, I should probably have mentioned.

MinGW is only for windows btw =)
(Minimalist GNU for Windows)
Last edited on
Are the object files of the library specific to a compiler?
Yes, each compiler has its own format for libraries. To make it worse you need to have different libs for different versions. For example VS2017 probably can't use libs from VS2019 or older ones.

Why would that be?
I guess it's because there is no standard.
The MinGW has the Linux style lib files and the VS has the MS style lib files. Also MInGW has makefie install files which the VS version doesn't. There might also be some source differences as well. Some libraries are different on Linux (MinGW) to VS.
Are the object files of the library specific to a compiler?

Yes.

Why would that be?

Because compilers are proprietary software, there is no open compiler standard that compiler writers should abide to.
MSVC is proprietary, MinGW is not. But being proprietary is orthogonal to the existence of a build-environment standard.
It is because MSVC and Mingw interface with Windows differently at a fundamental level...

Oh ok. I thought there was just one format for object files and library files.
Good to know. Thanks all.
Duthomas wrote:
It is because MSVC and Mingw interface with Windows differently at a fundamental level...

I don't understand what is meant by interfacing with Windows.
Alas, you are asking about black magic.

Different compiler systems push the sand around differently.

Please accept this as your answer, as I have no interest in taking you down the rabbit hole. Sorry.

If you really want to know more, you'll have to either find someone who wants to spend the time and energy to try to explain things to you or just dig deep on your own and learn it over time like the rest of us.

Sorry to be so blunt.

[edit] The end result is you generally don't have to care. Just choose the one for your compiler and have fun!
Last edited on
Why driving in Hunday is different from driving in Mercedess?
They are both cars so shouldn't driving experience be the same?

Why BMW can go faster than Yugo? I don't understand aren't both cars supposed go the same speed?


You apply this logic to different compilers and then tell me, does this make sense to you?


Topic archived. No new replies allowed.