<div>Updating so it doesn't break debug builds.<br></div><div><br></div><div>#if(ENET_BUILDING_LIB != 1) && !defined(_DEBUG)<br>#include "enet/list.c"<br>#endif /* !ENET_BUILDING_LIB */<br></div><br><div class="gmail_quote">
On Thu, Nov 25, 2010 at 1:30 AM, fuzzy spoon <span dir="ltr"><<a href="mailto:fuzzyspoon@gmail.com">fuzzyspoon@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Nice, thanks for posting too.<br></div><div><br></div><div>To continue on my embedding spree of random linker errors, these ones only show up in release builds for me : </div><div><br></div><div>host.obj : error LNK2019: unresolved external symbol _enet_list_clear referenced in function _enet_host_create<br>
peer.obj : error LNK2001: unresolved external symbol _enet_list_clear<br>protocol.obj : error LNK2001: unresolved external symbol _enet_list_clear<br>peer.obj : error LNK2019: unresolved external symbol _enet_list_remove referenced in function _enet_peer_receive<br>
protocol.obj : error LNK2001: unresolved external symbol _enet_list_remove<br>peer.obj : error LNK2019: unresolved external symbol _enet_list_insert referenced in function _enet_peer_queue_acknowledgement<br>protocol.obj : error LNK2001: unresolved external symbol _enet_list_insert<br>
peer.obj : error LNK2019: unresolved external symbol _enet_list_move referenced in function _enet_peer_dispatch_incoming_unreliable_commands<br></div><div><br></div><div>There are multiple ways to fix this, for the people looking for a really hackish hotfix,</div>
<div>Add the following to the top of host.c</div><div><br></div><div>#if(ENET_BUILDING_LIB != 1)<br>#include "enet/list.c"<br>#endif /* !ENET_BUILDING_LIB */<br></div><div><br></div><div><br></div><div>This is a dirty fix, i will post a cleaner fix if i can get around to it.</div>
<div><div class="h5">
<div><br></div><br><div class="gmail_quote">On Wed, Nov 24, 2010 at 6:41 PM, Nicholas J Ingrassellino <span dir="ltr"><<a href="mailto:nick@lifebloodnetworks.com" target="_blank">nick@lifebloodnetworks.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#ffffff" text="#000000">
It is awesome that you posted this. Thank you. In this spirit I will
post something I was struggling with.<br>
<br>
I had an issue using ENet with Allegro with Visual C++ 9. The
headers need to be:<br>
<blockquote>#define _WINSOCKAPI_
<br>
#define ALLEGRO_STATICLINK
<br>
#define ALLEGRO_NO_ASM
<br>
<br>
#include <allegro.h>
<br>
#include <winalleg.h>
<br>
#include <enet/enet.h>
<br>
</blockquote>
and the libs needs to be<br>
<blockquote>alleg_s_crt.lib kernel32.lib user32.lib gdi32.lib
comdlg32.lib ole32.lib dinput.lib ddraw.lib dxguid.lib winmm.lib
dsound.lib enet.lib ws2_32.lib<br>
</blockquote>
Any other order in the headers threw a mess of unresolved external
symbols which took me a decent amount of time to figure out. As you
can probably tell I am statically linking Allegro. This should also
work with Allegro being dynamically linked (obviously with <i>#define
ALLEGRO_STATICLINK</i> removed).
<div><br>
<hr style="min-height:1px">
<p><span style="font-weight:bold">Nicholas J Ingrassellino<br>
<a style="text-decoration:none" href="http://www.lifebloodnetworks.com/" target="_blank">LifebloodNetworks.com</a></span>
|| <a style="text-decoration:none" href="mailto:nick@lifebloodnetworks.com" target="_blank">nick@lifebloodnetworks.com</a></p>
<p style="font-size:75%">"<span style="font-style:italic">The
idea that I can be presented with a problem, set out to
logically solve it with the tools at hand, and wind up with a
program that could not be legally used because someone else
followed the same logical steps some years ago and filed for a
patent on it is horrifying.</span>"<br>
- <span style="font-weight:bold">John Carmack</span> on
software patents</p>
</div><div><div>
<br>
On 11/24/2010 08:43 AM, fuzzy spoon wrote:
</div></div><blockquote type="cite"><div><div>
<div>Steps to reproduce : </div>
<div> Drop code into existing solution.</div>
<div> Make sure you are linking to WS2_32.lib and
Winmm.lib</div>
<div> Make sure that you have defined WIN32_LEAN_AND_MEAN</div>
<div>Build.</div>
<div><br>
</div>
<div>Problem : Linker errors ( timeBeginPeriod etc from winmm.lib,
called from enet_initialize).<br>
</div>
<div><br>
</div>
<div>Fix: Due to WIN32_LEAN_AND_MEAN , mmsystem.h is no longer
included in the chain that enet relied on before.</div>
<div><br>
</div>
<div>At the top of win32.h, Line 18 (added underneath the other
includes).</div>
<div><br>
</div>
<div>#ifdef WIN32_LEAN_AND_MEAN<br>
#include <mmsystem.h><br>
#endif /* WIN32_LEAN_AND_MEAN */<br>
</div>
<div>
<br>
</div>
<div><br>
</div>
<div>Hopefully this will save someone some time.</div>
<div><br>
</div>
<div><br>
</div>
</div></div><pre>_______________________________________________
ENet-discuss mailing list
<a href="mailto:ENet-discuss@cubik.org" target="_blank">ENet-discuss@cubik.org</a>
<a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a>
</pre> </blockquote>
</div>
<br>_______________________________________________<br>
ENet-discuss mailing list<br>
<a href="mailto:ENet-discuss@cubik.org" target="_blank">ENet-discuss@cubik.org</a><br>
<a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
<br></blockquote></div><br>
</div></div></blockquote></div><br>