Comments (5)
Hi @mudongliang
That's a great idea. But I don't think I have enough time for it.
If anyone could carry out this job, it's gonna be appreciated.
from cpp-primer.
那你可不可以给我一个编译某个cpp文件的gcc命令,我看一下你使用的编译选项!如果有特殊要求的编译选项,请提前说明一下,我目前正在学习CPPprimer,看能不能借助该书GCC源码的makefile来写一个makefile!
from cpp-primer.
Awesome. Nothing special, just enable the flag for c++11. Often I use something like below to compile:
g++ -Wall -std=c++11 -o some_exercise some_exercise.cpp
If you have other ideas as to the compiling command, just go for it.
In addition,I believe this sort of thing tends to be quite annoying and time consuming. So thx a lot for this.
from cpp-primer.
@mudongliang 个人认为,makefile 是在编译一个大型项目必备的工具,但本书答案显然都是一些简短的小程序,动用该神器,显得有点牛刀杀鸡。而且,makefile的使用显然超出了本书的范畴,我并不建议为每个习题都弄个 makefile.
如果在 windows 上,makefile 比较可笑,大家一般都会神一样的 IDE: Visual Studio,或者挑一个趁手的 IDE: Dev-C++ 或 Qt Creator.
Mac 或 Linux 上,我的建议是给系统环境变量上设一个 alias
,如:
alias g++='g++-4.9 -std=c++11 -pedantic -Wall' # 这个命令在咱们 README.md 里已经说明
这样你要编译哪个程序,就用 g++
命令即可,例如:
g++ ex1_1.cpp # 编译
./a.out # 执行
为什么不起名字?没必要啊,那些可执行文件有什么后续意义吗?没有,只是验证习题的正确与否罢了。
个人建议,仅供参考。
from cpp-primer.
首先,我说的那个makefile,其实为了linux使用者而试着写一下,这里面不涉及windows的用户,再说了,就算windows的使用者想用,也是很麻烦的安装各种软件。
其次,你在使用windows的时候,怎么在图形界面直接执行我想要的各种编译选项,你只能傻傻的点击图形系统给你安排的各种按钮吧!
再次,众所周知使用linux做开发根本不需要各种各样的集成环境,linux中的各种命令可以帮你解决,,不过本人还是比较喜欢在linux下使用eclipse,加上插件之后做各种开发。
最后,想说一点,其实makefile的基础功能是很简单的,学习linux其中一个很基础的工作就是学习源码编译各种软件,这里面有使用的知识很多都是makefile的,建议有条件的话可以使用一下!
在 2014年12月13日 下午10:38,pezy [email protected]写道:
@mudongliang https://github.com/mudongliang 个人认为,makefile
是在编译一个大型项目必备的工具,但本书答案显然都是一些简短的小程序,动用该神器,显得有点牛刀杀鸡。
而且,makefile的使用显然超出了本书的范畴,我并不建议为每个习题都弄个 makefile.如果在 windows 上,makefile 比较可笑,大家一般都会神一样的 IDE: Visual Studio,或者挑一个趁手的 IDE:
Dev-C++ http://sourceforge.net/projects/orwelldevcpp/ 或 Qt Creator
https://qt-project.org/search/tag/qt%7Ecreator.Mac 或 Linux 上,我的建议是给系统环境变量上设一个 alias,如:
alias g++='g++-4.9 -std=c++11 -pedantic -Wall' # 这个命令在咱们 README.md 里已经说明
这样你要编译哪个程序,就用 g++ 命令即可,例如:
g++ ex1_1.cpp # 编译
./a.out # 执行为什么不起名字?没必要啊,那些可执行文件有什么后续意义吗?没有,只是验证习题的正确与否罢了。
个人建议,仅供参考。
—
Reply to this email directly or view it on GitHub
#95 (comment).
from cpp-primer.
Related Issues (20)
- exercise12.8 memory leakage reason?
- Got this issue
- Typo in exercise 15.34 / 15.36
- Typo in exercise 16.36
- Cpp primer answer
- Access to private member
- Cannot understand exercise 9.52, please help. HOT 1
- ex13.44 about size and length function HOT 1
- D HOT 1
- ex2.5 notation vs type? HOT 1
- Spelling error in "Exercise 4.7" HOT 1
- Spelling error in Exercise 4.14 HOT 1
- Spelling error in Exercise 4.28 HOT 1
- "Include" error in ex15.4.5.6
- Cpp
- Ch 16 - some further reading for ex65 and 66
- A issue made by mistake.
- Ex 14.28 problem
- Ex13.42 HOT 1
- Exercise 10_32.cc (G++ giving error on the accumulate algorithm)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp-primer.