当前位置:网站首页>1215_ Hello world used by scons
1215_ Hello world used by scons
2022-04-23 02:36:00 【grey_ csdn】
All learning summary : https://github.com/GreyZhang/g_SCons
Try to understand earlier SCons When , With the help of seeing FAQ I have constructed a according to my own understanding hello world Routine for . Why add another one this time ? Because this time I see what is mentioned in the document “ The orthodox ” The way . I've tried the routine , Just take this opportunity to analyze SCons Several default behaviors .
The code example is still very simple , Use C Language of a file can .

The configuration file used this time is no longer a python Program files , But a simple configuration file without suffix . Above hello.c Create in the directory where the file is located SConstruct file , Add the following configuration information :

such , You have implemented a waiting to run build The environment . First , Try to Windows Running in the system :

This operation failed , Tip: the relevant build tool cannot be found . It can be seen here , stay windows The compiler suite that tools on the platform are looking for by default is actually Microsoft's VS. With learning before makefile The experience of , This let me know that this process is linux It may be simpler . such , Transfer to WSL Medium test . Default installed scons The versions are not the same , But the basic routine operation should not affect .

Switch to the WSL in , The default example is built successfully . After compiling , The running program also runs successfully . From the prompt above , differ makefile By default, it looks for cc As the default compiler .scons stay linux below , It seems that the default behavior is to use gcc. I think this is also a good choice , Although now gcc Not necessarily the best compiler , But it is definitely one of the most widely used compilers .
This routine is not the same effect as what I tossed around , The parameters used are also different . About windows The reason for failure in the environment is also very clear , install VS Provide default compiler selection or modify environment variables $CC. No modification , If you do this, you will have the same effect as before .
The code involved :
hello.c
#include "stdio.h"
int main(void)
{
printf("hello world!\n");
return 0;
}
版权声明
本文为[grey_ csdn]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220815135601.html
边栏推荐
- 小程序 读取文件
- leetcode 烹饪料理
- 程序设计天梯赛 L1-49 天梯赛分配座位(模拟),布响丸辣
- A domestic image segmentation project is heavy and open source!
- Deploying sbert model based on torchserve < semantic similarity task >
- If 404 page is like this | daily anecdotes
- tp6阿裏雲短信 window 報 cURL error 60: SSL certificate problem: unable to get local issuer certificate
- Real math problems in 1958 college entrance examination
- Halo open source project learning (I): project launch
- 全局、独享、局部路由守卫
猜你喜欢

MySQL JDBC编程

PTA: praise the crazy devil

006_ redis_ Jedis quick start

Deploying sbert model based on torchserve < semantic similarity task >

day18--栈队列
Rich intelligent auxiliary functions and exposure of Sihao X6 security configuration: it will be pre sold on April 23

打靶narak
![[XJTU计算机网络安全与管理]第二讲 密码技术](/img/b0/263e8dcbfeb2ce9f504a9c8eb76b07.png)
[XJTU计算机网络安全与管理]第二讲 密码技术

每日一题冲刺大厂第十六天 NOIP普及组 三国游戏

Web learning record (medium)
随机推荐
Hyperscan -- 2 compilation
JVM类加载器
PTA: 点赞狂魔
Download the genuine origin Pro 2022 tutorial and how to activate it
Flink stream processing engine system learning (I)
Real math problems in 1958 college entrance examination
Flink real-time data warehouse project - Design and implementation of DWS layer
【无标题】
If 404 page is like this | daily anecdotes
Latin goat (20204-2022) - daily question 1
[XJTU计算机网络安全与管理]第二讲 密码技术
Multithreading technology core
Suggestion: block reference sorting is in the order of keywords
16、 Anomaly detection
Day18 -- stack queue
Web learning record (medium)
【unity3D】直播间滚动式弹幕效果
谷雨
[untitled]
PHP sorting of interview questions on April 20, 2022