Re: gcc Unicode and _WinMain@16

2004-06-03 Thread Larry Hall
At 01:32 PM 6/3/2004, you wrote:
>I have eventually identified the problem, the original
>app was written for the Pocket PC, which is only Unicode:
>
>int WINAPI WinMain(HINSTANCE inst,HINSTANCE prev,LPTSTR cmd,int show )
>
>notice that it uses an LPTSTR for the cmd parameter.
>
>When I defined UNICODE for the desktop app, I copied this, however the
>desktop app requires this parameter to always be an LPSTR whether UNICODE
>is defined or not.

Ouch!  

That would not have been my first guess at the cause of the problem. ;-)


--
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/



Re: gcc Unicode and _WinMain@16

2004-06-03 Thread Clive Levinson
I have eventually identified the problem, the original
app was written for the Pocket PC, which is only Unicode:
int WINAPI WinMain(HINSTANCE inst,HINSTANCE prev,LPTSTR cmd,int show )
notice that it uses an LPTSTR for the cmd parameter.
When I defined UNICODE for the desktop app, I copied this, however the
desktop app requires this parameter to always be an LPSTR whether UNICODE
is defined or not.
Thanks for the assistance,
Clive
 

--
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/


Re: gcc Unicode and _WinMain@16

2004-06-03 Thread Larry Hall
At 12:45 PM 6/3/2004, you wrote:
>Hi Larry,
>
>
>>You don't need to cc me.  I set my reply-to to the list because that's
>>where I like to read any replies.
>
>Sorry about that.
>
>>If you can send a simple, small example to the list, I'll see if I can
>>find some time to try to investigate your problem.
>
>Thanks for the offer, I eventually created a simple Win app, just
>one line to display a message box, to send as an example. This
>however builds fine, so I must be doing something stupid. I will
>experiment some more.


Ah, very telling.  Glad I asked for an example rather than trying to
reproduce it myself. ;-) 

Good luck,


--
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/



Re: gcc Unicode and _WinMain@16

2004-06-03 Thread Clive Levinson
Hi Larry,

You don't need to cc me.  I set my reply-to to the list because that's
where I like to read any replies.
Sorry about that.
If you can send a simple, small example to the list, I'll see if I can
find some time to try to investigate your problem.
Thanks for the offer, I eventually created a simple Win app, just
one line to display a message box, to send as an example. This
however builds fine, so I must be doing something stupid. I will
experiment some more.
Regards,
Clive
--
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/


Re: gcc Unicode and _WinMain@16

2004-06-02 Thread Larry Hall
At 12:26 PM 6/2/2004, you wrote:
>At 22:46 01/06/2004 -0400, Larry Hall wrote:
>
>>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.
>
>Hi Larry,
>Thanks for the reply, unfortunately -mno-cygwin seems to be a bit
>of a step child, the MinGW group considers it a Cygwin topic, and the
>Cygwin group considers it a MinGW topic.
>
>I did spend a fair bit of time using google, before posting to the group,
>unfortunately I was unable to find an answer, other than realising that I
>would need to change the entry point. I have tried various entry points:
>-e _wWinMainCRTStartup
>-e wWinMainCRTStartup
>-e WinMainCRTStartup
>etc.
>All of these give the error :  "cannot find entry symbol .." as well
>as the undefined reference to [EMAIL PROTECTED]' error.
>Using
>-e _WinMainCRTStartup
>I don't get the "cannot find entry symbol ...", but still get the undefined
>reference to [EMAIL PROTECTED]
>I have pretty much exhausted all the search terms I can think of in google,
>so any help would be appreciated.


You don't need to cc me.  I set my reply-to to the list because that's 
where I like to read any replies.

If you can send a simple, small example to the list, I'll see if I can
find some time to try to investigate your problem. 



--
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/



RE: gcc Unicode and _WinMain@16

2004-06-02 Thread Dave Korn
> -Original Message-
> From: cygwin-owner  On Behalf Of Clive Levinson
> Sent: 01 June 2004 08:17

> 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. 

  I thought it was only necessary to define UNICODE.  _UNICODE seems like it
ought to be a compiler-internals sort of thing.  (ANSI reserves all
identifiers beginning with _ for the compiler/library's internal use)

> It compiles, but
> when linking I get the error:
> main.c: undefined reference to [EMAIL PROTECTED]'

  I notice you're using gcc to both compile and link your C++ file.  Does
using g++ instead of gcc for both stages help any?

cheers, 
  DaveK
-- 
Can't think of a witty .sigline today
 



--
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/



Re: gcc Unicode and _WinMain@16

2004-06-02 Thread Clive Levinson
At 22:46 01/06/2004 -0400, Larry Hall wrote:
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.
Hi Larry,
Thanks for the reply, unfortunately -mno-cygwin seems to be a bit
of a step child, the MinGW group considers it a Cygwin topic, and the
Cygwin group considers it a MinGW topic.
I did spend a fair bit of time using google, before posting to the group,
unfortunately I was unable to find an answer, other than realising that I
would need to change the entry point. I have tried various entry points:
-e _wWinMainCRTStartup
-e wWinMainCRTStartup
-e WinMainCRTStartup
etc.
All of these give the error :  "cannot find entry symbol .." as well
as the undefined reference to [EMAIL PROTECTED]' error.
Using
-e _WinMainCRTStartup
I don't get the "cannot find entry symbol ...", but still get the undefined
reference to [EMAIL PROTECTED]
I have pretty much exhausted all the search terms I can think of in google,
so any help would be appreciated.
Regards,
Clive
--
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/


Re: gcc Unicode and _WinMain@16

2004-06-01 Thread Larry Hall
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 [EMAIL PROTECTED]'
>
>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/