Enet oder auch gern was anderes (C++ network communication)



  • Hallo, ich habe große Probleme Enet (http://enet.bespin.org/index.html) in Microsoft Visual Studio zu installieren. Wenn es ein ähnliche library gibt die ein Tutorial hat, nehme ich auch gerne die.

    Bis jetzt habe ich nur library SDL2 verwendet und das ging so weit ohne Probleme. Aber bei Enet komme ich trotz Anleitung (http://enet.bespin.org/Installation.htm), die zudem recht kurz ist, nicht weiter.

    Microsoft Windows

    You may simply use the included "enet.lib" or "enet64.lib" static libraries. However, if you wish to build the library yourself, then the following instructions apply:

    There is an included MSVC 6 project (enet.dsp) which you may use to build a suitable library file. Alternatively, you may simply drag all the ENet source files into your main project.

    You will have to link to the Winsock2 libraries, so make sure to add ws2_32.lib and winmm.lib to your library list (Project Settings | Link | Object/library modules).

    Load the included enet.dsp. MSVC may ask you to convert it if you are on a newer version of MSVC - just allow the conversion and save the resulting project as "enet" or similar. After you build this project, it will output an "enet.lib" file to either the "Debug/" or "Release/" directory, depending on which configuration you have selected to build. By default, it should produce "Debug/enet.lib".

    You may then copy the resulting "enet.lib" file and the header files found in the "include/" directory to your other projects and add it to their library lists. Make sure to also link against "ws2_32.lib" and "winmm.lib" as described above.

    Ich glaube, bei den Unterstrichenden sind schon meine Fehler.
    Wie genau mache ich eine static libraries?
    Also ich mache enet.dsp auf und Compeliere, hier müsste ich ws2_32.lib und winmm.lib einbinden, aber wie? Ich verstehe auch nicht, wieso es so kompliziert gemacht ist, kann man nicht wie bei SDL2 einfach die libs und dlls reinwerfen und gut ist?



  • You may simply use the included "enet.lib" or "enet64.lib" static libraries. However, if you wish to build the library yourself, then the following instructions apply: ...

    Das heißt: nimm einfach die Datei "enet.lib". Die ist beim Download dabei. Klick in Visual Studio das Projekt rechts an, geh zum Unterpunkt Linker->Input. Dort kannst du einstellen, welche statischen Libs zu linken willst. Dort gibst du die oben genannte Datei an. Fertig. Du brauchst dann nur noch die passende Header Datei inkludieren und schon kannst du die Features verwenden.



  • Danke, habe es jetzt auch genau so gemacht aber die #include <enet.h> findet er nicht 😞

    2 IntelliSense: cannot open source file "enet.h"
    Error 1 error C1083: Cannot open include file: 'enet.h': No such file or directory



  • Include Pfad musst aber auch im Projekt angeben. Google mal nach "add include path visual studio", da solltest du eine Erklärung finden. Und dann einfach den Pfad angeben, wo die Header Datei drinnen liegt.


Anmelden zum Antworten