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

struct WT_API Wt::NoClass #145

Closed
wants to merge 1 commit into from
Closed

struct WT_API Wt::NoClass #145

wants to merge 1 commit into from

Conversation

quatmax
Copy link
Contributor

@quatmax quatmax commented Oct 30, 2018

On windows with dll usage of WT you have to dllexport/dllimport Wt::NoClass.
Otherwise you get linkage erros...

@emweb
Copy link
Collaborator

emweb commented Apr 30, 2019

Is this warning C4251? When the compiler and flags match, the WT_API is not strictly necessary there. The compiler also warns about STL types like std::string etc. I can add WT_API to the types we define ourselves, but that doesn't eliminate the issue for the STL. Or are you actually really getting errors instead of warnings?

@quatmax
Copy link
Contributor Author

quatmax commented May 10, 2019

This was a warning while linking against wt.dll on windows.
It's not really a problem so I will close this pr.
I'm sure there are more important issues 🙂

@quatmax quatmax closed this May 10, 2019
@quatmax
Copy link
Contributor Author

quatmax commented Oct 15, 2019

Hi!
I just had the problem again, linking against wt 4.0.5 (current vcpkg port-version).
Windows 10 64bit
Visual Studio 2019 16.3.4

error LNK2001: unresolved external symbol "public: static struct Wt::NoClass Wt::NoClass::none" (?none@NoClass@Wt@@2U12@A)

So maybe this is interesting for you...

@quatmax quatmax reopened this Oct 15, 2019
@emweb
Copy link
Collaborator

emweb commented Oct 16, 2019

I see, it's the static instance Wt::NoClass::none that's giving you linker errors, if you e.g. try to emit() an EventSignal<>. Seems to me that it would be best to just get rid of none altogether and just use a default-constructed NoClass, or employ some other method of allowing 0 or 1 template arguments.

Regards,
Roel

emweb pushed a commit that referenced this pull request Oct 16, 2019
Why export a symbol that has no use? Use default constructed NoClass
instead of NoClass::none
@emweb
Copy link
Collaborator

emweb commented Oct 16, 2019

I pushed a commit to master that should fix this (so it does not actually need NoClass::none).

Regards,
Roel

@emweb emweb closed this Oct 16, 2019
@quatmax
Copy link
Contributor Author

quatmax commented Oct 16, 2019

Hi Roel!

Perfect, thanks a lot.

BR, Max

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