简体   繁体   English

应用程序构建。 (在Ubuntu上为Swift)

[英]Application build . (Swift on Ubuntu)

I am a total newbie to programming and Ubuntu and Swift is my first language to learn. 我是编程的新手,而Ubuntu和Swift是我学习的第一门语言。

I am learning with a book but I encountered a problem when I was supposed to build an application. 我正在学习一本书,但是当我应该构建一个应用程序时遇到了一个问题。 Here is what I had to do: 这是我必须要做的:

Make a new directory called PMExample so that's easy mkdir PMExample 新建一个名为PMExample的目录,这样很容易mkdir PMExample
and then go to this directory cd PMExample . 然后转到该目录cd PMExample

Then I had to use ~/swift package init and got 2 directories called Sources and Tests and a file Package.swift. 然后,我不得不使用~/swift package init并得到2个名为Sources and Tests的目录和一个文件Package.swift。 So in the Sources folder there was one text file and I had to create another one to build an application. 因此,在Sources文件夹中有一个文本文件,我必须创建另一个文本文件来构建应用程序。

And I did all those steps correctly, but now there is a problem. 而且我正确地完成了所有这些步骤,但是现在出现了问题。 The book tells me to use swift build command. 这本书告诉我要使用swift build命令。 The book says that this will build the application and if all is well, I will have an executable application in the PMExample/.build/debug directory named PMExample... 这本书说这将构建应用程序,如果一切顺利,我将在PMExample/.build/debug目录中有一个名为PMExample的可执行应用程序...

But after ~/swift build while being in the PMExample dir, there isn't any new directory called .build or anything. 但是在~/swift build当处于PMExample目录中时,没有任何名为.build的新目录。 There are no errors popping up after using that ~/swift build command. 使用~/swift build命令后,不会弹出任何错误。 Just nothing happens and I can't understand what am I doing wrong. 只是什么也没有发生,我无法理解我在做什么错。

Thanks in advance. 提前致谢。

But after ~/swift build while being in the PMExample dir, there isn't any new directory called .build or anything. 但是在〜/ swift构建之后,当处于PMExample目录中时,没有任何名为.build的新目录。

How do you know that? 你怎么知道? It is likely that you are not seeing the directory because it starts with a dot (it is called .build ), therefore it is not shown by default with ls . 您可能看不到该目录,因为该目录以点开头(称为.build ),因此默认情况下不会以ls显示该目录。 You have to pass the -a argument to ls , such as in: 您必须将-a参数传递给ls ,例如:

ls -a PMExample

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM