GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Feb-2005, 06:05
Lamefif01 Lamefif01 is offline
New Member
 
Join Date: Feb 2005
Posts: 2
Lamefif01 is on a distinguished road

getting started


hi all

im using vc++ and im trying to learn mfc but i'm just not going anywhere at the moment. iv selected the use shared dill mfc option also turned precompiled headers option off.

CPP / C++ / C Code:
<<<<<<<<<<<<<<code>>>>>>>>>>>>>>>
//hello.cpp
#include

// Declare the application class
class CHelloApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};

// Create an instance of the application class
CHelloApp HelloApp;

// Declare the main window class
class CHelloWindow : public CFrameWnd
{
CStatic* cs;
public:
CHelloWindow();
};

// The InitInstance function is called each
// time the application first executes.
BOOL CHelloApp::InitInstance()
{
m_pMainWnd = new CHelloWindow();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}


// The constructor for the window class
CHelloWindow::CHelloWindow()
{
// Create the window itself
Create(NULL,
"Hello World!",
WS_OVERLAPPEDWINDOW,
CRect(0,0,200,200));
// Create a static label
cs = new CStatic();
cs->Create("hello world",
WS_CHILD|WS_VISIBLE|SS_CENTER,
CRect(50,80,150,150),
this);
}

<<<<<<<<<<<<<<<<< error >>>>>>>>>>>>>>>>>>>>>>>>>
mfc002 error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
mfc002 fatal error LNK1120: 1 unresolved externals



<<<<<<<<<<<<<<<<<<<<<<Liner log>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
------ Build started: Project: mfc002, Configuration: Debug Win32 ------

Linking...
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
Debug/mfc002.exe : fatal error LNK1120: 1 unresolved externals

Build log was saved at "file://c:\Documents and Settings\Leonardo\My Documents\Visual Studio Projects\mfc002\Debug\BuildLog.htm"
mfc002 - 2 error(s), 0 warning(s)

THANX
Last edited by LuciWiz : 02-Feb-2005 at 06:15. Reason: Please insert your C++ code between [c++] & [/c++] tags
  #2  
Old 02-Feb-2005, 07:30
Lamefif01 Lamefif01 is offline
New Member
 
Join Date: Feb 2005
Posts: 2
Lamefif01 is on a distinguished road
yea i head to change project settings for the Linker and change the Subsystem
from Console to Windows (/subsystem:console for /subsystem:windows).

but im getting this naw
-------------------------------------
mfc002.exe': Loaded 'C:\Documents and Settings\Leonardo\My Documents\Visual Studio Projects\mfc002\Debug\mfc002.exe', Symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\msvcr71d.dll', Symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\mfc71d.dll', Symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', No symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
'mfc002.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', No symbols
----------------------------------
ANY IDEAS
  #3  
Old 03-Feb-2005, 10:40
mingcosp mingcosp is offline
New Member
 
Join Date: Jan 2005
Posts: 14
mingcosp will become famous soon enough
Are you sure you were using the proper development environment??

error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup

This seems to me that you have created a console application rather than Windows application
  #4  
Old 03-Feb-2005, 12:33
aie0 aie0 is offline
Member
 
Join Date: Dec 2004
Posts: 246
aie0 is a jewel in the roughaie0 is a jewel in the rough
Is stdafx.h included?
  #5  
Old 10-Feb-2005, 23:15
pavan pavan is offline
New Member
 
Join Date: Feb 2005
Location: Mumbai
Posts: 2
pavan is on a distinguished road

hi need help regarding PCH directive


How can I disable the option for Pre compiled Header directive ..??
when i am adding some source files to the existing MFC App wizard exe, its giving an error
"unexpeected end of file while looking for pre compiled header directive"

How can i avoid that ?????
 
 

Recent GIDBlogHalfway done! by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Athlon system locking up on start up. Is it MoBo, Processor, PSU or what? ebolaosu Computer Hardware Forum 8 26-Feb-2004 11:19
Our very special offers started!! abc5net Web Hosting Advertisements & Offers 0 15-Jul-2003 11:24
Googledance has started jrobbio Search Engine Optimization Forum 10 25-Mar-2003 10:20
SEO's read this! jrobbio Search Engine Optimization Forum 3 02-Feb-2003 20:11

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 18:10.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.