[ENet-discuss] Linker Errors

Steve Williams stevewilliams at kromestudios.com
Sun May 11 16:21:43 PDT 2008


How is it supposed to know the name of the lib to link if you don't tell it?  Those other libs you have used probably included a #pragma comment(lib, "filename.lib") in their header files, which only works for Visual Studio.  Otherwise, in your project properties, linker section, add "enet.lib" to Additional Dependencies.

Steve 'Sly' Williams
Lead Programmer
Krome Studios


-----Original Message-----
From: enet-discuss-bounces at cubik.org [mailto:enet-discuss-bounces at cubik.org] On Behalf Of Hibame
Sent: Monday, 12 May 2008 8:30 AM
To: Discussion of the ENet library
Subject: Re: [ENet-discuss] Linker Errors

I guess thats where I am having a problem then. In every other lib I
have included before I just added the path where the lib was located
to the project proprieties and it worked. Is there something extra
that must be done (besides the includes) to make the compiler link the
the enet.lib?

On Sun, May 11, 2008 at 2:57 PM, Marc Rochel <marc.rochel at udicom.de> wrote:
> Hi !
>
> You have to link with enet.lib . That's where those functions are defined.
>
>        Marc
>
>
> -----Ursprüngliche Nachricht-----
> Von: enet-discuss-bounces at cubik.org [mailto:enet-discuss-bounces at cubik.org] Im Auftrag von Hibame
> Gesendet: Sonntag, 11. Mai 2008 23:18
> An: enet-discuss at cubik.org
> Betreff: [ENet-discuss] Linker Errors
>
> I am a bit of a noob with visual studio so when I looked in the
> archives for the solution to the errors I was not quite clear as to
> what is needed to fix them so any help would be very much appreciated.
>
> This is the errors I am getting:
> 1>main.obj : error LNK2019: unresolved external symbol
> _enet_deinitialize referenced in function _main
> 1>main.obj : error LNK2019: unresolved external symbol
> _enet_initialize referenced in function _main
> 1>C:\test\Debug\client.exe : fatal error LNK1120: 2 unresolved externals
>
> The code is as follows:
> #include <winsock2.h>
> #include <string.h>
> #include <iostream>
> using namespace std;
>
> #include <enet.h>
>
> int main() {
>
>        if(enet_initialize() != 0)
>        {
>                fprintf(stderr, "An error occurred while initializing ENet.\n");
>                return EXIT_FAILURE;
>        }
>        atexit(enet_deinitialize);
>
>        return 0;
> }
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>

_______________________________________________
ENet-discuss mailing list
ENet-discuss at cubik.org
http://lists.cubik.org/mailman/listinfo/enet-discuss





This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect.



More information about the ENet-discuss mailing list