--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -157,7 +157,7 @@
 rasqal_algebra.c: git-version.h
 endif
 
-librasqal_la_LDFLAGS = -version-info @RASQAL_LIBTOOL_VERSION@
+librasqal_la_LDFLAGS = -no-undefined -version-info @RASQAL_LIBTOOL_VERSION@
 librasqal_la_LIBADD = @LTLIBOBJS@ @RASQAL_INTERNAL_LIBS@ @RASQAL_EXTERNAL_LIBS@ $(MEM_LIBS)
 librasqal_la_DEPENDENCIES = @LTLIBOBJS@ @RASQAL_INTERNAL_LIBS@
 
--- a/src/rasqal.h.in
+++ b/src/rasqal.h.in
@@ -1316,7 +1316,7 @@
 rasqal_update_operation* rasqal_query_get_update_operation(rasqal_query* query, int idx);
 
 /* results */
-int rasqal_query_set_store_results(rasqal_query* query, int store_results);
+RASQAL_API int rasqal_query_set_store_results(rasqal_query* query, int store_results);
 
 /* graph patterns */
 RASQAL_API
--- a/src/rasqal_internal.h
+++ b/src/rasqal_internal.h
@@ -1057,9 +1057,9 @@
 typedef struct rasqal_dataset_term_iterator_s rasqal_dataset_term_iterator;
 typedef struct rasqal_dataset_triples_iterator_s rasqal_dataset_triples_iterator;
 
-rasqal_dataset* rasqal_new_dataset(rasqal_world* world);
-void rasqal_free_dataset(rasqal_dataset* ds);
-int rasqal_dataset_load_graph_iostream(rasqal_dataset* ds, const char* name, raptor_iostream* iostr, raptor_uri* base_uri);
+RASQAL_API rasqal_dataset* rasqal_new_dataset(rasqal_world* world);
+RASQAL_API void rasqal_free_dataset(rasqal_dataset* ds);
+RASQAL_API int rasqal_dataset_load_graph_iostream(rasqal_dataset* ds, const char* name, raptor_iostream* iostr, raptor_uri* base_uri);
 int rasqal_dataset_load_graph_uri(rasqal_dataset* ds, const char* name, raptor_uri* uri, raptor_uri* base_uri);
 void rasqal_free_dataset_term_iterator(rasqal_dataset_term_iterator* iter);
 rasqal_literal* rasqal_dataset_term_iterator_get(rasqal_dataset_term_iterator* iter);
@@ -1109,7 +1109,7 @@
 
 rasqal_query_language_factory* rasqal_query_language_register_factory(rasqal_world *world, int (*factory) (rasqal_query_language_factory*));
 rasqal_query_language_factory* rasqal_get_query_language_factory (rasqal_world*, const char* name, const unsigned char* uri);
-void rasqal_log_error_simple(rasqal_world* world, raptor_log_level level, raptor_locator* locator, const char* message, ...) RASQAL_PRINTF_FORMAT(4, 5);
+RASQAL_API void rasqal_log_error_simple(rasqal_world* world, raptor_log_level level, raptor_locator* locator, const char* message, ...) RASQAL_PRINTF_FORMAT(4, 5);
 void rasqal_log_error_varargs(rasqal_world* world, raptor_log_level level, raptor_locator* locator, const char* message, va_list arguments) RASQAL_PRINTF_FORMAT(4, 0);
 void rasqal_query_simple_error(void* user_data /* query */, const char *message, ...) RASQAL_PRINTF_FORMAT(2, 3);
 void rasqal_world_simple_error(void* user_data /* world */, const char *message, ...) RASQAL_PRINTF_FORMAT(2, 3);
@@ -1361,7 +1361,7 @@
 #if RAPTOR_VERSION < 20015
 typedef int (*raptor_data_compare_arg_handler)(const void *data1, const void *data2, void *user_data);
 #endif
-int rasqal_query_results_sort(rasqal_query_results* query_result);
+RASQAL_API int rasqal_query_results_sort(rasqal_query_results* query_result);
 int rasqal_query_results_set_boolean(rasqal_query_results* query_results, int value);
 
 /* rasqal_query_write.c */
@@ -1398,7 +1398,7 @@
 /* rasqal_row.c */
 rasqal_row* rasqal_new_row(rasqal_rowsource* rowsource);
 rasqal_row* rasqal_new_row_from_row(rasqal_row* row);
-int rasqal_row_print(rasqal_row* row, FILE* fh);
+RASQAL_API int rasqal_row_print(rasqal_row* row, FILE* fh);
 int rasqal_row_write(rasqal_row* row, raptor_iostream* iostr);
 raptor_sequence* rasqal_new_row_sequence(rasqal_world* world, rasqal_variables_table* vt, const char* const row_data[], int vars_count, raptor_sequence** vars_seq_p);
 int rasqal_row_to_nodes(rasqal_row* row);
@@ -1847,10 +1847,10 @@
 int rasqal_regex_match(rasqal_world* world, raptor_locator* locator, const char* pattern, const char* regex_flags, const char* subject, size_t subject_len);
 
 /* rasqal_results_compare.c */
