bug-commoncpp
[Top][All Lists]
Advanced

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

Re: linking probs with ccext2 and cmdlineopt using w32 msys/mingw


From: Wolfgang Alper
Subject: Re: linking probs with ccext2 and cmdlineopt using w32 msys/mingw
Date: Sun, 4 Jan 2004 21:17:08 +0100
User-agent: KMail/1.5.4

Well after a while i found the problem.
it is really trival if one knows about it.

the point is the order of commands in the make file (refering to the process 
of linking)

Example1: given that  c++ = mingw32-c++
(does NOT work on win32(mingw/msys) and cause the linkage problem, but works 
on linux)
c++  -L/mingw/lib -lccgnu2 -lccext2 -lws2_32  cmdlineopt.o  -o cmdlineopt.exe 

Example2: given that c++ = g++
(this DOES work on both win32 and linux)
c++  cmdlineopt.o  -L/mingw/lib -lccgnu2 -lccext2 -lws2_32  -o cmdlineopt.exe 

hope that helps those haveing probs when porting from linux to mingw/win32

Regards

Wolfgang

p.s. it someone is interested , i would put together a simple summary of what 
i changed for:

-getting commonc++ compiled on win32(using mingw/msys)
-changing mingw (libs /include) on win32  to get other apps compiled outside 
the commonc++ src dir.
-creating a makefile for a 3th party up to work with mingw/msys and commonc.

it might be that i did things that i should not have done. but as i stated 
before, these were my first steps on win32 mingw/msys and now i can compile 
the same source from the same dir for both linux and w32 :-)




Am Donnerstag, 1. Januar 2004 17:11 schrieb Wolfgang:
> Hello,
> first of all a happy new year!!!
>
> i have some problems when using the cmdline class within w32, but only
> during linking. the other stuff links fine.
> i have to admit that i am no expert with msys and mingw.
> however, the rest of the demo apps compile and link without any problem.
>
> also i have to place my self compiled commonc++ dll's within the ./mytest
> dir, otherwise it does not link at all. however, the dll's should be at the
> right place.
>
>
> p.s. i do not refer to the "deprecated or antiquated..." warnung but to
> "Info: resolving __ZN3ost24defaultCommandOptionListE by linking to
> __imp___ZN3ost24defaultCommandOptionListE (auto-import)"
>
>
> //this looks not ok
>
> address@hidden ~/mytest
> $ make cmdlineopt
> mingw32-c++ -g -O2 -mthreads -I. -I/mingw/include/cc++2 -DHAVE_CONFIG_H
> -D_GNU_SOURCE -L. -L/mingw/dll -L/mingw/lib -lccgnu2 -lccext2 -lws2_32
> cmdlineopt.cpp   -o cmdlineopt
> In file included from D:/APPS/DEVEL/MinGW/include/c++/3.2.3/backward/
> strstream:51,
>                  from cmdlineopt.cpp:164:
> D:/APPS/DEVEL/MinGW/include/c++/3.2.3/backward/backward_warning.h:32:2:
> warning: #warning This file includes at least one deprecated or antiquated
> header. Please consider using one of the 32 headers found in section
> 17.4.1.2 of the C++ standard. Examples include substituting the <X> header
> for the <X.h> header for C++ includes, or <sstream> instead of the
> deprecated header <strstream.h>. To disable this warning use
> -Wno-deprecated.
> Info: resolving __ZN3ost24defaultCommandOptionListE by linking to
> __imp___ZN3ost24defaultCommandOptionListE (auto-import)
> address@hidden ~/mytest$
>
>
> //this looks ok
>
> address@hidden ~/mytest
> $ make tcp
> mingw32-c++ -g -O2 -mthreads -I. -I/mingw/include/cc++2 -DHAVE_CONFIG_H
> -D_GNU_SOURCE -L. -L/mingw/dll -L/mingw/lib -lccgnu2 -lccext2 -lws2_32
> tcp.cpp   -o tcp
>
>
> //this looks ok
>
> address@hidden ~/mytest
> $ make crc32
> mingw32-c++ -g -O2 -mthreads -I. -I/mingw/include/cc++2 -DHAVE_CONFIG_H
> -D_GNU_SOURCE -L. -L/mingw/dll -L/mingw/lib -lccgnu2 -lccext2 -lws2_32
> crc32.cpp   -o crc32
>
>
>
>
>
>
>
> creation of dll's:
> =====================
> $ make -f Makefile.tst
> dllwrap --export-all-symbols --output-def ccgnu2.def --implib libccgnu2.a
> --driver-name mingw32-c++ -o ccgnu2.dll \
> thread.o mutex.o semaphore.o threadkey.o friends.o event.o slog.o dir.o
> file.o inaddr.o peer.o port.o socket.o network.o serial.o mempager.o
> keydata.o dso.o exception.o process.o urlstring.o libgnu2.o -L/mingw/dll
> -lws2_32
> D:\APPS\DEVEL\MinGW\bin\dllwrap.exe: no export definition file provided.
> Creating one, but that may not be what you want
> dllwrap --export-all-symbols --output-def ccext2.def --implib libccext2.a
> --driver-name mingw32-c++ -o ccext2.dll \
> buffer.o fifo.o pipe.o numbers.o cmdoptns.o url.o persist.o engine.o
> digest.o sha.o date.o groups.o md5.o unix.o ftp.o libgnu2.o -L.
> -L/mingw/dll -lccgnu2 -liberty -lws2_32
> D:\APPS\DEVEL\MinGW\bin\dllwrap.exe: no export definition file provided.
> Creating one, but that may not be what you want
>
>
> make install
> ============
> address@hidden ~/commoncpp2-1.0.13/win32
> $ make -f Makefile.tst install
> mkdir -p /mingw/include/cc++2/cc++
> mkdir -p /mingw/dll
> cp -af cc++/config.h ../include/cc++/thread.h ../include/cc++/socket.h ../
> include/cc++/exception.h ../include/cc++/cmdoptns.h ../include/cc++/
> digest.h ../include/cc++/export.h ../include/cc++/file.h ../include/cc++/
> groups.h ../include/cc++/misc.h ../include/cc++/numbers.h ../include/cc++/
> persist.h ../include/cc++/slog.h ../include/cc++/url.h ../include/cc++/
> urlstring.h ../include/cc++/xml.h ../include/cc++/serial.h ../include/cc++/
> strchar.h ../include/cc++/network.h /mingw/include/cc++2/cc++
> cp -af libccgnu2.a ccgnu2.dll libccext2.a ccext2.dll /mingw/dll
> cp -af libccgnu2.a /mingw/lib/libccgnu2dll.a
> cp -af libccext2.a /mingw/lib/libccext2dll.a
> strip /mingw/dll/ccgnu2.dll /mingw/dll/ccext2.dll
> ar -rs /mingw/lib/libccgnu2.a thread.o mutex.o semaphore.o threadkey.o
> friends.o event.o slog.o dir.o file.o inaddr.o peer.o port.o socket.o
> network.o serial.o mempager.o keydata.o dso.o exception.o process.o
> urlstring.o
> ar -rs /mingw/lib/libccext2.a buffer.o fifo.o pipe.o numbers.o cmdoptns.o
> url.o persist.o engine.o digest.o sha.o date.o groups.o md5.o unix.o ftp.o
>
> address@hidden ~/commoncpp2-1.0.13/win32
> $
>
>
>
> and the files:
> =============
> address@hidden ~/commoncpp2-1.0.13/win32
> $ ls /mingw/lib/libcc* -la
> -rw-r--r--    1 wolfgang Administ 13103364 Jan  1 15:57
> /mingw/lib/libccext2.a -rw-r--r--    1 wolfgang Administ   569388 Jan  1
> 15:53 /mingw/lib/ libccext2dll.a
> -rw-r--r--    1 wolfgang Administ 17491450 Jan  1 15:57
> /mingw/lib/libccgnu2.a -rw-r--r--    1 wolfgang Administ   632530 Jan  1
> 15:53 /mingw/lib/ libccgnu2dll.a
>
>
> address@hidden ~/commoncpp2-1.0.13/win32
> $ ls /mingw/dll -la
> -rwxr-xr-x    1 wolfgang Administ   390656 Jan  1 15:57 ccext2.dll
> -rwxr-xr-x    1 wolfgang Administ   368128 Jan  1 15:57 ccgnu2.dll
> -rw-r--r--    1 wolfgang Administ   569388 Jan  1 15:53 libccext2.a
> -rw-r--r--    1 wolfgang Administ   632530 Jan  1 15:53 libccgnu2.a
>
>
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp





reply via email to

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