From 130cfbdb3ef57c4bf946bd1ac213da775bcc3c61 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sat, 13 Aug 2016 07:23:14 +0000 Subject: [PATCH] Bugfix: example: Deal with build and portability issues --- Makefile.am | 6 +++--- example.c | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 209262f..daee8b5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -54,10 +54,10 @@ dist_noinst_DATA = \ if CAN_COMPILE_EXAMPLE EXTRA_PROGRAMS = example example_SOURCES = example.c -example_LDADD = libblkmaker-$(LIBBLKMAKER_API_VERSION).la libblkmaker_jansson-$(LIBBLKMAKER_API_VERSION).la $(LIBGCRYPT_LIBS) -example_CFLAGS = $(LIBGCRYPT_CFLAGS) +example_CFLAGS = $(libbase58_CFLAGS) $(JANSSON_CFLAGS) $(LIBGCRYPT_CFLAGS) +example_LDADD = $(libbase58_LIBS) libblkmaker-@LIBBLKMAKER_API_VERSION@.la libblkmaker_jansson-@LIBBLKMAKER_API_VERSION@.la $(JANSSON_LIBS) $(LIBGCRYPT_LIBS) else example: - @echo "libgcrypt is required to build the example, but was not found" + @echo "libgcrypt is required to build the example, but was not found" .PHONY: example endif diff --git a/example.c b/example.c index 595922c..f4c8c44 100644 --- a/example.c +++ b/example.c @@ -9,7 +9,11 @@ #include #include +#ifndef WIN32 #include +#else +#include +#endif #include #include @@ -127,4 +131,5 @@ int main(int argc, char**argv) { send_json(req); } blktmpl_free(tmpl); + return 0; }