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

Build Error #5

Closed
Kays opened this issue Dec 31, 2015 · 10 comments
Closed

Build Error #5

Kays opened this issue Dec 31, 2015 · 10 comments
Labels

Comments

@Kays
Copy link

Kays commented Dec 31, 2015

Hello,
First, I want to thank you for your work.

I am trying to build it but I am running into an error. (BitlBee version 3.4.1.) I started with libwebsockets and that went well via these commands:

mkdir build && cd build
cmake ..
make
sudo make install

Then proceeding to build bitlbee-discord:

$> make
gcc `pkg-config --cflags bitlbee` -fPIC -Wall -g3 -ggdb -O0 -std=gnu99 -c -o discord.o src/discord.c
gcc `pkg-config --cflags bitlbee` -fPIC -Wall -g3 -ggdb -O0 -std=gnu99 -c -o discord-http.o src/discord-http.c
gcc `pkg-config --cflags bitlbee` -fPIC -Wall -g3 -ggdb -O0 -std=gnu99 -c -o discord-websockets.o src/discord-websockets.c
In file included from src/discord-websockets.c:20:0:
src/discord-handlers.h:25:55: error: unknown type name ‘json_value’
src/discord-websockets.c: In function ‘discord_ws_send_payload’:
src/discord-websockets.c:29:3: warning: implicit declaration of function ‘libwebsocket_write’ [-Wimplicit-function-declaration]
src/discord-websockets.c: In function ‘discord_ws_keepalive_loop’:
src/discord-websockets.c:42:5: warning: implicit declaration of function ‘libwebsocket_callback_on_writable’ [-Wimplicit-function-declaration]
src/discord-websockets.c: In function ‘discord_ws_service_loop’:
src/discord-websockets.c:54:3: warning: implicit declaration of function ‘libwebsocket_service’ [-Wimplicit-function-declaration]
src/discord-websockets.c: At top level:
src/discord-websockets.c:67:21: warning: ‘enum libwebsocket_callback_reasons’ declared inside parameter list [enabled by default]
src/discord-websockets.c:66:56: error: parameter 3 (‘reason’) has incomplete type
src/discord-websockets.c: In function ‘discord_ws_callback’:
src/discord-websockets.c:69:10: warning: implicit declaration of function ‘libwebsocket_context_user’ [-Wimplicit-function-declaration]
src/discord-websockets.c:69:30: warning: initialization makes pointer from integer without a cast [enabled by default]
src/discord-websockets.c:103:9: warning: implicit declaration of function ‘libwebsockets_remaining_packet_payload’ [-Wimplicit-function-declaration]
src/discord-websockets.c:118:7: warning: implicit declaration of function ‘libwebsocket_cancel_service’ [-Wimplicit-function-declaration]
src/discord-websockets.c: At top level:
src/discord-websockets.c:166:38: error: array type has incomplete element type
src/discord-websockets.c: In function ‘discord_ws_init’:
src/discord-websockets.c:181:3: warning: implicit declaration of function ‘libwebsocket_get_internal_extensions’ [-Wimplicit-function-declaration]
src/discord-websockets.c:181:19: warning: assignment makes pointer from integer without a cast [enabled by default]
src/discord-websockets.c:191:3: warning: implicit declaration of function ‘libwebsocket_create_context’ [-Wimplicit-function-declaration]
src/discord-websockets.c:191:14: warning: assignment makes pointer from integer without a cast [enabled by default]
src/discord-websockets.c:196:3: warning: implicit declaration of function ‘libwebsocket_client_connect’ [-Wimplicit-function-declaration]
src/discord-websockets.c: In function ‘discord_ws_cleanup’:
src/discord-websockets.c:206:5: warning: implicit declaration of function ‘libwebsocket_context_destroy’ [-Wimplicit-function-declaration]
src/discord-websockets.c: At top level:
src/discord-websockets.c:166:38: warning: ‘protocols’ defined but not used [-Wunused-variable]
make: *** [discord-websockets.o] Error 1

