diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile
index 645b273..e482dcd 100644
--- a/cinelerra-5.1/cinelerra/Makefile
+++ b/cinelerra-5.1/cinelerra/Makefile
@@ -428,13 +428,28 @@ LIBS := $(LIBRARIES)
 ifneq ($(WANT_CIN_3RDPARTY),no)
 LIBS += $(libraries)
 else
+LIBS += -Wl,--export-all-symbols -g
+LIBS += -Wl,--out-implib,$(OBJDIR)/lib$(WANT_CIN).exe.a
+LIBS += -L$(FF_DIR)/lib
+LIBS += -Wl,-rpath-link=:$(FF_DIR)/lib
+LIBS += -Wl,--as-needed -Wl,--warn-common
+LIBS += -lavdevice
+LIBS += -lavfilter
+LIBS += -lavformat
+LIBS += -lavcodec
+LIBS += -lswresample
+LIBS += -lswscale
+LIBS += -lavutil
+
+LIBS += -lvpx -lwebp -lwebpmux
+LIBS += -ljpeg -lFLAC -lgif -lsndfile -ltiff
+
+LIBS += -lsecur32 -lole32 -luser32 -luser32 -lbcrypt -lshell32
 
 LIBS += -lpthread -lm -lbz2 -llzma -lz -lpng -luuid
-LIBS += -lX11 -lXau -lXdmcp -lXext -lXfixes -lXv -lXinerama
+LIBS += -lX11 -lXau -lXdmcp -lXext -lXfixes -lXinerama
+LIBS += -lintl -liconv
 LIBS += -lfontconfig -lfreetype
-LIBS += -lavcodec -lavdevice -lavfilter -lavformat -lavresample -lavutil
-LIBS += -lswresample -lswscale
-LIBS += -lvpx -lwebp -lwebpmux
 
 LIBS += $(if $(filter fftw,$(static_pkgs)), -lfftw3)
 LIBS += $(if $(filter flac,$(static_pkgs)), -lFLAC)
@@ -454,7 +470,7 @@ LIBS += $(if $(filter x265,$(static_pkgs)), -lx265)
 LIBS += $(if $(filter libvpx,$(static_pkgs)), -lvpx)
 
 ifneq ($(WANT_GL),no)
-LIBS += -lGL -lGLU -lGLX
+LIBS += -lGL -lGLU
 endif
 ifneq ($(WANT_XFT),no)
 LIBS += -lXft
@@ -548,7 +564,7 @@ CFLAGS += -DUSE_ALPHA
 
 else
 
-LDFLAGS1 = -Wl,-export-dynamic -g
+LDFLAGS1 = -Wl,-export-all-symbols -g
 LDFLAGS2 = $(LDFLAGS)
 LINKER = $(CXX) -o $(OUTPUT)
 
@@ -566,7 +582,7 @@ all:	$(OUTPUT) $(CUTADS) $(BDWRITE) $(LV2UI)
 $(OUTPUT): $(OBJS) $(THEME_DATA) $(DCRAW) $(LIBRARIES)
 	$(LINKER) `cat $(OBJDIR)/objs`
 	$(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT) $(OUTPUT_G))
-	$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
+	#$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
 	ln -f -s ../bin/$(WANT_CIN) ci
 
 ifneq ($(WANT_COMMERCIAL),no)
@@ -574,7 +590,7 @@ $(CUTADS):	$(CUTOBJS) $(CUTLIBS) $(LIBRARIES)
 	@echo g++ -o $@ $(CUTOBJS)
 	@g++ $(CFLAGS) -pthread -o $@ $(CUTOBJS) $(CUTLIBS) $(LIBS)
 	$(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(CUTADS) $(CUTADS).debuginfo)
-	$(if $(findstring -ggdb,$(CFLAGS)),,strip $(CUTADS))
+	#$(if $(findstring -ggdb,$(CFLAGS)),,strip $(CUTADS))
 
 install-cutads:
 	cp -av $(OBJDIR)/cutads $(BINDIR)/.
@@ -586,7 +602,7 @@ $(BDWRITE):	$(BDWOBJS) $(LIBRARIES)
 	@echo g++ -o $@ $(BDWOBJS)
 	@g++ $(CFLAGS) -pthread -o $@ $(BDWOBJS) $(LIBS)
 	$(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(BDWRITE) $(BDWRITE).debuginfo)
-	$(if $(findstring -ggdb,$(CFLAGS)),,strip $(BDWRITE))
+	#$(if $(findstring -ggdb,$(CFLAGS)),,strip $(BDWRITE))
 
 install-bdwrite:
 	cp -av $(OBJDIR)/bdwrite $(BINDIR)/.
