<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Everyone,<div>I'm currently working on a school project and have decided to use enet for the networking. I ran into some trouble while building on my mac using xcode (OS X 10.5.8 and Xcode 3.1). The problem I ran into was when I tried to build a universal binary. The only architecture libenet.a supported was x86_64, which is the architecture of my machine. I'm assuming that there is probably a way to tell gcc to compile for different architectures, but I didn't really want to look into it.</div><div><br></div><div>Instead, I just created an xcode project that builds the enet library as a universal binary. Since it's now an xcode project, the extension is now .dylib instead of .a. When I tried linking this against my project, everything worked just fine. I did have to modify a few files, namely the header files and unix.c (below are the changes that I made).</div><div><br></div><div>Changes:</div><div><br></div><div>Modified unix.c on line 33.</div><div><br></div><div>old:</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); ">#ifndef HAS_SOCKLEN_T</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: #bd23a0">typedef</span> <span style="color: #bd23a0">int</span> socklen_t;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); ">#endif</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; ">new:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); ">#ifndef _SOCKLEN_T</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: #bd23a0">typedef</span> <span style="color: #bd23a0">int</span> socklen_t;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); ">#endif</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">I changed this because it was conflicting with socket.h. Xcode was complaining about how socklen_t was being redefined. I looked in the configure file and found where HAS_SOCKLEN_T is being defined. I'm sure there is a better way to do that change, but for simplicity's sake and not knowing how to change it, I did that.</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">All the header files that have the line:&nbsp;<span class="Apple-style-span" style="color: rgb(120, 72, 45); font-family: Menlo; font-size: 11px; ">#include <span style="color: #d22723">"enet/*.h" </span><font class="Apple-style-span" color="#000000">were changed to</font><span style="color: #d22723">&nbsp;<span class="Apple-style-span" style="color: rgb(120, 72, 45); ">#include&nbsp;<span style="color: rgb(210, 39, 35); ">"*.h"<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; ">. I'm not sure how the header includes worked with the makefile, but when i tried to build with xcode, it didn't like that all the header files wanted to include each other using the syntax above. The .c files are just fine and projects using this configuration don't have to change anything.</span></span></span></span></span></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">I'm sure that there are better ways to do this than the way I did it. If anyone has any thoughts, questions or comments on this, please let me know. I would like to make this a good, working project for enet. If it comes down to just modifying the makefile instead of using the xcode project, then that's cool too.&nbsp;</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">I&nbsp;won't attach the zip of the project to the email because I'm not sure if the mailing list will like that. I've never shared files online, so how would you guys suggest I get it to you?</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">Thanks,</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 45); "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">Robert</span></font></div></div></div></body></html>