从开发人员的角度来看Linux文件夹的结构 [英] Linux folders structure from developer perspective
问题描述
我对Linux文件系统还很陌生,所以请您能帮我吗?我必须使用Ubuntu编写一个示例C ++项目(测试).
您能从开发人员的角度来说明一下文件/文件夹结构吗?以下是一些我想回答的问题:
I'm rather new to Linux filesystems, so could you help me, please? I have to write a sample C++ project (tests) using Ubuntu.
Could you clarify me with a file/folder structure from a developer's perspective? Here are some questions I would like answered:
- 项目的典型位置在哪里(源,目标文件等)?
- 开发环境(Eclipse,QT Creator等)的典型位置在哪里?
- 图书馆的典型位置在哪里?二进制文件和仅标头的库有不同的地方吗?
- 各种开发工具(代码分析器,git客户端等)的典型位置在哪里?
答案和链接将不胜感激.谢谢你.
Answers and links would be appreciated. Thank you.
推荐答案
项目的典型位置在哪里(源,目标文件等)?
Where is typical location of the projects (sources, object files, etc.)?
我将项目存储在$HOME/dev
中,但完全取决于您.
I store my projects in $HOME/dev
but its entirely up to you.
开发环境(Eclipse,QT Creator等)的典型位置在哪里?
Where is a typical place for dev environment (Eclipse, QT Creator, etc.)?
我使用eclipse并将其工作空间指向$HOME/dev
.
I use eclipse and set its workspace pointing to $HOME/dev
.
图书馆的典型存放地点在哪里?二进制文件和仅标头的库有不同的地方吗?
Where is a typical place for the libraries? Are there different places for binaries and for header-only libraries?
通常将库安装到/usr/lib
,将标头安装到/usr/include
.
Typically libraries are installed to /usr/lib
and headers are installed to /usr/include
.
各种开发工具(代码分析器,git客户端等)的典型位置在哪里?
Where is a typical place for a various tools for the development (code analyser, git client, etc.)?
通常将它们安装到/usr/bin
中.我还把工具放在了$HOME/bin
中,特别是如果我制作了它们.
Typically these are installed into /usr/bin
. I also put tools in $HOME/bin
, especially if I made them.
但是它比这更复杂.如果您要使用与Linux发行版不同的库版本来开发/测试应用程序,该怎么办?有时,我会在$HOME/dev
文件夹中安装不同的库版本,并针对这些库而不是系统版本进行编译.
But its more complicated than that. What if you want to develop/test an application with a version of a library that is different to the one that comes with your Linux distribution? Sometimes I will install different library versions in my $HOME/dev
folder and compile against those rather than the system version.
我也运行GCC 4.9.2
附带的Fedora 21
,但是我已经将GCC 5.1.0
安装到/opt/gcc-5.1.0
中,并用于某些用途.
Also I run Fedora 21
that comes with GCC 4.9.2
, however I have installed GCC 5.1.0
into /opt/gcc-5.1.0
and use that for some things.
对我来说,典型的项目结构如下:
A typical project structure for me would be something like:
$HOME/
/dev/
/my-prog/
/src/
/include/
/my-prog.h
/my-prog.cpp
/build-debug/
/src/
/my-prog
/build-release/
/src/
/my-prog
/Makefile
这篇关于从开发人员的角度来看Linux文件夹的结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!