empyreanx/gdnet

(win7) Linking ws2_32

Closed this issue · 7 comments

Using MinGW it works fine.
Using VisualStudio it can't find it.

In enet\SCSub
MinGW requires env.Append(LIBS=['ws2_32'])
VisualStudio requires env.Append(LINKFLAGS=["ws2_32.lib"]) instead of it

Does it still work with MinGW after the change? I don't have time to do a lot of testing these days.

If LINKFLAGS is a list add both. is posible?

@jrimclean No, it doesn't. I think the best way would be to check which one is used to compile and then use the correct line, but I don't know how to check this.

@Kermer Godot's build system is rather murky and I'm not an expert with SCons, but I'll see if there's a variable that reveals which compiler is being used. I should be able to do some work this weekend. I hope this isn't urgent?

@rdcklinux It might be possible to add one library to LIBS and one to LINKFLAGS, but the linker will probably complain that it can't find the file.

@Kermer It would help if you could give me a brief description of how you setup your project in VS and which version you're using.

if (env['platform'] == 'windows'):
    if (env['CC'] == 'cl'):
        env.Append(LINKFLAGS=["ws2_32.lib"])
    else: # gcc mostly
        env.Append(LIBS=['ws2_32'])

This should fix it