How can i use photon in cocos2d-x project?

edited April 2012 in Native
How can i use photon in cocos2d-x project?
I already have a cocos2d-x project,now i want to use photon to be my server.in my cocos2d-x project,i use #include "LitePeer.h",but i get many error:
c++ - error C2375: redefinition; different linkage

i already do many things like the photon demo,but the demo run very well, my project are not.

how can i do ...

the error like this:
c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winsock2.h(2160): error C2375: “getprotobynumber”: redefinition; different linkage


who help me~

Comments

  • From the error message I would guess, that this is the Win32 classic :)
    6.1 Troubleshooting Win32

    Including multiple versions of WinSock

    It is common for developers using multiple libraries to have a conflict around multiple versions of WinSock. For instance, a developer may use a game engine that uses WinSock and Photon which uses WinSock2. By adding _WINSOCK_ to the preprocessor definitions the conflict is resolved, but the system will throw a warning which can be ignored.

    You can also try re-arranging the order in which you're including the header files. You can see a good example of this in someone's application using a library called Allegro. Including the files in this order solved their compile problems:
    #include <allegro.h>
    #define _WINSOCKAPI_
    #include <winalleg.h>
    #include <winsock2.h>
  • thinks,i use #define _WINSOCKAPI_ in my first .h file,it's very good
Sign In or Register to comment.