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

incomplete type 'lws_context' ? #3273

Open
arnold0kang opened this issue Nov 12, 2024 · 3 comments
Open

incomplete type 'lws_context' ? #3273

arnold0kang opened this issue Nov 12, 2024 · 3 comments

Comments

@arnold0kang
Copy link

hi, I have cross compile the source code success, install OK , but get this error. how to resolve this? I have include libwebsockets.h

@lws-team
Copy link
Member

It's always a good idea to paste the actual error. If it's in your code, you probably meant struct lws_context

@arnold0kang
Copy link
Author

yes, a sample code,
#include "libwebsockets.h" int main () { struct lws_context context_; }
gcc error: error: field 'context_' has incomplete type 'lws_context'

@lws-team
Copy link
Member

You can use -M with gcc to dump the paths of the include files used.

It sounds like you're including ./libwebsockets.h, or from some other path, which does not have the right stuff in. Eg, from some older lws or something completely different.

Normally, you use sudo make install or some variant of it to install the include tree (which has many files, not just libwebsockets.h). You can guide your gcc to the right place with -I to where you installed the right pieces.

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