-rasqal_results_compare* rasqal_new_results_compare(rasqal_world* world, rasqal_query_results *first_qr, const char* first_qr_label, rasqal_query_results *second_qr, const char* second_qr_label);
-void rasqal_free_results_compare(rasqal_results_compare* rrc);
-void rasqal_results_compare_set_log_handler(rasqal_results_compare* rrc, void* log_user_data, raptor_log_handler log_handler);
-int rasqal_results_compare_compare(rasqal_results_compare* rrc);
+RASQAL_API rasqal_results_compare* rasqal_new_results_compare(rasqal_world* world, rasqal_query_results *first_qr, const char* first_qr_label, rasqal_query_results *second_qr, const char* second_qr_label);
+RASQAL_API void rasqal_free_results_compare(rasqal_results_compare* rrc);
+RASQAL_API void rasqal_results_compare_set_log_handler(rasqal_results_compare* rrc, void* log_user_data, raptor_log_handler log_handler);
+RASQAL_API int rasqal_results_compare_compare(rasqal_results_compare* rrc);
 rasqal_variable* rasqal_results_compare_get_variable_by_offset(rasqal_results_compare* rrc, int idx);
 int rasqal_results_compare_get_variable_offset_for_result(rasqal_results_compare* rrc, int var_idx, int qr_index);
 int rasqal_results_compare_variables_equal(rasqal_results_compare* rrc);
--- a/src/win32_rasqal_config.h.in
+++ b/src/win32_rasqal_config.h.in
@@ -59,19 +59,16 @@
 } timeval;
 #endif
 
+#ifndef __MINGW32__
 struct timezone
 {
   int tz_minuteswest; /* minutes West of Greenwich */
   int tz_dsttime;     /* type of dst correction */
 };
-
-int rasqal_gettimeofday(struct timeval *tv, struct timezone *tz);
-#undef HAVE_GETTIMEOFDAY
+#endif
 
 #include <float.h>
 #define isnan(n) _isnan(n)
-/* no round function available */
-#define round(x) floor(x+0.5)
 
 /* These are SPARQL token definitions */
 #ifdef OPTIONAL
@@ -139,29 +136,6 @@
 /* looks like the .c files define this anyway */
 /* #define YY_NO_UNISTD_H */
 
-#undef RASQAL_INLINE
-#define RASQAL_INLINE __inline
-
-/* Building SPARQL query */
-#define RASQAL_QUERY_SPARQL 1
-
-/* Use raptor to provide triples */
-#define RAPTOR_TRIPLES_SOURCE_RAPTOR 1
-
-/* Use redland to provide triples */
-/* #define RAPTOR_TRIPLES_SOURCE_REDLAND 1 */
-
-/* Use PCRE regex library */
-//#define RASQAL_REGEX_PCRE 1
-
-#define HAVE_LIBXML_SCHEMASINTERNALS_H 1
-#define HAVE_LIBXML_XMLSCHEMASTYPES_H 1
-#define HAVE_LIBXML_XMLSCHEMAS_H 1
-
-#define RASQAL_DECIMAL_NONE 1
-#define RASQAL_UUID_INTERNAL 1
-#define RASQAL_DIGEST_INTERNAL 1
-
 #ifdef _DEBUG
 #define RASQAL_DEBUG 1
 #endif
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -52,7 +52,7 @@
 
 roqet_SOURCES = roqet.c
 roqet_CPPFLAGS = $(AM_CPPFLAGS)
-roqet_LDADD = $(top_builddir)/src/librasqal.la librasqalcmdline.la
+roqet_LDADD = librasqalcmdline.la $(top_builddir)/src/librasqal.la
 roqet_DEPENDENCIES = $(top_builddir)/src/librasqal.la librasqalcmdline.la
 roqet_LDFLAGS = @RAPTOR2_LIBS@
 if GETOPT
@@ -63,7 +63,7 @@
 
 check_query_SOURCES = check_query.c
 check_query_CPPFLAGS = $(AM_CPPFLAGS)
-check_query_LDADD = $(top_builddir)/src/librasqal.la librasqalcmdline.la
+check_query_LDADD = librasqalcmdline.la $(top_builddir)/src/librasqal.la
 check_query_DEPENDENCIES = $(top_builddir)/src/librasqal.la librasqalcmdline.la
 check_query_LDFLAGS = @RAPTOR2_LIBS@
 if GETOPT
@@ -74,7 +74,7 @@
 
 testrunner_SOURCES = testrunner.c manifest.c manifest.h
 testrunner_CPPFLAGS = $(AM_CPPFLAGS)
-testrunner_LDADD = $(top_builddir)/src/librasqal.la librasqalcmdline.la
+testrunner_LDADD = librasqalcmdline.la $(top_builddir)/src/librasqal.la
 testrunner_DEPENDENCIES = $(top_builddir)/src/librasqal.la librasqalcmdline.la
 testrunner_LDFLAGS = @RAPTOR2_LIBS@
 if GETOPT
