example1 fails to builds on Windows with mingw gcc
pkatta-ktc opened this issue · 4 comments
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.
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
Realized just now that closing the issue...will hide it. Since the code change still needs to be done, reopened the issue.
@beltoforion Can you please incorporate the fix that I mentioned above. Thanks.
Should be fixed