From: geier AT forwiss DOT uni-passau DOT de (Roland Geier) Subject: Linking agains dll (was Re: Where to find gettimeofday(), local) 19 Jun 1997 08:16:42 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199706191437.QAA12438.cygnus.gnu-win32@bombadill.forwiss.uni-passau.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Original-To: gnu-win32 AT cygnus DOT com X-Face: %JjDwL,CM#gbv*uICrNLdM9yk_LRxMh3DV'.fQ>iw'N;7([Jq}2|J#5o".kzM&>7tW`8T^Z buvRLp?jvQ+sbD3BND%=&D: lT%vT4p7cGcGRP5JO+F'^ X-Mailer: ELM [version 2.4ME+ PL31 (25)] Original-Sender: owner-gnu-win32 AT cygnus DOT com Hi! > also I think you need to surround gettimeofday() and localtime() with > > extern "C" { > struct tm *localtime(time_t *timer); > int gettimeofday(struct timeval*, struct timezone*); > } > > but that I'm not sure of, see how it works. ooops... it works!!! >> >> -970404/../../../../i386-cygwin32/lib/libcygwin.a(libcmain.o)(.text+0x1e): >>libcmain.cc: undefined reference to `WinMain AT 16' > > this you can ignore, it won't stop the link, unless you don't have a > > int main()( return 0;} > > in your fixup.c Well, it *does* stop the link and no output is produced (NT4.0, b18). There's no 'WinMain' or 'main' defined or referenced in any of my files. Whereas if 'fixup.c' contains int main() {return 0;} the dll is linked without any complaints, but an application containing 'main' itself won't get linked against the dll as 'main' is multiply defined :-( For example the following mini-test-driver won't work: ------------------------ snip tst.cc ------------------------ #include #include int main () { cout << "This is main!" << endl; Date d( "16.5.1997" ); cout << "Date created on " << d.GetDateStr() << endl ; return 1; } ------------------------ snip tst.cc ------------------------ I'm compiling with: > g++ -c tst.cc > g++ -o tst tst.o DateTime.a This works, but 'tst.exe' dies immediately after startup. I admit I don't have the slightest idea what's going on there, especially I did not yet get the meaning of the fixup-stuff :-( Bye and once again thx in advance, --- Roland. --- Roland Geier Phone: ++49 (8505) 92181 Universitaet Passau, GER Fax: ++49 (8505) 922311 Lehrstuhl Prof. Dr. Donner geier AT forwiss DOT uni-passau DOT de D-94032 Passau http://www.uni-passau.de/~geier/ - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".