当前位置:网站首页>Package C language files into exe executable programs
Package C language files into exe executable programs
2022-07-18 18:00:00 【Lan Zhou Qianfan】
How to write c The language program is packaged into exe Executable files ? In the past, many of our programs were written in editors , Let's edit, compile and run our program . If you want to package it into exe What should the executable do ?
I recommend using codeBlocks Of gcc command , Because it's easier . image vs This editor is like a dragon slaying knife . The function is too complex , There are many things to pay attention to . How to apply codeBlock Of gcc Orders ?
Let's meet gcc What is the order ?gcc Include c and c++ compiler gcc and cc It's the same ,c++ and g++ It's the same , commonly c The program uses gcc compile ,c++ The program uses g++ compile . We use it gcc Command to compile our c Language program .
gcc Usage of
gcc test.c This will compile a file called a.out The program gcc test.c -o test This will compile a file called test The program -o Parameter is used to specify the name of the generator We usually use this gcc text.c -o text command . text.c Represents what you want to do c Language file ,-o The following represents what you want to generate exe The name of . That's all we need to know . So where are we looking for gcc Orders ?
1: open codeBlocks The location of the file where the editor is located We right-click on the... On the desktop codeblocks Icon , Click to open the file .
2: We are now entering MinGW In this document .
3: We enter bin Catalog
4 We enter bin After the directory, you can find gcc.exe. Let's assign this bin Path to directory 5 Let's right-click on this computer , Click properties
6 Let's click Advanced System Settings
7: Let's click on the environment variable
8: I select the following system variable path. We turn it on Click New , Then copy our bin Add the path of the directory to it .
9: Then click OK and we exit . 10:win+R Open the run window , Input cmd Open the terminal .
11: We enter d After the disk, enter the directory just now ,
12: Let's write a c file , A simple practical Notepad is OK . Then name it .c. Be careful : as follows , We are return 0; And before getchar(); To prevent generation exe File flashback .
13: We continue to enter the following command
14: Let's open that directory to see , There will be one. exe file .
15: Right here in my c Below the file . We can drag it out , Or drag it to the desktop , Open it directly . Let's see
This is what we generated exe The effect of the document . Of course, we can write more c Language file , And then pack it up . After packaging exe Once the file is opened, the program is executed .
Welcome ape friends to visit and leave a message . Please observe the relevant csdn agreement -------jgdabc
边栏推荐
- Export data with navicatpremium
- balanced binary tree
- 用NavicatPremium导出数据
- 许久未见,我又回来啦
- log4j日志配置
- 2022 simulated 100 questions and simulated examination for the main principals of hazardous chemical business units
- The simple solution the boss wants vs. the needs the programmer understands | cartoon
- NoSQLAttack工具安装与使用问题解决
- Which vite plug-ins can quickly provide development efficiency
- 27-Scala入门、基本数据类型和方法与函数的介绍
猜你喜欢

Multitree -- > b tree and b+ tree

Lime of Py: a detailed introduction to the introduction, installation and use of the lime Library

2022 simulated 100 questions and simulated examination for the main principals of hazardous chemical business units

How to adjust and set win11 color temperature

Flink1.7 from installation to experience

【论文笔记】—特征可视化—ZFNet—2014-ECCV

ECCV 2022 | 适用于分类,检测,分割的生成式知识蒸馏开源

SAP Fiori Launchpad 上看不到任何 tile 应该怎么办?

京东金融,你到底是坏,还是码农裁多了??

UOS安装MariaDB
随机推荐
Tianyi beyond has a pre-sale of 157700 from the reform, and gross Innovation: the product power is absolutely in the first camp
(手工)【sqli-labs46、47】order by 注入、报错回显、POST注入、数字/字符型
Stream流使用
Principle and application of vulnerability scanning
Method to delete all child nodes of an element
【Renesas RA6M4开发板之I2C读取BMP180气压温度】
Win11色温如何进行调整设置
【优先队列(堆)】二项队列类模板的实现
网络爬虫爬取三国演义所有章节的标题和内容(BeautifulSoup解析)
【排序】插入排序、希尔排序和堆排序
V831 - apriltag tag identification
Setting method of win11 filtering error log
2022 P gas cylinder filling examination questions and simulation examination
Find prime number
Introduction to replacement technology of SAP ABAP CDs view view
墨者学院刷题笔记——SQL手工注入漏洞测试(MongoDB数据库)
UOS installation MariaDB
uniapp微信小程序 选择聊天记录文件上传
深度学习小记 - 正则化,优化器,线性回归,逻辑斯蒂回归
软件测试面试题集锦--持续汇总更新