delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/05/04/11:43:05

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199905041541.KAA05524@modi.xraylith.wisc.edu>
X-Authentication-Warning: modi.xraylith.wisc.edu: localhost.xraylith.wisc.edu [127.0.0.1] didn't use HELO protocol
To: "Schaible, Joerg" <Joerg DOT Schaible AT gft DOT de>
cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: Cygwin newbie, first try
In-reply-to: Your message of "Tue, 04 May 1999 17:26:42 +0200."
<C2D7D58DBFE9D111B0480060086E96358D6F84 AT gftmail DOT gft DOT de>
Date: Tue, 04 May 1999 10:41:26 -0500
From: Mumit Khan <khan AT xraylith DOT wisc DOT EDU>

"Schaible, Joerg" <Joerg DOT Schaible AT gft DOT de> writes:
> Hello,
> 
> our development environment contains several applications and DLL's build
> with several compilers under Windows and OS/2. I wanna port this environment
> for a version with cygwin / mingw32 i.e. I don't wanna use the cygwin.dll,
> but the crtdll.dll or msvcrt.dll. To build the system we use a huge number
> of makefiles with individual settings for each compiler package. For
> compilation I use c++ for C++ files and gcc for C files. For linkage I use
> ld. I've installed the cygwin package and the mingw32 available from Mumit
> Khan's home page.
> 
> Currently I try to build one of our little command line tools.
> 
> All the C++ files were compiled using the following options:
> c++ -D_CONSOLE -c -fno-for-scope -frepo -mpentium -D_GwOS_WIN -D_GwGUI_WIN
> -DWIN32 -D_WIN32 -D__WIN32__ -W -Wreturn-type -Wunused -Wwrite-strings
> -Wconversion -Wmissing-prototypes -Woverloaded-virtual -DWINNT -DSTANDALONE
> -I../../core/win -I../../dde -I../../media -I../../meta -I../../base
> -I../../core -I../../device -I../../gm -I../../help -I../../40ctl
> -I../../cua -I../../chart -I../../dynobj -I../../license -I../../inter
> -I../../comm -I../../gwproc -I../../textedit
> -I//c/egcs-1-1-2/i386-mingw32/include -x c++ -DNDEBUG
> -o../../egcs112/rel/depend/st/main.o  main.cxx
> 
> The ld was invoked by the following line:
> ld -Lc:/egcs-1-1-2/i386-mingw32/lib\\  -S
> ..\\..\\egcs112\\rel\\depend\\st\\cppsetup.o
> ..\\..\\egcs112\\rel\\depend\\st\\ifparser.o
> ..\\..\\egcs112\\rel\\depend\\st\\include.o
> ..\\..\\egcs112\\rel\\depend\\st\\main.o
> ..\\..\\egcs112\\rel\\depend\\st\\parse.o
> ..\\..\\egcs112\\rel\\depend\\st\\pr.o -o ..\\..\\egcs112\\bin\\depend.exe
> -Map ..\\..\\egcs112\\bin\\depend.map -lmingw32 -lcrtdll -lmoldname
> 
> But I have unresolved externals:
> ld: warning: cannot find entry symbol _mainCRTStartup; defaulting to
> 00401000
> ..\..\egcs112\rel\depend\st\include.o(.text+0x53d):include.cc: undefined
> reference to `_alloca'
> ..\..\egcs112\rel\depend\st\main.o(.text+0x1352):main.cc: undefined
> reference to `__builtin_vec_new'
> ..\..\egcs112\rel\depend\st\main.o(.text+0x1a81):main.cc: undefined
> reference to `__builtin_vec_delete'

I suggest you either:

1. use gcc/c++ to link, which is always the preferred way, or
2. use gcc/c++ to link with -v option and see what libraries and startup
   files need to be linked in and *then* use ld.

You need -lgcc to get rid of some of the undefined symbols, and perhaps
all of the above.

You're also missing the startup files (crt*.o) and so on. Using "ld" 
without knowing more about the platform specific startups/libraries 
needed is a *very* bad idea.

> 
> Interesting that my source is not using alloca anywhere (checked with the
> preprocessor output) and the missing operator new[] and delete[] seem to
> identify some basic configuration problem. Any idea how to the ld where to
> find the missing symbols?

"alloca" is used by gcc support code, and that's why you need -lgcc.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019