Not sure how to move forward from this. Any help is appreciated. Thank you!

@sm00th
Copy link
Owner

sm00th commented Dec 31, 2015

Yes, for now makesystem is dumb and doesn't do much to work with non-standard library installation paths. AFAIK libwebsockets installs by default to /usr/local, not /usr, so you can try installing libwebsockets to /usr as the plugin expects, to do so, use cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. instead of cmake .. while building libwebsockets. Or you can use CFLAGS="-I/usr/local/include" make when building bitlbee-discord.

src/discord-handlers.h:25:55: error: unknown type name ‘json_value’

This error, however, is not related to libwebsockets and looks like you have a rather old version of bitlbee.

@sm00th
Copy link
Owner

sm00th commented Dec 31, 2015

Oh, you specified bitlbee's version and 3.4.1 should have required structure. If the error still there when all libwebsockets errors are gone can you please post the output of the following command:

grep -n json_value /usr/include/bitlbee/json.h 

@Kays
Copy link
Author

Kays commented Dec 31, 2015

Hmm, looks like it installed to /usr/local/include/bitlbee/json.h. So I rebuilt bitlbee's dev files with:

configure --prefix=/usr
make
sudo make install-dev

Then I ran make clean and make on bitlbee-discord and still same error =/. https://gist.github.com/Kays/20c6daf6f941ecebde3a

Do I have to reinstall the entire bitlbee binary to the new /usr path as well?

@sm00th
Copy link
Owner

sm00th commented Dec 31, 2015

Did you do the stuff from my firs comment? Is there a /usr/include/libwebsockets.h?

@Kays
Copy link
Author

Kays commented Dec 31, 2015

Ah, yes. I rebuild libwebsockets with prefix=/usr.

$> ls -al /usr/include/libwebsockets.h
-rw-r--r-- 1 root root 61453 Dec 31 09:25 /usr/include/libwebsockets.h

I also tried the CFLAGS make, but still not working: https://gist.github.com/Kays/1588601e69e6421718b4
Not sure if this helps, but the server is running Debian Wheezy:

$> cat /etc/debian_version 
7.9

Really weird.

@sm00th
Copy link
Owner

sm00th commented Jan 1, 2016

Ok, json_value error is my own bug and it should be fixed by edffe8c.
As for libwebsockets issue: I wasn't keeping up with the development on their side and apparently they broke the API again in this commit. Thats what you get for using libraries that are still in development phase. I'll update bitlbee-discord accordingly when they bring their main repo at libwebsockets.org back up, as for now you can build libwebsockets prior to this commit and rebuild bitlbee-discord with it.

@sm00th
Copy link
Owner

sm00th commented Jan 1, 2016

Made libwebsockets changes in commit 2d12954, should compile fine with latest libwebsockets now.

@Kays
Copy link
Author

Kays commented Jan 1, 2016

Works! Thank you very much. One change that I had to make in Makefile is:
install -Dm=755 to install -Dm 0755 because the equal sign results in install: invalid mode=755'`

BTW: Happy New Year to you!

@Kays
Copy link
Author

Kays commented Jan 1, 2016

Do you know if there's a way to not have two channels with the same name across multiple Discord servers clash in bitlbee? Currently, it just names it subsequent ones with _ suffices. I'm thinking maybe even #server.channel convention can work? Just a thought.

sm00th added a commit that referenced this issue Jan 1, 2016
Some of the versions of install do not recognize "=" and fail with
install: invalid mode=755

Reported by: @Kays in issue #5.
@sm00th
Copy link
Owner

sm00th commented Jan 1, 2016

Happy new year to you too.

Thanks for mentioning that install issue, commited a fix for that.

As for channelnames collisions - there is no way to avoid this at the moment. I've been thinking about server_channel convention, but from what I saw server/channel names tend to be quite long, so I definitely don't want this convention to be applied by default, I might implement it as an option though.

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

No branches or pull requests

2 participants