Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including windows static libraries #1

Open
GuilhermeStrice opened this issue Jan 28, 2016 · 4 comments
Open

Including windows static libraries #1

GuilhermeStrice opened this issue Jan 28, 2016 · 4 comments

Comments

@GuilhermeStrice
Copy link

do i need to include windows static libraries too?

if so, where can i find the include folder for the header files? xD

@shadowmint
Copy link
Owner

Sorry, I'm not sure what you mean.

There's no significant difference between linking to a windows static .lib and a mac/linux static .a file; you just need to pass in a reference to the object, as per:

https://github.com/shadowmint/ue4-static-plugin/blob/master/Source/TestPlugin/TestPlugin.Build.cs#L114

What header files are you looking for?

If you need to refer to an external set of headers, you use:

https://github.com/shadowmint/ue4-static-plugin/blob/master/Source/TestPlugin/TestPlugin.Build.cs#L80

Broadly speaking, LoadLibrary does all the things you need to link to an external static library, regardless of it's source.

If you have external (eg. win api) dependencies, you'll have to link to them dynamically, by calling PublicAdditionalLibraries on each dependency manually; there's no real shortcut for this if you're linking static code.

...so, can you clarify exactly what your question is?

@GuilhermeStrice
Copy link
Author

I am trying to link the SFML network module and its depedent on 2 windows static libraries (ws2_32.lib and winmm.lib)

@GuilhermeStrice
Copy link
Author

And im getting errors

this is my code

if (Target.Platform == UnrealTargetPlatform.Win64)
{
PublicAdditionalLibraries.Add(@"D:\RenegadeLine\SFML-2.3.2\lib\sfml-system-s.lib");
PublicAdditionalLibraries.Add(@"D:\RenegadeLine\SFML-2.3.2\lib\sfml-network-s.lib");
PublicAdditionalLibraries.Add(@"D:\RenegadeLine\netLink-master\build\out\Release\netLink.lib");

        PublicIncludePaths.Add(@"D:\RenegadeLine\netLink-master\include");
        PublicIncludePaths.Add(@"D:\RenegadeLine\SFML-2.3.2\include");

        Definitions.Add("WITH_SFML_BINDING=1");
        Definitions.Add("WITH_NETLINK_BINDING=1");
    }

These are the errors
http://prntscr.com/9wcoim

@whatisgravity
Copy link

whatisgravity commented Apr 19, 2016

I think ideally you want to provide the source code to the libs rather than provide the compiled libs. The example is providing source code to the libs they are using and then compiling them during build time if I understand correctly.

Edit: I think I'm wrong. Sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants