Is C++ OS dependant or does it go farther than that?
26 minutes ago, Hi P said:1. Does it mean that it will work in just about any machine as long as it's Windows 11?
Â
2. Would it work on any Windows version? Like Windows 10
Only if you static linked it. Otherwise, if you had dynamic links and libraries that you linked to (like the libc) had an API change across cresions, then your binary is going to break.
27 minutes ago, Hi P said:3. What if I developed it in Ubuntu 22, would it work in future and past Ubuntu versions?
Â
4. Would it work on different Linux distros?
Same as above, if you're running your compiled code that was compiled against X glibc and Y kernel ABI, then it should work in any distro or version that is compatible with those versions, otherwise it'll break. If you static link it (as in, those libraries get "copied" inside your binary), then it'll run as-is across most distroes, even with different versions.
28 minutes ago, Hi P said:I have seen a handful of different compilers for C++ , hence the question
Â
Compilers aren't really what makes a binary have more compatibility or not, but rather the libraries you link your code with and how you do so.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now