انجمن کاربران لینوکس ایران - تکنوتاکس سابق
کامپايل کد c++ - نسخه قابل چاپ

+- انجمن کاربران لینوکس ایران - تکنوتاکس سابق (https://forum.sito.ir)
+-- انجمن: پرسش‌ها و پاسخ‌ها (https://forum.sito.ir/forumdisplay.php?fid=3)
+--- انجمن: توزیع‌های لینوکس (https://forum.sito.ir/forumdisplay.php?fid=12)
+--- موضوع: کامپايل کد c++ (/showthread.php?tid=13821)



کامپايل کد c++ - مهمان - 2008-09-28

من ميخواستم تو فدورا 9 با دستور
g++ "path of inpuut file" -o "name"
يه کد c++ رو کامپايل کنم ولی بهم چند تا error ميده در صورتی که تيک development رو هنگان نصب لينوکس زده بودم
ميخوام بدونم مشکل چيه؟


پاسخ: کامپايل کد c++ - مهمان - 2008-09-28

error رو يادم رفت بزارم:

filename.c: 1: error: expected '=' , ',' ';' , 'asm' or ' __attribute__ ' before 'name space'
filename.c: In function 'main'
;
filename.c: 4: error: 'cout' undeclared (first use in this function)
filename.c: 4: error: (Each undeclared identifire is reported only once
filnename.c: 4: error: for each function it appears in.)
filname.c: 3 warning return type of 'main' is not 'int'


- shahab_sh - 2008-09-28

خوب برنامه ای که نوشتید به علاوه ی دستوری که برای کامپایل زدید رو بذارید تا ببینیم مشکل چیه Smile


- مهمان - 2008-09-28

using namespace std;
void main()
{
cout<<"hello";
}


- مهمان - 2008-09-29

ااول برنامه ات اینو بنویس
کد :
#include <iostream>



- مهمان - 2008-09-29

xxx.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘namespace’
xxx.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token


- مهمان - 2008-11-06

Anonymous نویسنده :xxx.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘namespace’
xxx.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&lt;’ token
nakheiram baiad benevise #include <iostream.h> vagarna bazam error mide!


- مهمان - 2008-11-06

nakheir baiad benivise #incude <iostream.h> vagarna bazam error mide!Big Grin


- مهمان - 2008-11-07

اشتباه می کنی. در صورتی که از using name space str; استفاده کنی نیازی به h. نیست.


- مهمان - 2008-11-07

ببخشید using name space std