标签: c++

如何在 ubuntu 中编码?

我在 Windows 中使用 turbo c++ 编写 c/c++ 代码。最近我开始使用 Ubuntu,现在我应该像以前在 Windows 中那样在 Ubuntu 中编写 c/c++ 代码吗?我应该从 Ubuntu 应用商店下载哪个软件来编写代码?请注意,我不是在问如何编译,而是在问在哪里以及在哪个软件中编写代码。

c c++

2
推荐指数
1
解决办法
3万
查看次数

如何在 Ubuntu16.04 上安装 libboost_version1.59 或更新版本

如何安装 libboost1.59 ?

我尝试了很多方法来安装它,但未能将我的 Ubuntu 16.04 上的 1.58 版更新到 1.59 版。

我在 StackOverflow 上尝试过这个这个这个在 linuxfromscratch.org这个博客上

谁能给我一个有效的方法?

compiling c++ libraries

2
推荐指数
1
解决办法
1万
查看次数

Makefile 42:目标“util.o”的配方失败

我收到此错误:

~/Distrib$ make all
/usr/bin/g++ -O3 util.cc -I/home/shah/Distrib
util.cc: In function 'into countLines(const char*)':
util:19:8: error: 'exit' was not declared in this scope
  exit(1);
        ^
Makefile:42: recipe for target 'util.o' failed
make: *** [util.o] Error 1
Run Code Online (Sandbox Code Playgroud)

基本上我想安装一个我从这个网页下载的断层扫描软件

我将 Makefile 中的第 5 行更改为

Home = /home/shah 
Run Code Online (Sandbox Code Playgroud)

Makefile 更改

compiling c++ makefile

2
推荐指数
1
解决办法
3万
查看次数

C++ 代码编译致命错误:xdo.h: No such file or directory

我在Dell Vostro 15-3546上使用Ubuntu 18.04

uname -api
Linux vaishnavi-laptop 4.15.0-118-generic #119-Ubuntu SMP Tue Sep 8 12:30:01 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

我想安装comfortable-swipe. 这是我的输出bash install

Installing binaries ...
./comfortable-swipe-main.cpp:31:10: fatal error: xdo.h: No such file or directory
 #include <xdo.h>
          ^~~~~~~
compilation terminated.
Run Code Online (Sandbox Code Playgroud)

有没有办法解决这个问题?

提前致谢

c++ 18.04

2
推荐指数
1
解决办法
651
查看次数

错误的 cmake 可执行文件 vscode

我最近刚刚安装了 Ubuntu 20.04 和 VSCode(用于 c++)。我添加了 C/C++、CMake 和 CMake 工具扩展。然后我克隆了我的旧 github 存储库之一进行测试,并尝试从命令面板进行 Cmake:configure,但出现此错误。

Bad CMake executable "/snap/bin/cmake". Is it installed or settings contain the correct path (cmake.cmakePath)?
Run Code Online (Sandbox Code Playgroud)

我已经浏览了 CMake 工具扩展 github 存储库来寻找答案,这似乎是有关 snap 的某种问题?我不太确定他们到底在说什么,但我知道这是 CMake 工具中的一个错误,但我没有找到解决方案。谁能帮我吗?

compiling c++ cmake snap visual-studio-code

2
推荐指数
1
解决办法
7733
查看次数

编译 C++ 代码引发“无输入文件”致命错误?

我发现很难在终端中运行/编译一个简单的 C++ 代码。这是我用来编译文件 (helloworld.cpp) 的代码。

g++ helloworld.cpp -o helloworld
Run Code Online (Sandbox Code Playgroud)

我收到一个错误。(图片)

g++:致命错误:没有输入文件

compiling c++

1
推荐指数
1
解决办法
7万
查看次数

C 程序在 Windows 中运行良好,但在 Ubuntu 上运行时它不要求字符串?

