2012/4/1 rajeshwari b <[email protected]>

> Hi all,
> I ran the command  "gdb hello.exe" , but the same error. So am attaching
> the makefile for 64 bit build. Kindly let me know if anything specific need
> to be done.
>

Hold on. I reinspected the makefile you previously sent and the makefile
rule doesn't use the LDFLAGS or CFLAGS you previously set. You need
something like this:

CC=gcc
CFLAGS=-m32
CPPFLAGS=-m32
LDFLAGS=-m32
hello: hello.c
    gcc $CPPFLAGS $CFLAGS $LDFLAGS -o hello hello.c

and a seperate rule for the object file would allow you to seperate the
CFLAGS and LDFLAGS if you add more options.

To check if what I'm saying makes sense. Try running
gcc -m32 -o hello hello.c

from the commandline and see if that program works without the error.

Ruben




> Rgds,
> Raj007
>
>
>
> On Sun, Apr 1, 2012 at 5:53 PM, Ruben Van Boxem 
> <[email protected]>wrote:
>
>> 2012/4/1 rajeshwari b <[email protected]>
>>
>>> Hi all,
>>> I compiled the hello.c code in TDM-GCC (GCC 4.6, MINGW-w64 64/32bit). I
>>> could create the hello.exe but could not run the exe. I am getting the
>>> message "hello.exe is not valid win32 application". I am using windows XP,
>>> SP3 with i686 processor (i.e., x86 family 6model 32 stepping 10 genuine
>>> Intel ~2992MHz).Am attaching the code and makefile. Pl help.
>>>
>>
>> I see you are compiling with "-m32". Unfortunately I cannot seem to
>> reproduce (on a 64-bit Windows, that is). Dependency walker (x86) shows it
>> depends on 32-bit DLLs and MSYS' "file" command says it is a 32-bit PE file.
>>
>> I'm sorry to say I have no idea why it wouldn't work. Can you try running
>> the program through gdb as follows?
>> gdb hello.exe
>> run
>>
>> Thanks,
>>
>> Ruben
>>
>>
>>
>>> Rgds,
>>> Raj007
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> This SF email is sponsosred by:
>>> Try Windows Azure free for 90 days Click Here
>>> http://p.sf.net/sfu/sfd2d-msazure
>>> _______________________________________________
>>> Mingw-w64-public mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>> http://p.sf.net/sfu/sfd2d-msazure
>> _______________________________________________
>> Mingw-w64-public mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>>
>>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to