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

Using the installed libraries in VS2019 #5

Open
robverhoef-united opened this issue Oct 15, 2021 · 2 comments
Open

Using the installed libraries in VS2019 #5

robverhoef-united opened this issue Oct 15, 2021 · 2 comments

Comments

@robverhoef-united
Copy link

robverhoef-united commented Oct 15, 2021

Hello,

I am trying to build an application using your pre build libraries, but i am unable to get is succesfully build..
I am getting about 34 of these kinds of linker errors:

Severity	Code	Description	Project	File	Line	Suppression State

Error	LNK2001	unresolved external symbol __imp_WSAGetLastError	SRTTestApp	libcrypto.lib(b_addr.obj)	1

For starters i created this very simple c++ console app:

#include <iostream>
#include "srt/srt.h"

int main()
{
    std::cout << "Hello World!\n";
    srt_startup();
    srt_cleanup();
}

I cannot figure out which dependency i am missing, Installed both openssl en nsis. What is needed to make it compile and link succesfully.

Thanks, Rob

@lelegard
Copy link
Member

lelegard commented Oct 15, 2021

Hello @robverhoef-united

Those references come from ws2_32.lib, the Windows socket library. To fix that, you must edit the properties of your project => Linker => Input => Additional dependencies => add ws2_32.lib (the result must display as ws2_32.lib;%(AdditionalDependencies)).

I should have added this dependency in the libsrt.props property file so you don't have to explicitly specify it. I will fix this.

Since almost all applications already use networking, they already link against ws2_32.lib and the missing reference went unnoticed.

Two additional remarks:

  • No need to install openssl, the required static libraries are already in the libsrt binary package.
  • The official libsrt project now includes the libsrt binary package for Windows. Their version 1.4.4 provides the binary package. However, this package will suffer from the same issue (it is my contribution) and you have to apply the same fix. I will apply the same fix in the libsrt official project but it will be available in the next version only.

@lelegard
Copy link
Member

This has been fixed in the latest release: https://github.com/tsduck/srt-win-installer/releases

A pull request has been issued to fix the official installer in https://github.com/Haivision/srt/

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

2 participants