【问题标题】:GCC compiler does not recognize in the CodeBlocks IDE (Set variable: LD_LIBRARY_PATH=.:)GCC 编译器在 CodeBlocks IDE 中无法识别(设置变量:LD_LIBRARY_PATH=.:)
【发布时间】:2021-08-05 19:35:57
【问题描述】:

我正在使用 Ubuntu 20.04 LTS,我一直在尝试在 codeblocks IDE 中启动并运行 C 程序,但它一直让我出现以下错误。

Checking for existence: /media/darkpheonix/dptech/dptech/Projects/C/techtheory/bin/Debug/techtheory
    Set variable: LD_LIBRARY_PATH=.:
    Executing: xterm -T techtheory -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=:. /media/darkpheonix/dptech/dptech/Projects/C/techtheory/bin/Debug/techtheory  (in /media/darkpheonix/dptech/dptech/Projects/C/techtheory/.)
    Process terminated with status -1 (0 minute(s), 0 second(s))


我尝试了sudo apt-get updatesudo apt-get upgrade
然后尝试从主服务器安装构建基本包。 sudo apt-get install build-essentials
这让我不断出现以下错误。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package build-essential is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'build-essential' has no installation candidate

我尝试了不同的来源,但似乎没有解决这个问题。请帮忙

【问题讨论】:

  • 您的 [已发布] apt-get 命令使用 build-essentials,但您的错误消息抱怨 build-essential。因此,您发布的命令中的错误输出是 not 。我认为你想要复数版本。
  • @CraigEstey 我发现了build-essential 问题。 sudo apt-get build-essential 工作。虽然路径错误发生在 CodeBlcoks 中。它需要gcc compiler 的路径,但我找不到导出路径的方法,因为我不知道。

标签: c gcc compiler-errors codeblocks


【解决方案1】:

解决了!

步骤 1

GCC 编译器配置

你必须运行

export LD_LIBRARY_PATH="/path/to/sdk/lib"

将路径导出到编译器。
默认路径在usr/bin
将路径复制并粘贴到your_lib.conf 文件中/etc/ld.so.conf.d 的位置,然后保存并退出。

sudo ldconfig

运行此程序以确认添加路径的文件中的更改。

第二步

xterm 配置

xterm 安装到操作系统中。

sudo apt-get install xterm

检查并确保它处于最新版本的配置中,然后测试 CODEBLOCKS 项目,构建并作为控制台应用程序运行它们。

【讨论】:

    猜你喜欢
    • 2015-05-14
    • 1970-01-01
    • 2022-06-28
    • 2018-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多