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

Could the documentation for "Using Lwan as a Library" be updated #176

Open
BenKnigge opened this issue Oct 21, 2016 · 2 comments
Open

Could the documentation for "Using Lwan as a Library" be updated #176

BenKnigge opened this issue Oct 21, 2016 · 2 comments

Comments

@BenKnigge
Copy link

It's been many years since the last time that I've attempted to write any code in C and would really appreciate it if there was a bit of documentation on how to use lwan as a library outside of the lwan directory. I've been struggling with the cmake configuration inside of a Clion project and have decided to give up for the night. If anyone has a working cmake config that they would be willing to share it would be greatly appreciated.

@tiehuis
Copy link

tiehuis commented Feb 16, 2017

I encountered these similar issues when attempting to use the library.

I've written an example project and a small post which may be useful. Feel free to adapt any of this information as you please. Also, the main example on https://lwan.ws/ is incorrect for the current API. See that post for an updated version which should work.

This example uses lwan as a git submodule but you could just as easily copy out the header files and library to the location of your choice and build from there.

https://tiehuis.github.io/lwan-intro.html
https://github.com/tiehuis/lwan-api-example

@lpereira
Copy link
Owner

@BenKnigge I completely missed this issue here -- I'm sorry. I don't currently have any CMake configuration file that will work outside the project tree. What I know is that you can use CMake's pkg-config module to find Lwan, and it should work:

include(FindPkgConfig)
pkg_check_modules(LWAN lwan)
if (LWAN_FOUND)
     # You can use LWAN_LIBRARIES and LWAN_INCLUDE_DIRS here
endif ()

If you can't link with Lwan when using this, please comment. I'm working towards the first release and this is one of the things I have to fix.

@tiehuis Thanks for the heads up regarding the out-of-date web page. I'll update it now so it works with the current API.

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