SDL_net

I compiled SDL_net as a SDL_net.dll. I got GUIlib and compiled as GUIlib.dll. I
want to compile SDL_net example chat program. But I get this:

Linking…
chatd.obj : error LNK2005: _cleanup already defined in chat.obj
chatd.obj : error LNK2005: _SDL_main already defined in chat.obj
chat.obj : error LNK2001: unresolved external symbol _SDLNet_TCP_Send
chatd.obj : error LNK2001: unresolved external symbol _SDLNet_TCP_Send
chat.obj : error LNK2001: unresolved external symbol _SDLNet_UDP_GetPeerAddress
chat.obj : error LNK2001: unresolved external symbol _SDLNet_UDP_Send
chat.obj : error LNK2001: unresolved external symbol _SDLNet_UDP_Unbind
chat.obj : error LNK2001: unresolved external symbol _SDLNet_UDP_Bind

I am using VC. In Project Settings, Link TAB, Object/library modules: I’ve
included sdl.lib sdlmain.lib. How can I include sdl_net.dll? When I type this
in I get:

Linking…
E:\Program Files E\DevStudio\VC\LIB\sdl_net.dll : fatal error LNK1136: invalid
or corrupt file
Error executing link.exe.

Test.exe - 1 error(s), 0 warning(s)

HELP!

You have to include the static library SDL_net.lib in the project settings of the
chat example. The same place where you put SDL.lib, SDLmain.lib . You have
to compile SDL_net as static library(lib file) in order to compile programs that
use SDL_net (remember set the directories where you have sdl_net.lib and
the headers files, in Tools>Options, Directory TAB ) then you must include
SDL_net.lib in Project Settings, Link TAB, Object/library modules. The dll is
used at runtime.

Regards.

Martin Gonzalez.> I compiled SDL_net as a SDL_net.dll. I got GUIlib and compiled as

GUIlib.dll. I want to compile SDL_net example chat program. But I get
this:

Linking…
chatd.obj : error LNK2005: _cleanup already defined in chat.obj
chatd.obj : error LNK2005: _SDL_main already defined in chat.obj
chat.obj : error LNK2001: unresolved external symbol _SDLNet_TCP_Send
chatd.obj : error LNK2001: unresolved external symbol _SDLNet_TCP_Send
chat.obj : error LNK2001: unresolved external symbol
_SDLNet_UDP_GetPeerAddress chat.obj : error LNK2001: unresolved
external symbol _SDLNet_UDP_Send chat.obj : error LNK2001: unresolved
external symbol _SDLNet_UDP_Unbind chat.obj : error LNK2001: unresolved
external symbol _SDLNet_UDP_Bind

I am using VC. In Project Settings, Link TAB, Object/library modules:
I’ve included sdl.lib sdlmain.lib. How can I include sdl_net.dll? When
I type this in I get:

Linking…
E:\Program Files E\DevStudio\VC\LIB\sdl_net.dll : fatal error LNK1136:
invalid or corrupt file
Error executing link.exe.

Test.exe - 1 error(s), 0 warning(s)

HELP!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi Kevin,

KevinGPO schrieb:

I am using VC. In Project Settings, Link TAB, Object/library modules: I’ve
included sdl.lib sdlmain.lib. How can I include sdl_net.dll?

Thats the point: you need to link sdl_net.lib!

When I type this
in I get:

Linking…
E:\Program Files E\DevStudio\VC\LIB\sdl_net.dll : fatal error LNK1136: invalid
or corrupt file
Error executing link.exe.

That’s ok because it’s not static link file. This file is only there to
define your prototypes.

HTH
Alexander

Thats the point: you need to link sdl_net.lib!

What’s the point of having a seperate dynamically linked library then?
Isn’t .dll there so that the original source module would be smaller and
modularised.

Damn, SDL_net 1.2.5 VC project file was only setup for .dll building. Damn how
to change this to build for .lib (static)…

Thats the point: you need to link sdl_net.lib!

What’s the point of having a seperate dynamically linked library then?
Isn’t .dll there so that the original source module would be smaller and
modularised.

If I understand correctly, on Windows, all shared libraries need to be
dlopen()ed, then the symbols extracted, and then called. On Unix-like
systems, a “shared object” file (.so) is implicitly dynamically linked,
i.e. you can pretend you had linked to a static version and just call
the functions.

To emulate this behaviour on Windows, the .lib file contains all the
dlopen() and related code, freeing you from having to write it yourself,
and providing you with “stubs” that you can call, which in turn call the
.dll symbols, without you noticing that the symbols had to be explicitly
imported by calling dlopen() and friends.

Damn, SDL_net 1.2.5 VC project file was only setup for .dll building. Damn how
to change this to build for .lib (static)…

Actually (again, I could be wrong), the .lib file is not the static
library, that would be the .a file, I think.

Hope this helps,

Ben

KevinGPO schrieb:

Thats the point: you need to link sdl_net.lib!

What’s the point of having a seperate dynamically linked library then?
Isn’t .dll there so that the original source module would be smaller and
modularised.

Did you allready notice, that you need, to use the dll of SDl, to link
sdl.lib (and) sdlmain.lib? That’s what i wrote.

regards
Alexander

What’s the point of having a seperate dynamically linked library then?

Isn’t .dll there so that the original source module would be smaller
and
modularised.

But you need something to actually load the DLL code and initialize
the function pointers you then access as “functions”. The piece of code
that automagically does that is contained in the .lib.

Benjamin Deutsch schrieb:

Actually (again, I could be wrong), the .lib file is not the static
library, that would be the .a file, I think.

ACK. But I think that depends on how the output file is named on
compiling that library. On Windows it’s a .lib. And on Linux it’s a .a

greets
Alexander

Sam can you update (or ask the person responsible to update ) the noip
address for the SDL_net documentation
http://jcatki.no-ip.org:8080/SDL_net/
Thanks

Hello !

Sam can you update (or ask the person responsible to update ) the noip
address for the SDL_net documentation
http://jcatki.no-ip.org:8080/SDL_net/

I can ping the IP address, so maybe he is just
updating his server at the moment.

CU

2009/1/3 Torsten Giebl :

Hello !

Sam can you update (or ask the person responsible to update ) the noip
address for the SDL_net documentation
http://jcatki.no-ip.org:8080/SDL_net/

I can ping the IP address, so maybe he is just
updating his server at the moment.

CU


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

That might be the case, yet it also might be the case that the address
that it resolves to is an old one which is now being reused. Therefore
you can ping it yet it is not the site you expect.

Maybe SDL_net deserves a home on libsdl.org? (How much actual
integration is there with SDL beyond a few helper functions and the
name?)On Sat, Jan 3, 2009 at 10:11 AM, liam mail <liam.list at googlemail.com> wrote:

2009/1/3 Torsten Giebl :

Hello !

Sam can you update (or ask the person responsible to update ) the noip
address for the SDL_net documentation
http://jcatki.no-ip.org:8080/SDL_net/

I can ping the IP address, so maybe he is just
updating his server at the moment.

CU


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

That might be the case, yet it also might be the case that the address
that it resolves to is an old one which is now being reused. Therefore
you can ping it yet it is not the site you expect.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

Maybe SDL_net deserves a home on libsdl.org? (How much actual
integration is there with SDL beyond a few helper functions and the
name?)

You mean something like this?
http://www.libsdl.org/projects/SDL_net/

The docs are mirrored here:
http://www.libsdl.org/projects/docs/SDL_net/

See ya!
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC