-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac OS build issues #71
Comments
I've realized after reading the source that the typedefs in 'mypaint-glib-compat.h' are only meant to be defined if 'G_LIB_H' is not defined. Even though I was building with 'glib' ('with-glib' in './configure'), 'G_LIB_H' was not defined for some reason. I got around the problem by removing all includes for the 'mypaint-glib-compat.h' file, and removing the 'G_BEGIN_DECLS' and 'G_END_DECLS'. I will look into why the 'glib' variable was not being defined. |
So the 'glib.h' header file defines G_LIB_H, therefore it needs to be included before 'mypaint-glib-compat.h' is ever included, otherwise the types will be redefined, resulting in the error in my first post. I've now found the hacky way to do this: drop an "#include "glib.h"" in 'config.h', after configuring. This fixes the build for me without having to remove references to 'mypaint-glib-compat.h' as I tried previously. All the unit tests also run fine. It seems that only some of the "mypaint-*.c" source files include the header file: Maybe they should all include it? Not really sure of the ramifications, but it seems logical. |
@scallywag
|
@scallywag What version of glib does your Snow Leopard box have? |
MacPorts user @barracuda156 reported this issue to us again today. libmypaint 1.6.1 doesn't build with Apple gcc 4.2.1 on Mac OS X 10.6.8:
It looks to me like the problem is:
Then:
It seems to me that the solution would be never to include mypaint-glib-compat.h if |
Perhaps unrelated, but it seems to fail on macOS 13 for some reason too: macports/macports-ports#19095 (comment) |
Yes, that's unrelated. This issue is only about type redefinition errors which happen on old compilers. |
@ryandesign I have found now an old portfile which @kencu made for |
As far as I know, that wouldn't be a correct fix because libmypaint doesn't contain any C++ code. It would have the effect of avoiding the use of gcc 4.2.1 (since g++ 4.2.1 doesn't support C++11) but this issue is about fixing the problem when using gcc 4.2.1. |
@ryandesign I am sorry, it is of course |
Either way, specifying an inaccurate language requirement is not the fix I would hope for. The build log shows that |
@ryandesign Yes, I get your point, and it makes good sense. |
I am trying to compile the library on Mac OS X 10.6 (Snow Leopard). It uses a version of GCC that does not support typedef redefinitions [gcc version 4.2.1], so there is an error because of the typedefs in
mypaint-glib-compat.h
that are also present inglib
's definitions. I have tried removing the doubled definitions frommypaint-glib-compat.h
, and this did not work. Is there any way to build on Snow Leopard, using this version of GCC?Here is the full make invocation and error:
The text was updated successfully, but these errors were encountered: