www.digitalmars.com         C & C++   DMDScript  

c++ - Problem with DM Build

reply "john russell" <joru ukonline.co.uk> writes:
I am new to DM so I am trying an easy programe.

#include <stdio.h>

int main(void)
{
    printf("This is a short C programme.");

    return 0;

}

This compiles and runs in the DOS command window. However when I run DM it
compiles OK but when I try to build it keeps giving me the following error.


link /NOI /DE /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512
 tst.LNK
Error: c:\dm\lib\SNN.lib(winstart)  : Symbol Undefined _WinMain 16
Errors: 1  Warnings: 0
Build failed

I am running DM on XP. Has anybody got an answer.
Aug 18 2002
parent reply Jan Knepper <jan smartsoft.cc> writes:
Are you using the IDDE?
The problem is you are linking the program as a GUI program which means that
your main entry point would be WinMain, not main!
If you want this to work, you should remove the /ENTRY:WinMainCRTStartup part
from the Link command line. In the IDDE you do this by selecting "Console" as
target.



john russell wrote:

 I am new to DM so I am trying an easy programe.

 #include <stdio.h>

 int main(void)
 {
     printf("This is a short C programme.");

     return 0;

 }

 This compiles and runs in the DOS command window. However when I run DM it
 compiles OK but when I try to build it keeps giving me the following error.

 link /NOI /DE /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512
  tst.LNK
 Error: c:\dm\lib\SNN.lib(winstart)  : Symbol Undefined _WinMain 16
 Errors: 1  Warnings: 0
 Build failed

 I am running DM on XP. Has anybody got an answer.
Aug 18 2002
parent "john russell" <joru ukonline.co.uk> writes:
Thanks it builds now.
"Jan Knepper" <jan smartsoft.cc> wrote in message
news:3D5FC49F.ACDA3512 smartsoft.cc...
 Are you using the IDDE?
 The problem is you are linking the program as a GUI program which means
that
 your main entry point would be WinMain, not main!
 If you want this to work, you should remove the /ENTRY:WinMainCRTStartup
part
 from the Link command line. In the IDDE you do this by selecting "Console"
as
 target.



 john russell wrote:

 I am new to DM so I am trying an easy programe.

 #include <stdio.h>

 int main(void)
 {
     printf("This is a short C programme.");

     return 0;

 }

 This compiles and runs in the DOS command window. However when I run DM
it
 compiles OK but when I try to build it keeps giving me the following
error.
 link /NOI /DE /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304
/A:512
  tst.LNK
 Error: c:\dm\lib\SNN.lib(winstart)  : Symbol Undefined _WinMain 16
 Errors: 1  Warnings: 0
 Build failed

 I am running DM on XP. Has anybody got an answer.
Aug 19 2002