Skip to content

struct WT_API Wt::NoClass#145

Closed
quatmax wants to merge 1 commit intoemweb:masterfrom
quatmax:master
Closed

struct WT_API Wt::NoClass#145
quatmax wants to merge 1 commit intoemweb:masterfrom
quatmax:master

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

Development

Successfully merging this pull request may close these issues.

2 participants