我用于从用户获取信息并打印相同的简单代码在 Windows 操作系统上运行良好(在 Dev C++ 上),但在 Ubuntu 上运行时它不要求字符串(通过 WINE/代码块尝试终端/开发 C++)

   #include<stdio.h>
   void display();
   struct book
  {
         int isbn;
         char name[25];
  }b[5];

   void PUSH()
   {
        int top;
        for(top=0;top<5;top++)
        {
        printf("Enter the ISBN no:");
        scanf("%d",&(b[top].isbn));
        printf("Enter the name:");
        fflush(stdin);
        gets(b[top].name);
        }
   }
  main()
  {
             PUSH();
             display();
  }
  void display()
  {
      int i;
      for(i=0;i<5;i++)
      {

      printf("----------------\nISBN no: %d",(b[i].isbn));
      printf("\nBook Name: %s \n",(b[i].name));
      }
      printf("----------------\n");
  }
  void POP()
  {
       int i;
      for(i=0;i<5;i++)
      {

      printf("----------------\nISBN no: %d",(b[i].isbn));
      printf("\nBook Name: %s \n",(b[i].name));
      }
      printf("----------------\n");

  }
Run Code Online (Sandbox Code Playgroud)

Ubuntu …

windows c c++

1
推荐指数
1
解决办法
3778
查看次数

为什么qt-creator需要连接google-analytics?

我刚刚安装qt-creator用于非 qt C++ 项目。安装版本为2.5.0(基于Qt 4.8.2 32位)

如果我点击这些页面中的任何一个: 显示 qt-creator 主页链接的图像

我收到此错误: 显示错误的图像

我意识到该/etc/hosts文件具有以下条目:

127.0.0.1  www.google-analytics.com
Run Code Online (Sandbox Code Playgroud)

我不想从主机文件中删除该条目,因为它一直与其他数千个类似的广告服务/色情/恶意软件地址一起存在。

我不打算说这qt-creator会在我的计算机中制造问题,但我真的很想知道为什么qt-creator需要连接到 google-analytics?这可以被禁用并且qt-creator仍然可以正常工作吗?

c++ qt-creator

1
推荐指数
1
解决办法
399
查看次数

Ubuntu 更适合基于 Python 的应用程序吗?

我的问题很简单。

Ubuntu 是否更适合用 Python 编写的类似文本编辑器的程序(Libre Office、Sublime Text 等)?

或者如果我在 Ubuntu 中使用 C++、Python 或 Java 没有区别?

我注意到在创建类似办公室的应用程序、目录、自定义按需应用程序等时,Python 以某种方式受到 Ubuntu 开发人员的青睐。

此外,Ubuntu 网站在这里推广 Python:

http://developer.ubuntu.com/get-started

他们不在他们的网站上宣传 C++ 或 Java。所以,我很好奇为什么他们比 C++ 或 Java 更能推广 Python?

还是仅仅因为 Python 的开发速度比 Java 或 C++ 快?

我不是在问哪种编程语言是最好的(我已经知道 C++ 是最好的,并且在图形和硬件优化方面最常用),但我很好奇为什么 Python 在 Ubunutu 社区如此受欢迎,是否仅仅是因为用这种语言编程很容易,或者如果它有其他原因,例如在 Ubuntu 中比其他语言更好的性能。

Ubuntu 团队决定将 Python 推广为 Ubuntu 的第一语言的历史是什么?

python java c++

1
推荐指数
1
解决办法
602
查看次数

找不到 -lxi

我正在尝试编译并运行我在家里的虚拟机 ubuntu 上的另一台电脑上创建的 OpenGL/GLUT 程序。我已经安装了 freeglut3 和其他 OpenGL 库,但是当我尝试编译时,我得到:找不到 -lXi

这是我的 Makefile 中的一行:

LDLIBS=-lGL -lGLEW -lglut -lGLU -lX11 -lXi -lm
Run Code Online (Sandbox Code Playgroud)

我似乎找不到我还需要安装哪个库?

谢谢您的帮助

opengl c++

1
推荐指数
1
解决办法
4084
查看次数