Ukwakha ifayela le-EXE

I-EXE ifomethi ayikho isofthiwe engayenza ngaphandle. Ugijima zonke izinqubo zokuqala noma ukufaka izinhlelo. Kungaba isicelo esiphelele, noma sibe yingxenye yayo.

Izindlela zokudala

Kunezinketho ezimbili zokudala ifayela le-EXE. Okokuqala ukusetshenziswa kwendawo yokuhlela, futhi okwesibili ukusetshenziswa kwezifaki ezikhethekile, ngosizo "okuphambene" okuhlukeneyo kanye namaphakheji afakwe ngokuchofoza okukodwa. Ukuqhubeka ngezibonelo sizocubungula kokubili okukhethwa kukho.

Indlela 1: Umphakathi we-Visual Studio

Cabanga ngenqubo yokwakha uhlelo olulula olusekelwe olimini lohlelo. "I-Visual C ++" futhi uyiqoqe ku-Visual Studio Community.

Landa umphakathi wamaVayili we-Visual Studio kusuka kusiza esisemthethweni

  1. Sebenzisa uhlelo lokusebenza, uye kwimenyu "Ifayela"bese uchofoza into "Dala"bese kuluhlu ku "Iprojekthi".
  2. Iwindi ivula "Ukwakha iphrojekthi", lapho udinga ukuchofoza kuqala kule ilebula "Izifanekiso"bese "I-Visual C ++". Okulandelayo, khetha "Isicelo se-Win32 Console", usethe igama nendawo yephrojekthi. Ngokuzenzakalelayo, igcinwa esihlalweni sokusebenza se-Visual Studio Community, kufolda yesistimu Amadokhumenti amikodwa kungenzeka ukhethe olunye uhla lwemibhalo uma lufiswa. Lapho uqedile izilungiselelo, chofoza "Kulungile".
  3. Iqala "Win32 Isicelo Ukucushwa Wizard"lapho sithinta khona nje "Okulandelayo".
  4. Ewindini elilandelayo sichaza imingcele yesicelo. Ngokuyinhloko, sikhetha "Isicelo sekhonsoli"futhi ensimini "Izinketho ezithuthukisiwe" - "Uhlelo olungenalutho"ngokungahlolisisi ibhokisi elinalo "Isihloko Esihlosiwe".
  5. Iphrojekthi lapho kudingeka khona ukwengeza indawo yokubhala ikhodi iqalwa. Ukwenza lokhu kuthebhu "Solution Explorer" Chofoza inkinobho yegundane kwesokudla ekubhalweni "Amafayela Ezinsiza". Imenyu yenkathi ibonakala lapho sichofoza ngokulandelana ngokulandelana "Engeza" futhi Dala Item.
  6. Ewindini evuliwe "Engeza into entsha" khetha into "Faka i-C ++". Okulandelayo, sibeka igama lefayela ukuze ikhodi yesicelo esizayo kanye nokwandiswa kwayo ".C". Ukushintsha ifolda yokugcina, chofoza "Buyekeza".
  7. Isiphequluli sivula, lapho sichaza khona indawo bese uchofoza "Khetha ifolda".
  8. Ngenxa yalokho, ithebhu ibonakala ngesihloko. "Umthombo, lapho kukhona ikhodi yokuhlela neyombhalo.
  9. Okulandelayo, udinga ukukopisha umbhalo wekhodi bese uyinamathisela endaweni eboniswe esithombeni. Isibonelo, thatha okulandelayo:
  10. # hlanganisa
    # hlanganisa

    int main (int argc, char * ingxoxo []) {
    printf ("Sawubona, World!");
    _getch ();
    buyisela 0;
    }

    Qaphela: Ikhodi engenhla isibonelo kuphela. Esikhundleni salokho, kumele usebenzise ikhodi yakho ukuze udale uhlelo ku-"Visual C ++".

  11. Ukwakha iphrojekthi uchofoze "Qala ukulungisa iphutha" kwimenyu yokudonsela phansi Ukuhlukumeza. Ungacindezela ukhiye "F5".
  12. Khona-ke isaziso sidlulisa isixwayiso sokuthi iphrojekthi yamanje iphelelwe yisikhathi. Lapha udinga ukuchofoza "Yebo".
  13. Lapho sekuqedile ukuhlanganiswa, isicelo sibonisa iwindi lekhonsoli lapho lizobhalwa khona "Sawubona, World!".
  14. Ifayela elidaliwe kufomethi ye-EXE lingabonwa besebenzisa i-Windows Explorer kufolda yephrojekthi.

