|
Code::Blocks and Enet |
Bob Keane
Member #7,342
June 2006
|
Gaaaaah, I'm losing my mind over this. I'm trying to set up enet in Code::Blocks and having problems. I followed the instructions on the Enet website, ie ./configure &&make &&make install and everything seemed to work. When trying to run the sample programs, I found I had a linker problem. After some searching, I found <a href="https://forums.codeblocks.org/index.php?topic=18235.0">this on the Code::Blocks forums suggesting to open the enet_dll.cpb project and run build to create the libraries. I tried but got an error in the unix.c file, "error: conflicting types for 'socklen_t'; have 'int'". I've used the files in the enet_dll project as downloaded, no editing. Are the instructions in the Code::Blocks post specific to the OP's situation, or should I be changing the Enet files to make it work? Thanks. <update> After some searching, I found the library files in a hidden folder. For anyone looking for the libraries in Linux, the path is .../Documents/enet-1.3.17/.libs, assuming the enet file is under the Documents folder. However, I still can't compile. By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Bob - relax! Use cmake-gui instead of autobarf. Always prefer cmake to autotools. Unless they just work, but even then.... I tweaked my CMakeLists.txt a little for Enet to produce a shared and static version and an install target. You can find it attached. Just overwrite the existing CMakeLists.txt file and run as normally. It will install the libraries in ${CMAKE_INSTALL_PREFIX} for you when you run make install. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Bob Keane
Member #7,342
June 2006
|
I've been playing with it a little. It looks like dynamic linking works on Linux and possibly Windows but not static linking. I found these instructions on GiHub: $ mkdir build $ cd build $ cmake .. -DENET_STATIC=1 -DCMAKE_BUILD_TYPE=Release $ cmake --build . but I haven't tried it yet. I'll try it on Linux but not sure if CMake is installed on my Windows laptop. Or how to use it. Will post with results. Thanks. Edit: I tried the GiHub commands to build the static library, with a few tweaks. Here are the results: [bobkeane@fedora enet-1.3.17]$ make -ENET_STATIC=1 -CMAKE_BUILD_TYPE=Release By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
You're mixing cmake and make commands. And your cmake variables are missing -D in front of them. mkdir build cd build cmake-gui .. make make install Use the CMakeLists.txt I provided. You don't need to set anything except CMAKE_INSTALL_PREFIX for your install directory. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Bob Keane
Member #7,342
June 2006
|
I Downloaded your file and installed CMake. It works now, thanks Edgar. By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul. |
|