@@ -629,7 +645,7 @@ $(OBJDIR)/lv2ui: $(LV2OBJS)
 	@echo $(CXX) \`cat $(OBJDIR)/c_flags\` $^ -o $@
 	@$(CXX) `cat $(OBJDIR)/c_flags` $^ -o $@ $(LIBS) $(GTK2_LIBS)
 	$(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(LV2UI) $(LV2UI).debuginfo)
-	$(if $(findstring -ggdb,$(CFLAGS)),,strip $(LV2UI))
+	#$(if $(findstring -ggdb,$(CFLAGS)),,strip $(LV2UI))
 
 .PHONY:	lv2ui
 lv2ui:	$(LV2UI)
diff --git a/cinelerra-5.1/db/tdb.h b/cinelerra-5.1/db/tdb.h
index 8ee8800..9a17091 100644
--- a/cinelerra-5.1/db/tdb.h
+++ b/cinelerra-5.1/db/tdb.h
@@ -32,7 +32,7 @@ inline void operator delete[](void *t,size_t n) { free(t); }
 #endif
 
 #define ZMEDIA
-#define ZFUTEX
+//#define ZFUTEX
 #ifdef ZFUTEX
 #include <unistd.h>
 #include <endian.h>
diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C
index 1d52855..fdab491 100644
--- a/cinelerra-5.1/guicast/bcresources.C
+++ b/cinelerra-5.1/guicast/bcresources.C
@@ -367,8 +367,8 @@ BC_Resources::BC_Resources(float x_scale, float y_scale)
 	BC_WindowBase::resources = this;
 	synchronous = 0;
 	vframe_shm = 0;
-	use_shm = -1;
-	shm_reply = 1;
+	use_shm = 0;
+	shm_reply = 0;
 
 	if( x_scale <= 0 ) x_scale = 1;
 	if( y_scale <= 0 ) y_scale = x_scale;
diff --git a/cinelerra-5.1/guicast/filesystem.h b/cinelerra-5.1/guicast/filesystem.h
index c976135..5613702 100644
--- a/cinelerra-5.1/guicast/filesystem.h
+++ b/cinelerra-5.1/guicast/filesystem.h
@@ -26,6 +26,9 @@
 #include "bcwindowbase.inc"
 #include "sizes.h"
 
+#define dirent64 dirent
+#define readdir64 readdir
+
 class FileItem
 {
 public:
diff --git a/cinelerra-5.1/plugin_config b/cinelerra-5.1/plugin_config
index 56f4351..f7149bb 100644
--- a/cinelerra-5.1/plugin_config
+++ b/cinelerra-5.1/plugin_config
@@ -4,12 +4,21 @@ CFLAGS += -I../ -I$(CINELERRA) -I$(GUICAST) -I../colors -fPIC
 CFLAGS += $(static_incs)
 LFLAGS += $(static_libs)
 LFLAGS += $(LDFLAGS)
+
+LFLAGS +=  -Wl,$(CINELERRA)/$(OBJDIR)/libcin.exe.a
+LFLAGS += -lintl -liconv
+ifneq ($(WANT_GL),no)
+LFLAGS += -lGL -lGLU
+endif
+
 LDLINKER ?= $(CXX) -shared
 $(shell mkdir -p $(OBJDIR))
 
+#SFX=plugin
+SFX=dll
 PLUGIN_DIR := $(BINDIR)/plugins
 OUTPUT_DIR = $(PLUGIN_DIR)/$($(PLUGIN))
-OUTPUT = $(OUTPUT_DIR)/$(PLUGIN).plugin
+OUTPUT = $(OUTPUT_DIR)/$(PLUGIN).$(SFX)
 OUTPUT_G = $(OBJDIR)/$(PLUGIN).debuginfo
 
 $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags)
@@ -20,16 +29,16 @@ ifeq ($(OUTPUT_THEME),)
 $(OUTPUT): $(OBJS) $(OUTPUT_DIR) $(OUTPUT_BINS)
 	$(LDLINKER) -o $(OUTPUT) $(OBJS) $(OUTPUT_BINS) `cat $(OBJDIR)/l_flags`
 	$(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT) $(OUTPUT_G))
-	$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
+	#$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
 
 else
 
 THEME_DATA = $(OBJDIR)/$(PLUGIN)_data.o
 
 $(OUTPUT_THEME): $(OBJS) $(OUTPUT_DIR) $(THEME_DATA)
-	$(LDLINKER) -o $(OUTPUT_THEME) $(OBJS) $(THEME_DATA) $(LDFLAGS)
+	$(LDLINKER) -o $(OUTPUT_THEME) $(OBJS) $(THEME_DATA) `cat $(OBJDIR)/l_flags`
 	$(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT_THEME) $(OUTPUT_G))
-	$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT_THEME))
+	#$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT_THEME))
 
 $(THEME_DATA):
 	cd $(OBJDIR) && \
diff --git a/cinelerra-5.1/plugins/Makefile b/cinelerra-5.1/plugins/Makefile
index 22bc7dd..6404536 100644
--- a/cinelerra-5.1/plugins/Makefile
+++ b/cinelerra-5.1/plugins/Makefile
@@ -36,7 +36,6 @@ DIRS = $(OPENCV_OBJS) \
 	brightness \
 	burn \
 	C41 \
-	cdripper \
 	chorus \
 	chromakey \
 	chromakeyhsv \
@@ -176,6 +175,8 @@ DIRS = $(OPENCV_OBJS) \
 #	denoisemjpeg \
 # duplicate
 #	vocoder \
+# not in bsd or win
+#	cdripper \
 
 PLUGIN_DIR = $(BINDIR)/plugins
 DATA = $(PLUGIN_DIR)/fonts $(PLUGIN_DIR)/shapes
diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C
--- guicast/bcsignals.C	2020-01-27 07:27:45.332623800 -0700
+++ guicast/bcsignals.C	2020-01-27 07:28:11.443049600 -0700
@@ -44,6 +44,7 @@
 #include <sys/prctl.h>
 #endif
 #include <sys/types.h>
+#include <sys/wait.h>
 
 BC_Signals* BC_Signals::global_signals = 0;
 static int signal_done = 0;
