Skip to content

Conversation

@shixin627
Copy link

when I import the plugin in flutter project with firebase_core_plugin, it showed: hid_listener_plugin_windows.obj : error LNK2001: �L�k�ѪR���~���Ÿ� "private: static class HidListener * HidListener::ListenerInstance" (?ListenerInstance@HidListener@@0PEAV1@EA) [C:\Users\GitHub\Plugins\hid_listener\example\build\windows\plugins\hid_listener\hid_listener_plugin.vcxproj]

I solved it by commented the two lines:
class FLUTTER_PLUGIN_EXPORT HidListener
{
public:
HidListener();
~HidListener();

//static HidListener* Get() { return HidListener::ListenerInstance; }

private:
HHOOK m_keyboardHook;
HHOOK m_mouseHook;

//static HidListener* ListenerInstance;

};

And I declare the pointer directly in (hid_listener/windows/hid_listener_plugin_windows.cpp)
HidListener* ListenerInstance = nullptr;

@localcc
Copy link
Owner

localcc commented Nov 7, 2023

The example should probably not contain firebase dependencies, also what is the purpose of doInit/doDispose?

@shixin627
Copy link
Author

shixin627 commented Nov 8, 2023 via email

@shixin627
Copy link
Author

shixin627 commented Nov 8, 2023 via email

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

Successfully merging this pull request may close these issues.

2 participants