delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/01/22:53:02

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Reply-To: Cygwin List <cygwin AT cygwin DOT com>
Message-Id: <6.1.0.6.0.20040601223829.03284470@pop.theworld.com>
X-Sender:
Date: Tue, 01 Jun 2004 22:46:52 -0400
To: Clive Levinson <clivel AT bundu DOT com>, cygwin AT cygwin DOT com
From: Larry Hall <cygwin-lh AT cygwin DOT com>
Subject: Re: gcc Unicode and _WinMain AT 16
In-Reply-To: <4.3.2.7.2.20040601000627.018162d8@popmail.compuserve.com>
References: <4 DOT 3 DOT 2 DOT 7 DOT 2 DOT 20040601000627 DOT 018162d8 AT popmail DOT compuserve DOT com>
Mime-Version: 1.0

At 03:17 AM 6/1/2004, you wrote:
>Hi,
>I have a simple Windows app that I am building using gcc:
>
>gcc -c -Wall -mno-cygwin  app.cpp -o app.o
>windres -i resource.rc -o resource.o
>gcc  -Wall -mno-cygwin app.o -o app.exe resource.o -s -mwindows
>
>The app entry is:
>int WINAPI WinMain(HINSTANCE instance,HINSTANCE prevInstance,LPTSTR cmdLine,int cmdShow)
>
>This compiles,builds, and executes fine.
>
>However, I need to build a Unicode version of the app. The only change I made
>was to define UNICODE & _UNICODE before including windows.h. It compiles, but
>when linking I get the error:
>main.c: undefined reference to `_WinMain AT 16'
>
>If anyone can please help, it would be most appreciated.


This is really a question for the MinGW list at mingw.org.  You're using
the -mno-cygwin switch to gcc which means you're not using Cygwin.  By
definition, this fact makes the question off-topic for this list.  If 
you google around a bit though, you'll probably find out why you get this
problem.  Setting UNICODE changes the provided entry point to
wWinMainCRTStartup.  You'll need to specify this entry point explicitly 
in your link line to get it to build properly.



--
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746                     


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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