בעייה ב++VC

בעייה ב++VC

הקוד הבא לא עובד ב++Visual C, אבל כן עובד ב++Dev-C. למה ומדוע?
#include <string> #include <iostream> #include <fstream> using namespace std; int main(){ ifstream istr("C:\\Program Files\\eMule\\onlinesig.dat"); string str; while(getline(istr, str)) cout << str << endl; return 0; }​
 

ברנדל

New member
שמת את זה ?

#include "stdafx.h"​
כי יכול להיות שהגדרות הפרויקט שלך מחייבות את זה בדוק!
 

gilad_no

New member
למה לא עובד?

לא מתקמפל? לא רץ? ניסית לדבג? תן יותר מידע על הבעיה.
 
../images/Emo26.gif

זה כן מתקמפל, עם 0 שגיאות ואזהרות. הבעייה היא בBuild, שנותן לי שתי שגיאות:
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/emule.exe : fatal error LNK1120: 1 unresolved externals​
 

ברנדל

New member
זה כי לא פתחת פרויקט מתאים

אתה צריך לפתוח פרויקט של win32 console application ולא של win32 application
 

gilad_no

New member
נקודת הכניסה

ביישום חלונות זה WINMAIN וביישום CONSOLE זה MAIN.
 
למעלה