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

db_dump (in develop branch) does not compile #1520

Closed
ckrey opened this issue Nov 30, 2019 · 3 comments
Closed

db_dump (in develop branch) does not compile #1520

ckrey opened this issue Nov 30, 2019 · 3 comments

Comments

@ckrey
Copy link

ckrey commented Nov 30, 2019

$ make
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c db_dump.c -o db_dump.o
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c print.c -o print.o
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c ../../lib/packet_datatypes.c -o packet_datatypes.o
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c ../../lib/packet_mosq.c -o packet_mosq.o
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c ../persist_read.c -o persist_read.o
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c ../persist_read_v234.c -o persist_read_v234.o
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c ../persist_read_v5.c -o persist_read_v5.o
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c ../../lib/property_mosq.c -o property_mosq.o
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c ../../lib/send_disconnect.c -o send_disconnect.o
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c stubs.c -o stubs.o
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c ../../lib/time_mosq.c -o time_mosq.o
cc -Wall -ggdb -O2 -I.. -I../../ -I../../lib -I../.. -I../deps -DWITH_BROKER -DWITH_PERSISTENCE -c ../../lib/utf8_mosq.c -o utf8_mosq.o
cc db_dump.o print.o packet_datatypes.o packet_mosq.o persist_read.o persist_read_v234.o persist_read_v5.o property_mosq.o send_disconnect.o stubs.o time_mosq.o utf8_mosq.o -o mosquitto_db_dump
packet_mosq.o: In function `packet__write':
/home/ckrey/mosquitto/src/db_dump/../../lib/packet_mosq.c:222: undefined reference to `mosquitto__get_state'
packet_mosq.o: In function `packet__read':
/home/ckrey/mosquitto/src/db_dump/../../lib/packet_mosq.c:331: undefined reference to `mosquitto__get_state'
persist_read.o: In function `persist__retain_chunk_restore':
/home/ckrey/mosquitto/src/db_dump/../persist_read.c:328: undefined reference to `retain__store'
persist_read.o: In function `persist__client_msg_restore':
/home/ckrey/mosquitto/src/db_dump/../persist_read.c:141: undefined reference to `db__msg_store_ref_inc'
collect2: error: ld returned 1 exit status
Makefile:25: recipe for target 'mosquitto_db_dump' failed
make: *** [mosquitto_db_dump] Error 1
@ckrey
Copy link
Author

ckrey commented Nov 30, 2019

I fixed the problem by adding the missing functions to stubs.c. Probably a commit is missing

diff --git a/src/db_dump/stubs.c b/src/db_dump/stubs.c
index 929e4ae..cd98261 100644
--- a/src/db_dump/stubs.c
+++ b/src/db_dump/stubs.c
@@ -71,3 +71,22 @@ int sub__messages_queue(struct mosquitto_db *db, const char *source_id, const ch
        return 0;
 }

+enum mosquitto_client_state mosquitto__get_state(struct mosquitto *mosq)
+{
+       enum mosquitto_client_state state;
+
+       pthread_mutex_lock(&mosq->state_mutex);
+       state = mosq->state;
+       pthread_mutex_unlock(&mosq->state_mutex);
+
+       return state;
+}
+
+int retain__store(struct mosquitto_db *db, const char *topic, struct mosquitto_msg_store *stored, struct sub__token *tokens)
+{
+       return 0;
+}
+
+void db__msg_store_ref_inc(struct mosquitto_msg_store *store)
+{
+}

ralight added a commit that referenced this issue Dec 12, 2019
@ralight
Copy link
Contributor

ralight commented Dec 12, 2019

Thanks for the pointer, that should be fixed now.

@ralight ralight closed this as completed Dec 12, 2019
@ckrey
Copy link
Author

ckrey commented Dec 13, 2019

Thanks, works fine now

@lock lock bot locked as resolved and limited conversation to collaborators Mar 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants