[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: program fails if built in source tree (was: GNU Libtool 1.5.23b rele

From: haibin zhang
Subject: Re: program fails if built in source tree (was: GNU Libtool 1.5.23b released (alpha release).)
Date: Tue, 6 Mar 2007 10:40:10 +0800 (CST)

HI Ralf :
I have done it as you said, but it still can't be run.
My project is only depend on ACE, you can download a prebuilt one  from :

This is content of my that I modified :

bin_PROGRAMS            = hbconsole init_user
#hbconsole_LDFLAGS = -export-dynamic --export-all-symbols @LTLIBINTL@ $(ACE_LDFLAGS)
hbconsole_CXXFLAGS    = $(ACE_CXXFLAGS)
hbconsole_LDADD   =
hbconsole_SOURCES           = main.cpp

init_user_LDFLAGS = -export-dynamic @LTLIBINTL@ $(ACE_LDFLAGS)
init_user_CXXFLAGS    = $(ACE_CXXFLAGS)
init_user_LDADD   =
init_user_SOURCES           = init_user.cpp

The output of make :

 g++ -DHAVE_CONFIG_H -I. -I.. -Wall -D_MINGW32_ -D_WIN32_ -I/opt/ace/include -I../include -O2 -MT libhbstock2_la-hbstock_prof
ile.lo -MD -MP -MF .deps/libhbstock2_la-hbstock_profile.Tpo -c hbstock_profile.cpp -o libhbstock2_la-hbstock_profile.o >/dev/
null 2>&1
mv -f .deps/libhbstock2_la-hbstock_profile.Tpo .deps/libhbstock2_la-hbstock_profile.Plo
/bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -Wall -D_MINGW32_ -D_WIN32_  -I/opt/ace/include -
I../include -O2 -MT libhbstock2_la-do_portfolio.lo -MD -MP -MF .deps/libhbstock2_la-do_portfolio.Tpo -c -o libhbstock2_la-do_
portfolio.lo `test -f 'do_portfolio.cpp' || echo './'`do_portfolio.cpp
 g++ -DHAVE_CONFIG_H -I. -I.. -Wall -D_MINGW32_ -D_WIN32_ -I/opt/ace/include -I../include -O2 -MT libhbstock2_la-do_portfolio
.lo -MD -MP -MF .deps/libhbstock2_la-do_portfolio.Tpo -c do_portfolio.cpp  -DDLL_EXPORT -DPIC -o .libs/libhbstock2_la-do_port
 g++ -DHAVE_CONFIG_H -I. -I.. -Wall -D_MINGW32_ -D_WIN32_ -I/opt/ace/include -I../include -O2 -MT libhbstock2_la-do_portfolio
.lo -MD -MP -MF .deps/libhbstock2_la-do_portfolio.Tpo -c do_portfolio.cpp -o libhbstock2_la-do_portfolio.o >/dev/null 2>&1
mv -f .deps/libhbstock2_la-do_portfolio.Tpo .deps/libhbstock2_la-do_portfolio.Plo
/bin/sh ../libtool --tag=CXX   --mode=link g++ -I/opt/ace/include -I../include -O2 -no-undefined  -avoid-version  -lintl  -L/
opt/ace/lib -lACE -lws2_32 -lmswsock -lwsock32 -lnetapi32   -o -rpath /opt/hbstock//lib libhbstock2_la-md5.lo
libhbstock2_la-i18n_debug.lo libhbstock2_la-usage_tool.lo libhbstock2_la-app_config.lo libhbstock2_la-config_file_map.lo libh
bstock2_la-statistics.lo libhbstock2_la-hbstock_exception.lo libhbstock2_la-model_base.lo libhbstock2_la-stock_data.lo libhbs
tock2_la-stock_technic.lo libhbstock2_la-stock_kline.lo libhbstock2_la-hbstock_init.lo libhbstock2_la-stock_selector.lo libhb
stock2_la-do_stock.lo libhbstock2_la-hbstock_profile.lo libhbstock2_la-do_portfolio.lo
g++ -shared -nostdlib d:/msys/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../dllcrt2.o d:/msys/mingw/bin/../lib/gcc/mingw32/3.4.
5/crtbegin.o  .libs/libhbstock2_la-md5.o .libs/libhbstock2_la-i18n_debug.o .libs/libhbstock2_la-usage_tool.o .libs/libhbstock
2_la-app_config.o .libs/libhbstock2_la-config_file_map.o .libs/libhbstock2_la-statistics.o .libs/libhbstock2_la-hbstock_excep
tion.o .libs/libhbstock2_la-model_base.o .libs/libhbstock2_la-stock_data.o .libs/libhbstock2_la-stock_technic.o .libs/libhbst
ock2_la-stock_kline.o .libs/libhbstock2_la-hbstock_init.o .libs/libhbstock2_la-stock_selector.o .libs/libhbstock2_la-do_stock
.o .libs/libhbstock2_la-hbstock_profile.o .libs/libhbstock2_la-do_portfolio.o  /mingw/lib/libintl.dll.a -L/mingw/lib -L/opt/a
ce/lib -lACE -lws2_32 -lmswsock -lwsock32 -lnetapi32 -Ld:/msys/mingw/bin/../lib/gcc/mingw32/3.4.5 -Ld:/msys/mingw/bin/../lib/
gcc -Ld:/msys/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../mingw32/lib -Ld:/msys/mingw/bin/../lib/gcc/mingw32/3.4.5/../../.
. -lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname
-lmingwex -lmsvcrt d:/msys/mingw/bin/../lib/gcc/mingw32/3.4.5/crtend.o  -o .libs/libhbstock2.dll -Wl,--enable-auto-image-base
 -Xlinker --out-implib -Xlinker .libs/libhbstock2.dll.a
Creating library file: .libs/libhbstock2.dll.a
ar cru .libs/libhbstock2.a  libhbstock2_la-md5.o libhbstock2_la-i18n_debug.o libhbstock2_la-usage_tool.o libhbstock2_la-app_c
onfig.o libhbstock2_la-config_file_map.o libhbstock2_la-statistics.o libhbstock2_la-hbstock_exception.o libhbstock2_la-model_
base.o libhbstock2_la-stock_data.o libhbstock2_la-stock_technic.o libhbstock2_la-stock_kline.o libhbstock2_la-hbstock_init.o
libhbstock2_la-stock_selector.o libhbstock2_la-do_stock.o libhbstock2_la-hbstock_profile.o libhbstock2_la-do_portfolio.o
ranlib .libs/libhbstock2.a
(cd .libs && rm -f && ln -s ../
g++ -DHAVE_CONFIG_H -I. -I..  -Wall -D_MINGW32_ -D_WIN32_  -I/opt/ace/include -I../include -O2 -MT hbconsole-main.o -MD -MP -
MF .deps/hbconsole-main.Tpo -c -o hbconsole-main.o `test -f 'main.cpp' || echo './'`main.cpp
mv -f .deps/hbconsole-main.Tpo .deps/hbconsole-main.Po
/bin/sh ../libtool --tag=CXX   --mode=link g++ -I/opt/ace/include -I../include -O2 -lintl -L/opt/ace/lib -lACE -lws2_32 -lmsw
sock -lwsock32 -lnetapi32  -o hbconsole.exe hbconsole-main.o
g++ -I/opt/ace/include -I../include -O2 -o .libs/hbconsole.exe hbconsole-main.o  -L/mingw/lib -L/opt/ace/lib ./.libs/libhbsto
ck2.dll.a /mingw/lib/libintl.dll.a /mingw/lib/libiconv.dll.a -lACE -lws2_32 -lmswsock -lwsock32 -lnetapi32  -L/opt/hbstock//l
ib -L/mingw/lib
Info: resolving ACE_Service_Config::no_static_svcs_        by linking to __imp___ZN18ACE_Service_Config15no_static_svcs_E (au
creating hbconsole.exe
g++ -DHAVE_CONFIG_H -I. -I..  -Wall -D_MINGW32_ -D_WIN32_  -I/opt/ace/include -I../include -O2 -MT init_user-init_user.o -MD
-MP -MF .deps/init_user-init_user.Tpo -c -o init_user-init_user.o `test -f 'init_user.cpp' || echo './'`init_user.cpp
mv -f .deps/init_user-init_user.Tpo .deps/init_user-init_user.Po
/bin/sh ../libtool --tag=CXX   --mode=link g++ -I/opt/ace/include -I../include -O2 -export-dynamic -lintl -L/opt/ace/lib -lAC
E -lws2_32 -lmswsock -lwsock32 -lnetapi32  -o init_user.exe init_user-init_user.o
g++ -I/opt/ace/include -I../include -O2 -o .libs/init_user.exe init_user-init_user.o -Wl,--export-dynamic  -L/mingw/lib -L/op
t/ace/lib ./.libs/libhbstock2.dll.a /mingw/lib/libintl.dll.a /mingw/lib/libiconv.dll.a -lACE -lws2_32 -lmswsock -lwsock32 -ln
etapi32  -L/opt/hbstock//lib -L/mingw/lib
creating init_user.exe
make[2]: Leaving directory `/e/zhb_svn/mingw/build/hbstock_build/hbstock-2.0.9/src'


Zhang HaiBin

Ralf Wildenhues <address@hidden> 写道:
Hello Haibin,

Apologies for the delay.
Let's keep this discussion on the libtool list only.

On Sat, Feb 24, 2007 at 06:22:53PM +0800, haibin zhang wrote:
> HI ,
> I have tested 1.5.23b in mingw in Windows XP, but I still find the bug of libtool.
> The bug is :
> If I build my project in directory same as source code directory, the built file can't be run.

I've taken a look at your package, but not tried to compile it
(due to the list of dependencies).

One bug I see is that you use things like

unitTest_LDFLAGS = -L$(top_builddir)/src -lhbstock2 $(CPPUNIT_LD_INC)
unitTest_DEPENDENCIES = $(top_builddir)/src/

This isn't right. For libraries built in the same package, you should
just use the .la file name as dependencies in *_LDADD. Then Automake
will compute the *_DEPENDENCIES automatically for you, and also libtool
will do the right thing. Like this:

unitTest_LDADD = $(top_builddir)/src/ $(CPPUNIT_LD_INC)

similar with the other programs.

Does that fix the failure? If not, then please post the output of
make clean; make

for the setup that fails (source tree == build tree).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]