Sign in to follow this  

SDL & Linux

This topic is 3110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, Today I loaded my visual studio project to check Linux compatibility. I fixed some small things but now I am stuck on this: error: conflicting declaration ‘typedef long unsigned int size_t’ error: ‘size_t’ has a previous declaration as ‘typedef unsigned int size_t’ I know very well what this means but I do not know how to solve it. My windows xp pc is 32 bit, and my Ubuntu pc is 64 bit. I tried -m32 but it gave me the same error but then on a different typedef. The conflict is between SDL_config_minimal.h and in the -m32 case: stdint.h, and in the x64 case: stddef.h How can I solve this? (Without actually modifing the header files that is). Thanks a lot!

Share this post


Link to post
Share on other sites
The SDL header files should never try to redefine size_t on Linux, so if you've just copied the Windows headers to your Linux machine instead of properly installing the SDL development package (libsdl1.2-dev) through apt-get/synaptic, that's most likely what causes trouble.

Share this post


Link to post
Share on other sites
Thanks for the reply.

Yes I did just copy, but since I am building from source I thought that should have been taken care of?

Share this post


Link to post
Share on other sites
Quote:
Original post by Dolf
Thanks for the reply.

Yes I did just copy, but since I am building from source I thought that should have been taken care of?
SDL presents the same interface to the outside world, but its internals are by necessity quite different depending on which platform it's run/compiled on. The problem you're running into, for example, is that SDL has to define size_t for MSVC since MSVC apparently doesn't do that itself. With GCC, on the other hand, size_t is always defined in the standard headers, so SDL obviously has no business redefining it if used with GCC.

This situation could have been solved by #define hackery, but many others would not. For example, the low level interface to sound devices (or any devices, for that matter) is very different on most of SDL's supported platforms, and the format for the link-time libraries as well. The SDL dev packages only support the specific platform they're intended for, so you'll have to install the proper one, either for cross compiling or, as in your case, on a build machine running the target platform.

Share this post


Link to post
Share on other sites

This topic is 3110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this