Question

I am using Microsoft Visual C++ (VS Express for Desktop). I'm having difficulty linking the enet.lib and enet64.lib files. Here's what I did:

  1. Downloaded the tar.gz file of the most recent stable release.
  2. I extracted it's contents to C:\enet
  3. In my MSVC solution's project properties I:
    • Added C:\enet\include to C/C++/General/Additional Include Directories
    • Added C:\enet to Linker/General/Additional Library Directories
    • Added enet.lib, enet64.lib, ws2_32.lib and winmm.lib to Linker/Input/Additional Dependencies

I also made sure to put #include <enet/enet.h> at the top of my main.cpp. The program runs without any errors, but it doesn't seem to actually be working. In my client code it's supposed to throw an error if it can't connect to the server, yet when I run the client program while the server is not running, it doesn't throw any errors. Did I incorrectly link ENet, am I using the wrong version, or am I just using it incorrectly? I scrapped my own code and tried running an example client/server I found on the internet, it compiled but it didn't actually "work".

Was it helpful?

Solution

I figured it out, the problem was that I was linking both enet.lib AND enet64.lib.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top