g++
را بنصبیدg++ file.cpp -o outputname -O2
برای اجرای برنامه ./outputname
برای آگاهی بیشتر man g++
خیلی ممنون!
من دکمه تشکر رو پیدا نکردم :oops:
یه سوال دیگه :oops: :oops:
برای کامپایل استادم گفته بود که با GCC باشه من نوشتم gcc filename.c
کامپایل شد البته مسیر هم اشتباه بود که درست کردم
حالا نمیدونم برای اجرا چی کار کنم اونی که شما گفتین هم نشد :(
یه جا خوندم نوشته بود filename/.
برای اجراست ولی نوشت permission denied
chmod +x ./filename
این رو بزنین بعدش اجراش کنین
ممنونم!
این یکی ارور نداد ولی هیچ کاری هم نکرد :(
آخه برنامه باید از کاربر ورودی بگیره! ورودی هم در محیط ترمینال گرفته میشه؟؟ خروجی هم همون جا نوشته میشه؟؟!!! ](*,) ](*,) ](*,) ](*,)
#include<iostream.h>
#include<conio.h>
int main()
{
cout<<"Aliweb";
getch();
return 0;
}
آیا همین طوری میشه کامپایل کرد؟g++: unrecognized option '-02'
404.cpp:1:21: error: iostream.h: No such file or directory
404.cpp:2:18: error: conio.h: No such file or directory
404.cpp: In function ‘int main()’:
404.cpp:5: error: ‘cout’ was not declared in this scope
404.cpp:6: error: ‘getch’ was not declared in this scope
برای من بصورت virtual نصب نیستg++ 404.cpp -o outputname -02
g++ 404.cpp -o outputname -O2
ali@ali-desktop:~/Desktop$ g++ 404.cpp -o outputname -O2
404.cpp:1:21: error: iostream.h: No such file or directory
404.cpp:2:18: error: conio.h: No such file or directory
404.cpp: In function ‘int main()’:
404.cpp:5: error: ‘cout’ was not declared in this scope
404.cpp:6: error: ‘getch’ was not declared in this scope
چیزی باید نصب کنم؟
#include<iostream>
int main(){
using namespace std;
cout<<"Aliweb"<<endl;
return 0;
}
g++ 1.cpp -o output
./output
o -
include<iostream>
#include<math>
using namespace std;
int main()
{
double i,b;
cin>>i;
b=double(pow(i,2));
cout<<b;
return 0;
}
g++ 1.cpp -o output
./output
متن ارور:1.cpp:2:15: error: math: No such file or directory
1.cpp: In function ‘int main()’:
1.cpp:8: error: ‘pow’ was not declared in this scope
http://www.cplusplus.com/doc/tutorial/