简体   繁体   English

CodeLite 不在某些工作区中运行 C++ 程序

[英]CodeLite doesn't run C++ program in certain workspaces

I am using CodeLite as an IDE for C++ in order to do some of the exercises for a book I am trying to read.我将 CodeLite 用作 IDE 用于 C++,以便为我正在阅读的一本书做一些练习。 As of now, I have generated a workspace, and have multiple projects (each one corresponding to one exercise).到目前为止,我已经生成了一个工作区,并且有多个项目(每个项目对应一个练习)。 CodeLite was working ok until, for one of the projects, I began copying over some helper functions (these were within a header and C++ file). CodeLite 工作正常,直到对于其中一个项目,我开始复制一些辅助函数(这些在 header 和 C++ 文件中)。 Once I did this however, my programs in the whole workspace no longer run.然而,一旦我这样做了,我在整个工作区中的程序就不再运行了。 Everything will still compile and build, and the Run button isn't grayed out.一切仍将编译和构建,并且“运行”按钮不会灰显。 I click the run button (or do ctrl+F5) and nothing happens.我单击运行按钮(或按 ctrl+F5),但没有任何反应。

I have tried to restart my computer, and CodeLite, as well as close and reopen the specific workspace, but the issue persists.我已尝试重新启动计算机和 CodeLite,以及关闭并重新打开特定工作区,但问题仍然存在。 I should note that this issue does not appear in other workspaces, and only started once I began adding in the helper functions in the form of the header and cpp files.我应该注意,这个问题不会出现在其他工作区中,并且只有在我开始以 header 和 cpp 文件的形式添加辅助函数时才开始。

I also wanted to add that I was unable to directly add the helper functions, and had to copy paste the contents individually into my own files.我还想补充一点,我无法直接添加辅助函数,必须将内容单独复制粘贴到我自己的文件中。 I suppose this is because the "Add Existing File" feature only lets you view those files in a separate directory, though I'm not too sure.我想这是因为“添加现有文件”功能只允许您在单独的目录中查看这些文件,尽管我不太确定。

In any case, here is a picture of my workspace, though I'm not really sure if that will be of much help:无论如何,这是我工作区的照片,尽管我不确定这是否会有很大帮助:

Also, here is how I am including these helper functions in my code:此外,这是我在代码中包含这些辅助函数的方式:

#include <iostream>
#include <iomanip>
#include <math.h>

#include "SAT_Const.h"
#include "SAT_Kepler.h"
#include "SAT_RefSys.h"
#include "SAT_Time.h"
#include "SAT_VecMat.h"

I can't really find any workspace settings which would incur such behavior, but please let me know if you'd like for me to include more information.我真的找不到任何会导致此类行为的工作区设置,但如果您希望我提供更多信息,请告诉我。

Thanks!谢谢!

I mean first look (using your OS file browser) if the executable exists.我的意思是首先查看(使用您的操作系统文件浏览器)是否存在可执行文件。

Thanks for this comment, I think this may be the root of the issue.感谢您的评论,我认为这可能是问题的根源。 CodeLite does make a folder where it would place the executable (folder is called Debug for me), but it does not make an executable. CodeLite 确实创建了一个用于放置可执行文件的文件夹(对我来说,该文件夹称为 Debug),但它不会创建可执行文件。 I think this is entirely my fault, as I named my projects with dots in them, which causes issues when creating the executable file name (ie it will make an executable for Ex_2.4 as simply Ex_2.4 where the ".4" counts as the file extension instead of putting a.exe in there).我认为这完全是我的错,因为我用点来命名我的项目,这会在创建可执行文件名时导致问题(即它将为 Ex_2.4 生成一个可执行文件,就像 Ex_2.4 一样,其中“.4”很重要作为文件扩展名,而不是把 a.exe 放在那里)。

Even when I change the names of the projects through CodeLite, the changes do not translate to the files.即使我通过 CodeLite 更改了项目的名称,这些更改也不会转换为文件。 So I simply made a new workspace and copy-pasted all of the information and it works wonders!所以我只是创建了一个新的工作区并复制粘贴了所有信息,效果非常好!

Thank you for your help!谢谢您的帮助!

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

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