[Expat-discuss] Linking
Tom Younger
tom at abc123.dowco.com
Wed Aug 30 06:58:54 CEST 2006
Hi there.
I have a question about linking.
I would like to link the Expat library statically. When I link to the
Linux libraries, this happens properly, however when I link my project
under Windows, I can only get the program to work if I include the path to
the libexpat.dll in my system path.
Even though I include StaticLibs\libexpatMT.lib in my link command, without
Libs\libexpat.lib, it can't resolve some symbols. It appears as though
libexpat.lib loads the DLL at run-time.
The problem I have is that the project I am working on is expected to be
able to run without setting any environment variables prior to executing
(it does that itself at run-time), and with all software components
self-contained in its own install folder. The way I currently have things
working the DLL is loaded at program startup, prior to being able to set
the path at run-time to allow a local copy of the DLL to be loaded.
The relevant portion of my current Makefile is included below:
#### Expat
EXPAT_HOME = V:\lib\Expat-2.0.0
INCLUDE_EXPAT = -I$(EXPAT_HOME)\include
LDFLAGS_EXPAT = /LIBPATH:$(EXPAT_HOME)
LIB_EXPAT = $(LDFLAGS_EXPAT)\Libs libexpat.lib
$(LDFLAGS_EXPAT)\StaticLibs libexpatMT.lib
I've been unable to find any mention of this in any of the documentation
I've found. Like I said, my Makefile for Linux works just as expected and
links statically just fine.
---
Tom Younger, B.Sc.
Lead Engineer, Marine Division
Quester Tangent
More information about the Expat-discuss
mailing list