diff --git a/qucs-core/src/Makefile.am b/qucs-core/src/Makefile.am
index fa7b8dd..45f4353 100755
--- a/qucs-core/src/Makefile.am
+++ b/qucs-core/src/Makefile.am
@@ -122,7 +122,7 @@ all-am: qucsdefs.h
generated_FILES = qucsdefs.h
qucsdefs.h: qucsator$(EXEEXT)
- ./$< -l > $@
+ LD_PRELOAD=./.libs/libqucs.so.0 ./$< -l > $@
## The qucs equation definitions use a hash lookup table
## generated using gperf and put in gperfapphash.cpp which
diff --git a/qucs-core/src/Makefile.in b/qucs-core/src/Makefile.in
index 3196e0d..bb0bfcd 100644
--- a/qucs-core/src/Makefile.in
+++ b/qucs-core/src/Makefile.in
@@ -1224,7 +1224,7 @@ scan_zvr.cpp: LEX_OUTPUT_ROOT = lex.zvr_
all-am: qucsdefs.h
qucsdefs.h: qucsator$(EXEEXT)
- ./$< -l > $@
+ LD_PRELOAD=./.libs/libqucs.so.0 ./$< -l > $@
equation.cpp: gperfapphash.cpp