www.digitalmars.com         C & C++   DMDScript  

c++ - Cannot build simple Win32 console program

reply "James" <ploppy.powell virgin.net> writes:
What am I doing wrong ??

I'm trying to get started with DM and I can't seem to get a simple win32
console program to build.
I'm using the win32 IDDE.

The .def file:

EXETYPE          NT
SUBSYSTEM        CONSOLE


The code:

#include <iostream.h>
void main ()
{
 cout << "Hello\n";
}


The build output:

Program
Files\dm\bin\sc.EXE -cpp -mn -C -WA -S -5 -a8 -c -gf -otest.objtest.c
Program Files\dm\bin\scpp.EXE -cpp -mn -C -WA -S -5 -a8 -gftest.c -otest.obj
Program Files\dm\bin\link.EXE /CO /NOI /DE /NOPACKF /XN /NT
/ENTRY:WinMainCRTStartup /BAS:4194304 /A:512  modflnm.LNK
Error: C:\PROGRAM FILES\DM\BIN\..\lib\SNN.lib(winstart)  (1231004): Symbol
Undefined _WinMain 16
Lines Processed: 843  Errors: 1  Warnings: 0
Build failed
Aug 09 2002
parent reply Jan Knepper <jan smartsoft.cc> writes:
James wrote:

 What am I doing wrong ??

 Program
 Files\dm\bin\sc.EXE -cpp -mn -C -WA -S -5 -a8 -c -gf -otest.objtest.c
 Program Files\dm\bin\scpp.EXE -cpp -mn -C -WA -S -5 -a8 -gftest.c -otest.obj
 Program Files\dm\bin\link.EXE /CO /NOI /DE /NOPACKF /XN /NT
 /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512  modflnm.LNK
/ENTY:WinMainCRTStartup Remove that and it should be linking. Jan
Aug 09 2002
parent reply "James" <ploppy.powell virgin.net> writes:
How do I do that through the IDDE.

project->settings->build-> ???


"Jan Knepper" <jan smartsoft.cc> wrote in message
news:3D53D9C8.A38202D2 smartsoft.cc...
 James wrote:

 What am I doing wrong ??

 Program
 Files\dm\bin\sc.EXE -cpp -mn -C -WA -S -5 -a8 -c -gf -otest.objtest.c
 Program
Files\dm\bin\scpp.EXE -cpp -mn -C -WA -S -5 -a8 -gftest.c -otest.obj
 Program Files\dm\bin\link.EXE /CO /NOI /DE /NOPACKF /XN /NT
 /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512  modflnm.LNK
/ENTY:WinMainCRTStartup Remove that and it should be linking. Jan
Aug 09 2002
parent reply Jan Knepper <jan smartsoft.cc> writes:
Select "Console" under "Target Type" in the first "Tab" of "Project Settings"

Jan



James wrote:

 How do I do that through the IDDE.

 project->settings->build-> ???

 "Jan Knepper" <jan smartsoft.cc> wrote in message
 news:3D53D9C8.A38202D2 smartsoft.cc...
 James wrote:

 What am I doing wrong ??

 Program
 Files\dm\bin\sc.EXE -cpp -mn -C -WA -S -5 -a8 -c -gf -otest.objtest.c
 Program
Files\dm\bin\scpp.EXE -cpp -mn -C -WA -S -5 -a8 -gftest.c -otest.obj
 Program Files\dm\bin\link.EXE /CO /NOI /DE /NOPACKF /XN /NT
 /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512  modflnm.LNK
/ENTY:WinMainCRTStartup Remove that and it should be linking. Jan
Aug 09 2002
parent "James" <ploppy.powell virgin.net> writes:
Great, it worked !!


"Jan Knepper" <jan smartsoft.cc> wrote in message
news:3D53DCCC.2F6979D5 smartsoft.cc...
 Select "Console" under "Target Type" in the first "Tab" of "Project
Settings"
 Jan



 James wrote:

 How do I do that through the IDDE.

 project->settings->build-> ???

 "Jan Knepper" <jan smartsoft.cc> wrote in message
 news:3D53D9C8.A38202D2 smartsoft.cc...
 James wrote:

 What am I doing wrong ??

 Program
Files\dm\bin\sc.EXE -cpp -mn -C -WA -S -5 -a8 -c -gf -otest.objtest.c
 Program
Files\dm\bin\scpp.EXE -cpp -mn -C -WA -S -5 -a8 -gftest.c -otest.obj
 Program Files\dm\bin\link.EXE /CO /NOI /DE /NOPACKF /XN /NT
 /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512  modflnm.LNK
/ENTY:WinMainCRTStartup Remove that and it should be linking. Jan
Aug 09 2002