Sign in to follow this  

Gnet Networking engine

This topic is 3317 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I was recently given an assignment to work with Gnet however I am encountering a variety of problems. I added Glib into my include folders( one where iostream and other headers are found), added the libraries into the project properties (glib-2.0.lib ,gmodule-2.0.lib, gobject-2.0.lib, gthread-2.0.lib and gio-2.0.lib) I also added gnet.h into my project folders. However I keep getting Linker errors like this: 1>Client.obj : error LNK2019: unresolved external symbol _gnet_init referenced in function "void __cdecl startup(void)" (?startup@@YAXXZ) 1>C:\Documents and Settings\Jeffrey\My Documents\Visual Studio 2008\Projects\Gnet\Gnet-Client\Debug\Gnet-Client.exe : fatal error LNK1120: 1 unresolved externals My entire C++ file is only like this
extern "C"{

#include <glib.h>
#include <gnet.h>
}
#include <vector>
#include <string>

void main()
{
	 gnet_init ();
}

Share this post


Link to post
Share on other sites
Your problem is entirely a tools use problem, not a networking problem. You'd have the same problem if you were trying to use a rendering library, or a physics library, or anything else.

So, I can see at least two problems:

1) You should *not* add headers or libraries to the system include directories. Instead, create a new directory (or set of directories) where you put your include and lib files. Then, in your project properties (or in your Visual Studio solution-wide properties), add the appropriate directory path for include files, and for library files (those are different settings).

2) You apparently are not adding the right lib references as inputs to the linker for the project, hence the link error. If you want support for the GLib library, I suggest that you try the GLib support options. My guess is that you may be compiling the headers as C++, which generates mangled names, but you're trying to link C-compiled libraries, which use unmangled names.

Given that this is in the totally wrong forum (and probably the entirely wrong web site), I'm closing this thread.

Share this post


Link to post
Share on other sites

This topic is 3317 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this