www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Problem with DM Build

↑ ↓ ← "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
↑ ↓ 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
↑ ↓ → "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

 your main entry point would be WinMain, not main!
 If you want this to work, you should remove the /ENTRY:WinMainCRTStartup

 from the Link command line. In the IDDE you do this by selecting "Console"

 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


 compiles OK but when I try to build it keeps giving me the following


 link /NOI /DE /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304


  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