delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/04/16/16:03:21

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: <199904162101.QAA26271@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: "Vincent P. LaBella" <vlabella AT comp DOT uark DOT edu>
cc: Cygwin List <gnu-win32 AT cygnus DOT com>,
"Bruce E. Wampler" <bruce AT objectcentral DOT com>
Subject: Re: VGUI v 1.21 problem
In-reply-to: Your message of "Fri, 16 Apr 1999 12:35:14 CDT."
<Pine DOT SOL DOT 3 DOT 95 DOT 990416123118 DOT 5280B-100000 AT comp>
Date: Fri, 16 Apr 1999 16:01:24 -0500
From: Mumit Khan <khan AT xraylith DOT wisc DOT EDU>

"Vincent P. LaBella" <vlabella AT comp DOT uark DOT edu> writes:
> Hello,
> 	I'm trying to compile the V C++ GUI library version 1.21.  I
> dowloaded both the full package v-1.21.tar.gz  and the latest fix
> v121bfix.zip.
> 
> They compile fine but I get the error:
> 
> /home/noer/src/b20/comp-tools/devo/winsup/libcmain.cc:38: undefined
> reference to
>  `WinMain AT 16'
> collect2: ld returned 1 exit status
> 
> when It tries to build the executable.  I emailed the V people and they
> said this should be fixed.  I tried deleteing and reinstalling everything,
> but I still get the same problem.  Anyone else have this problem and know
> a workaround? 

Yes, Bruce had sent me a bug report. The problem is that V is putting
WinMain in a library, and the linker is not picking it up since there
is no references to it yet (if it were "main" however, ld would pick it
up). The problem will be trivially solved if we add a new entry point
for windows subsystem, ie., when -mwindows is used.

Until we fix it in the dev tools, here's the trivial fix (there is also
a bug in the CfgCyg.mk or whatever it's called):

Replace the LIBS in the following section:

  #---------------------------------------------------------------------
  # Architecture independent
  #---------------------------------------------------------------------
  INCDIR  =       -I$(HOMEV)/includew -I$(HOMEV)/gnuwin32/include
  LIBDIR  =       -L$(LibDir)
  LIBNAME =       libV
  V1NAME  =       v1
  LIBS    =       -lV -lcomctl32 -mwindows

With

  LIBS    =       -Wl,-u,_WinMain AT 16 -lV -lcomctl32 -mwindows

And, also add -DWIN32 to compiler flags, which is needed by the OpenGL
headers (or fix the OpenGL headers to use the correct macro -- _WIN32):

from

  #---------------------------------------------------------------------
  # C/C++ compile options
  #---------------------------------------------------------------------
  CFLAGS  += $(INCDIR)
  ifeq ($(DEBUG),no)
  CFLAGS  +=      -O2 -D_WIN32
  endif
  ifeq ($(DEBUG),yes) 
  CFLAGS  +=      -g -D_WIN32
  endif
  ifeq ($(DEVEL),yes)
  CFLAGS  +=      -DDEVEL
  endif

To,

  #---------------------------------------------------------------------
  # C/C++ compile options
  #---------------------------------------------------------------------
  CFLAGS  += $(INCDIR)
  ifeq ($(DEBUG),no)
  CFLAGS  +=      -O2 -D_WIN32 -DWIN32
  endif
  ifeq ($(DEBUG),yes) 
  CFLAGS  +=      -g -D_WIN32 -DWIN32
  endif
  ifeq ($(DEVEL),yes)
  CFLAGS  +=      -DDEVEL
  endif

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