0

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

Community
  • 1
  • 1
sara
  • 3,824
  • 9
  • 43
  • 71

2 Answers2

0

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.

taxilian
  • 14,229
  • 4
  • 34
  • 73
  • I did include "Win/PluginWindowWin.h". I tried to include "win_common.h" but that doesn't help. the only thing helps is to inclue "Win/PluginWindowWin.h" in the cpp, which I don't want to. – sara May 25 '11 at 06:20
  • Wait; why don't you want to include PluginWindowWin in the cpp? If the class isn't defined then it certainly isn't going to work... Also, did you include "win_common.h" as the *first include*? – taxilian May 26 '11 at 05:29
  • Yes, I added it as the first include. I'm stuck also in my other question http://stackoverflow.com/q/6030417/487305 until I solve this. – sara May 31 '11 at 08:28
0

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.

sara
  • 3,824
  • 9
  • 43
  • 71
  • If you include "win_common.h" as the first include in your file as I specified in my first answer you wouldn't have this issue, since win_common.h *does* include winsock2.h first and makes sure that your basic includes are in the correct order... in fact, that's its whole purpose in life. – taxilian May 31 '11 at 15:12
  • Well, It didn't work... There was a whole mess in the includes, I had to order them carefully in all the files, which require the "winsock2" be the first of all. – sara Jun 02 '11 at 12:18
  • oh.. my mistake. I guess FireBreath doesn't use winsock2 and thus you're actually hitting a different (but very similar sounding) problem than I experienced. sorry :-/ – taxilian Jun 02 '11 at 18:28