yhirose / cpp-httplib

A C++ header-only HTTP/HTTPS server and client library
MIT License
12.87k stars 2.27k forks source link

Unresolved externals after linking #924

Closed ANF-Studios closed 3 years ago

ANF-Studios commented 3 years ago

Hello there, I'm trying to get OpenSSL support and I'm having a hard time linking. It works just fine, except it throws a few linker errors (undefined references) when I link my version of a static library to an executable: image

I have no idea why this is happening. I have a primary project, to which I link those two dependencies listed here, and then, the final static lib links to the executable, which fails. And, of course, linking those two static libraries to both doesn't make a difference.

Any assistance regarding this matter?

PS: You can inspect the project/setup here on this repo.

yhirose commented 3 years ago

@ANF-Studios, you could take a look at CMakeLists.txt that @sum01 kindly maintains. It supports Windows environment as well. In my case, I use vkpkg to install the latest OpenSSL and there is no problem to build. Hope it helps!

sum01 commented 3 years ago

@ANF-Studios It looks like you're trying to link old libraries.

The library names changed sometime ago, and cpp-httplib requires >= v1.1.1 The new names are crypto and ssl.

Not sure about the specific names to look for since I don't use Windows, but I'm sure you can find whichever it's supposed to be in your install dir.