Indlela 2: Abafaki

Ukuze uguqule inqubo yokufaka isofthiwe, okuthiwa ama-installer athola ukuthandwa ngokubanzi. Ngosizo lwabo, isofthiwe idalwe, umsebenzi oyinhloko wokwenza kube lula inqubo yokuthunyelwa kwesofthiwe kwikhompyutha. Cabanga ngenqubo yokwakha ifayela le-EXE kusibonelo se-Smart Install Maker.

Landa i-Smart Install Maker kusukela kusayithi elisemthethweni.

  1. Qalisa uhlelo futhi kuthebhu "Ulwazi" hlela igama lesicelo esizayo. Ensimini Londoloza njenge chofoza kufolda ifolda ukucacisa indawo lapho ifayela lokukhipha lizogcinwa khona.
  2. I-Explorer ivula lapho ukhetha indawo oyifunayo bese uchofoza "Gcina".
  3. Iya kuthebhu "Amafayela"lapho udinga ukwengeza amafayela lapho iphakethe lizohlanganiswa khona. Lokhu kwenziwa ngokuchofoza isithonjana. «+» phansi kwe-interface. Kungenzeka futhi ukwengeza isiqondisi sonke, okudingayo ukuthi uchofoze kusithonjana, esibonisa ifolda ene-plus.
  4. Okulandelayo, iwindi lokukhetha ifayela livula, lapho udinga ukuchofoza kwisithonjana ngendlela ifolda.
  5. Esikhathini isiphequluli sivula, thina uphawu isicelo oyifunayo (kithi, lokhu "Isifufula", ungaba nanoma yini enye) bese uchofoza "Vula".
  6. Ngenxa yalokho, efasiteleni "Engeza ukungena" Ifayela likhonjiswa libonisa indawo yalo. Izinketho ezisele zishiywa ngokuzenzakalelayo bese uchofoza "Kulungile".
  7. Inqubo yokwengeza into yokuqala kuhlelo lokusebenza iyenzeka futhi ukungena okuhambisanayo kubonakala endaweni ekhethekile yesofthiwe.
  8. Okulandelayo, chofoza "Izimfuneko" futhi ithebhu ivula lapho udinga ukubhala uhlu lwezinhlelo zokusebenza zokusekelwa. Sishiya uphawu emasimini "I-Windows XP" futhi konke okuya ngezansi kwakhe. Kuzo zonke ezinye izinkambu, shiya amanani anconyiwe.
  9. Bese uvule ithebhu "Izingxoxo"ngokuchofoza amazwibela afanayo ohlangothini lwesobunxele lwe-interface. Lapha sishiya konke ngokuzenzakalelayo. Ukuze ukufakwa kwenzeke ngemuva, ungabheka ibhokisi "Ukufakwa okufihliwe".

  10. Ngemuva kokuthi zonke izilungiselelo ziqediwe, siqala ukuhlanganiswa ngokuchofoza isithonjana ngomcibisholo ophansi.
  11. Inqubo ecacisiwe yenzeka futhi isimo sayo samanje siboniswa efasiteleni. Emva kokuhlanganiswa kuqedile, ungahlola iphakethe elidaliwe noma uvale iwindi ngokuchofoza izinkinobho ezifanele.
  12. Isofthiwe ehlanganisiwe ingatholakala ngokusebenzisa i-Windows Explorer kufolda ecacisiwe ngesikhathi sokusetha.

Ngakho-ke, kulesi sihloko, sithole ukuthi ifayela le-EXE lingadalwa ngokusebenzisa izindawo ezikhethekile zokuthuthukiswa kwesofthiwe, njenge-Visual Studio Community, kanye nezifaki ezikhethekile, njenge-Smart Install Maker.