Skip to content
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

example1 fails to builds on Windows with mingw gcc #132

Closed
pkatta-ktc opened this issue Oct 30, 2023 · 4 comments
Closed

example1 fails to builds on Windows with mingw gcc #132

pkatta-ktc opened this issue Oct 30, 2023 · 4 comments

Comments

@pkatta-ktc
Copy link

Hello,
When building muparser on windows with mingw gcc 11.2, I see the following linker errors:

x86_64-w64-mingw32/bin/ld.exe: muparser/sources/muparser/samples/example1/example1.cpp:481: undefined reference to `mu::ParserByteCode::ParserByteCode(mu::ParserByteCode const&)'

x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\example1.dir/objects.a(example1.cpp.obj): in function Calc': muparser/sources/muparser/samples/example1/example1.cpp:485: undefined reference to mu::ParserByteCode::ParserByteCode(mu::ParserByteCode const&)'

x86_64-w64-mingw32/bin/ld.exe: muparser/sources/muparser/samples/example1/example1.cpp:507: undefined reference to `mu::ParserByteCode::AsciiDump() const'

x86_64-w64-mingw32/bin/ld.exe: muparser/sources/muparser/samples/example1/example1.cpp:512: undefined reference to `mu::ParserByteCode::AsciiDump() const'

collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [CMakeFiles\example1.dir\build.make:100: example1.exe] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:142: CMakeFiles/example1.dir/all] Error 2

Can you please give me some hints on how to fix this issue?

Thanks.

@pkatta-ktc
Copy link
Author

I was able to figure this out.
It is a missing dll macro for ParserByteCode class for Windows builds

This line:
class ParserByteCode final

needs to be changed to:
class API_EXPORT_CXX ParserByteCode final

@pkatta-ktc
Copy link
Author

Realized just now that closing the issue...will hide it. Since the code change still needs to be done, reopened the issue.

@pkatta-ktc
Copy link
Author

@beltoforion Can you please incorporate the fix that I mentioned above. Thanks.

beltoforion pushed a commit that referenced this issue Nov 1, 2023
@beltoforion
Copy link
Owner

Should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants