You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example provided in Shared does not work correctly when built with GCC using MinGW64 - the log output from the two shared libraries is never printed.
I've attempted to provide some instructions on how to reproduce, let me know if you have any issues.
Important: Edit the SharedApp/main.cpp to rename SharedLib1.dll and SharedLib2.dll in the LoadLibraryW calls to libSharedLib1.dll and libSharedLib2.dll (since cmake will prefix dll names with lib in this environment)
The log messages from the two libraries is missing
Expected Behaviour
The shared libraries will import the Plog instance and print the expected log messages
Notes
Check the exported symbols from SharedApp.exe with Dependencies (https://github.com/lucasg/Dependencies), we can see SharedApp.exe does export the plog symbols:
So the symbols are correctly being exported, but the shared libraries are not importing them correctly.
Calling plog::Logger<0>::getInstance(); in one of the shared libraries returns a null pointer.
Environment
MINGW64 installed with MSYS2
GCC 12.2 compiler
$ gcc --version
gcc.exe (Rev6, Built by MSYS2 project) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
CMake 3.25.1
Plog version d60df3a1efa99061f637c263fe4e467c273d8655
Same behaviour with last tagged release 1.1.9
The text was updated successfully, but these errors were encountered:
Unfortunately MinGW doesn't play well with exporting/importing classes and inline functions (and they should be inline as they are in headers). I don't see an easy way to fix this.
However you can achieve the similar functionality with the Chained example.
The example provided in
Shared
does not work correctly when built with GCC using MinGW64 - the log output from the two shared libraries is never printed.I've attempted to provide some instructions on how to reproduce, let me know if you have any issues.
Steps to Reproduce
If you don't have a MinGW environment;
pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja
Now build and run the sample
SharedApp/main.cpp
to renameSharedLib1.dll
andSharedLib2.dll
in theLoadLibraryW
calls tolibSharedLib1.dll
andlibSharedLib2.dll
(since cmake will prefix dll names with lib in this environment)The log messages from the two libraries is missing
Expected Behaviour
The shared libraries will import the Plog instance and print the expected log messages
Notes
Check the exported symbols from SharedApp.exe with Dependencies (https://github.com/lucasg/Dependencies), we can see SharedApp.exe does export the plog symbols:
So the symbols are correctly being exported, but the shared libraries are not importing them correctly.
Calling
plog::Logger<0>::getInstance();
in one of the shared libraries returns a null pointer.Environment
d60df3a1efa99061f637c263fe4e467c273d8655
The text was updated successfully, but these errors were encountered: