အရင္ဦးဆံုး gedit plugin ျဖစ္တဲ႔ External Tools ကို Activate လုပ္ရေအာင္ ..
gedit ကိုဖြင္႔ပါ .. Edit > Preferences ကို သြားပါ .. gedit Preferences Window ေလးေပၚလာ မယ္ .. Plugins Tab ကို ဆက္သြားမယ္ .. အဲဒီမွာ External Tools plugin ကို check box မွာ mark လုပ္ေပးၿပီး Activate လုပ္ေပးပါ [see:fig-1] ..
[caption id="attachment_122" align="alignnone" width="480" caption="Figure 1"]

ၿပီးရင္ gedit > Tools > External Tools ကိုဖြင္႔ပါ .. External Tools Manager Window [see:fig.3] ေလးေပၚလာမယ္ .. အဲဒီမွာ Tools အသစ္ႏွစ္ခုကို New buttom ေလးသံုးၿပီးေတာ႔ ထည့္ေပးရေအာင္ .. ပထမတစ္ခုကို "Compile C++" ႏွင္႔ ေနာက္တစ္ခုကိုက်ေတာ႔ "Run C++" လို႔နာမည္ေပးရေအာင္ .. ဒါေပမယ္႔ အဆင္ေျပသလို နာမည္ေပးႏိုင္ပါတယ္ .. အဓိကကေတာ႔ ကိုယ္သိဖို႔ပါပဲ [see:fig-2] ..
[caption id="attachment_123" align="alignnone" width="480" caption="Figure 2"]

Compile C++ အတြက္ျဖည့္ရမယ္႔ ဟာေတြကေတာ႔ ..
Description: Compile C++ by using g++
Accelerator: F5
Command(s): g++ $GEDIT_CURRENT_DOCUMENT_NAME -o ${GEDIT_CURRENT_DOCUMENT_NAME%.*}
Input: Nothing
Output: Insert in output panel
Applicability: All documents
Run C++ အတြက္ျဖည့္ရမွာကေတာ႔ ..
Description: Run C++
Accelerator: F6
Command(s): ./${GEDIT_CURRENT_DOCUMENT_NAME%.*}
Input: Nothing
Output: Insert in output panel
Applicability: All documents
အဲလိုျဖည့္ေပးလိုက္တဲ႔အတြက္ gedit မွာ C++ source code ကို view ၾကည့္ရာကေန F5 ႏွိပ္ေပးလိုက္ရင္ g++ က အဲဒီ source file ကို compile လုပ္ေပးၿပီး F6 ကို ႏွိပ္လိုက္ရင္ shell က execute လုပ္ေပးပါလိမ္႔မယ္။ ဒါမွမဟုတ္လဲ gedit > Tools ကိုသြားၿပီး dropdown menu ကေန Compile C++ နဲ႔ Run C++ တို႔ကို သံုးႏိုင္ပါတယ္။
Compiling C++ souce file
[caption id="attachment_124" align="alignnone" width="480" caption="Figure 3"]

Executing C++ program
[caption id="attachment_125" align="alignnone" width="480" caption="Figure 4"]

အကယ္၍ Terminal ထဲမွာပဲ compile && execute လုပ္ခ်င္လ်င္ေတာ႔ ..
$ g++ -o Sample Sample.cpp
$ ./Sample
Sample ဆိုတာက compile လုပ္ၿပီးရလာမယ္႔ output file (program) ပါ၊ Sample.cpp ကေတာ႔ input file (c++ source file) ပါ။ စတင္မယ္႔သူမ်ား အစျပဳႏိုင္ၿပီလို႔ ေမွ်ာ္လင္႔ပါတယ္ .. :-)
No comments:
Post a Comment