FireBreath FB::PluginWindowWin include problem

2019-09-05 06:30发布

问题:

I tried to follow the steps in the answer of Directx control in browser plugin

but when I added the solution mentioned in http://colonelpanic.net/2010/11/firebreath-tips-drawing-on-windows/ FireBreath Tips: Drawing on Windows

"1.Make your plugin object windows specific

change the type of the event source specified in EVENTTYPE_CASE to FB::PluginWindowWin (as well as the type in the handlers) and you will have your object cast in the way you need it."

I got 119 errors, all are in winsock2.h file, which I included in other file, saying redefinition, different linkage. what to do?

Thanks, Sara

回答1:

did you add the #include "Win/PluginWindowWin.h"?

another thing that can help that is #include "win_common.h" early in the file. The include order of certain windows headers and winsock matters, so that can cause this issue if they get out of order.



回答2:

This is a general problem occures when one tries to include windows.h and winsock2.h.

windows.h includes winsock.h itself, therefore, if you include winsock2.h after it, several redefinition conflicts arise.

Solution: include "winsock2.h" first.