gjtorikian / mathematical

Convert mathematical equations to SVGs, PNGs, or MathML. A general wrapper to Lasem and mtex2MML.
https://gjtorikian.github.io/mathematical/
MIT License
166 stars 31 forks source link

error: implicit declaration of function (Gem does not compile on OSX) #101

Closed timothypratley closed 3 years ago

timothypratley commented 3 years ago
mathematical.c:104:5: error: implicit declaration of function
'mtex2MML_free_string' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
    mtex2MML_free_string(mathml);
    ^
mathematical.c:104:5: note: did you mean 'itex2MML_free_string'?
./lasem_overrides.h:12:6: note: 'itex2MML_free_string' declared here
void itex2MML_free_string (char * str);
     ^

I followed the installation dependencies instructions here: https://github.com/asciidoctor/asciidoctor-mathematical/issues/81

Is this an easy change to make?

gjtorikian commented 3 years ago

Which version of OS X is this? And could I ask—do you happen to know which C compiler is used on your machine?

timothypratley commented 3 years ago

Hi @gjtorikian

I'm on macOS Big Sur Version 11.1

$ cc --version
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

XCode.

timothypratley commented 3 years ago

For reference, I checked out the mathematical project and received the same compile error. Adding #include <mtex2MML.h> to mathematical.h allows the project to compile successfully. Happy to submit a PR, I haven't really read the code so it seems to me there might be a better place to include the header file... but ultimately this seems like a tiny oversight that the Apple compiler is just more picky about.

gjtorikian commented 3 years ago

Oh yeah if that worked I’d definitely take a PR for it!

timothypratley commented 3 years ago

@gjtorikian cool, I had to fiddle with the CI settings a little bit to get it to pass, but it seems to be ready for your review now.

timothypratley commented 3 years ago

Thank you @gjtorikian for the quick merge and release. Solved.