是否有一个应用程序可以在我们从 .deb 包或软件中心安装软件时自动下载软件的构建依赖项以及源代码?
这是我用于查找两点之间距离的代码。我的任务是强制使用函数,因此是一个单独的用于查找距离的函数。当我执行代码时,我没有收到任何语法错误,只有一个闪烁的光标。我是 C 的初学者。
我的代码:
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
float distance(float *x1, float *y1, float *x2, float *y2);
int main()
{ printf("Input coordinates as x1,y1,x2,y2:\n");
float x1,y1,x2,y2;
scanf("%f %f %f %f ",&x1,&y1,&x2,&y2);
printf("Coordinates are : (%f,%f) and (%f,%f)\n",x1,y1,x2,y2);
printf("%f",distance (&x1,&y1,&x2,&y2));
return 0;
}
float distance(float *x1, float *y1, float *x2, float *y2)
{
float d= sqrt(pow((*x1-*x2),2)+pow((*y1-*y2),2));
printf("%f", d);
return d;
}
Run Code Online (Sandbox Code Playgroud)
编译时: gcc -o 1 1.c -lm 输出:
Input coordinates as x1,y1,x2,y2:
1 2 3 4
Run Code Online (Sandbox Code Playgroud)
就是这样。光标一直闪烁而不提供任何输出。
此外,我尝试在不同的点放入打印语句。之后的任何打印scanf …
我正在尝试使用自定义补丁构建 ubuntu 5.3.0 内核。我下载了源代码并使用添加了补丁
patch -p1 < patch_name.patch
Run Code Online (Sandbox Code Playgroud)
并使用进行配置
make config
Run Code Online (Sandbox Code Playgroud)
然后我编译它使用
make -j6
Run Code Online (Sandbox Code Playgroud)
这给了我 vmlinux 和 vmlinux.o 文件。我不知道如何使用它们,所以我尝试将内核制作成 .deb 文件。我用了
make deb-pkg
fakeroot make-kpkg -j N --initrd --append-to-version=my-very-own-kernel kernel-image kernel-headers
make bindeb-pkg
Run Code Online (Sandbox Code Playgroud)
但是在编译整个内核后,所有这些都给了我同样的错误。
/bin/sh: 1: lz4c: not found
arch/x86/boot/compressed/Makefile:146: recipe for target 'arch/x86/boot/compressed/vmlinux.bin.lz4' failed
make[3]: *** [arch/x86/boot/compressed/vmlinux.bin.lz4] Error 127
make[3]: *** Deleting file 'arch/x86/boot/compressed/vmlinux.bin.lz4'
make[3]: *** Waiting for unfinished jobs....
arch/x86/boot/Makefile:112: recipe for target 'arch/x86/boot/compressed/vmlinux' failed
make[2]: *** [arch/x86/boot/compressed/vmlinux] Error 2
arch/x86/Makefile:284: recipe for target 'bzImage' failed
make[1]: *** …Run Code Online (Sandbox Code Playgroud) 无法安装Ruby,我之前使用过以下命令行:
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
exec zsh
Run Code Online (Sandbox Code Playgroud)
感谢尝试运行:rbenv install 3.0.3
但不断收到此错误:
Downloading ruby-3.0.3.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.3.tar.gz
error: failed to download ruby-3.0.3.tar.gz
BUILD FAILED (Ubuntu 20.04 using ruby-build 20220324)
Run Code Online (Sandbox Code Playgroud) 我刚开始在 Ubuntu 上使用 C++,但我已经陷入困境。
我制作了我的第一个 .cc 程序并尝试用 g++ 编译它。
我将它命名为 variabili.cc 并将其保存在我桌面上一个名为 Esercizi 的文件夹中。
当我尝试
g++ variabili.cc
Run Code Online (Sandbox Code Playgroud)
我得到:
g++: error: variabili.cc No such file or directory
g++: fatal error: no input files compilation terminated
Run Code Online (Sandbox Code Playgroud)
我检查了该文件是否在那里ls ~/Desktop并且它在那里。名字也是对的。
无论我做什么,它似乎都不起作用。
我正在尝试在我的 Ubuntu 16.04 操作系统系统中安装 sqlsrv 驱动程序,但出现此错误
running: make
/bin/bash /tmp/pear/temp/pear-build-rootliPAYQ/sqlsrv-4.3.0/libtool
--mode=compile g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootliPAYQ/sqlsrv-4.3.0/include
-I/tmp/pear/temp/pear-build-rootliPAYQ/sqlsrv-4.3.0/main
-I/tmp/pear/temp/sqlsrv -I/usr/include/php/20151012 -I/usr/include
/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include
/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include
/php/20151012/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11
-D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /tmp/pear/temp/sqlsrv
/conn.cpp -o conn.lo
libtool: compile: g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootliPAYQ/sqlsrv-4.3.0/include -I/tmp/pear/temp/pear-build-rootliPAYQ/sqlsrv-4.3.0/main
-I/tmp/pear/temp/sqlsrv -I/usr/include/php/20151012 -I/usr/include/php/20151012/
main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend
-I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/
lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/tmp/pear/temp/sqlsrv/shared/
-DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /tmp/pear/
temp/sqlsrv/conn.cpp -fPIC -DPIC -o .libs/conn.o In file included from /tmp/pear/
temp/sqlsrv/shared/xplat.h:99:0, …Run Code Online (Sandbox Code Playgroud) 我从这里下载了 scid_vs_pc-4.18.1.tgz:http://scidvspc.sourceforge.net 使用存档管理器解压缩。在名为 scid_vs_pc-4.18.1 的文件夹中打开终端,然后输入 ./configure 并得到以下内容:
jonathan@livingstone ~/Downloads/scid_vs_pc-4.18.1 $ ./configure
Scid vs. PC configure - Makefile configuration program
Tcl/Tk version: 8.6
Your operating system is: Linux 4.13.0-26-generic
Location of "tcl.h": not found
Location of "tk.h": not found
Location of Tcl 8.6 library: /usr/lib/x86_64-linux-gnu
Location of Tk 8.6 library: /usr/lib/x86_64-linux-gnu
Location of X11 library: /usr/lib/x86_64-linux-gnu
Checking if your system already has zlib installed: yes.
Not all settings could be determined! See above for details.
The default Makefile was written. …Run Code Online (Sandbox Code Playgroud) 我正在尝试安装 aircrack-ng,但是我在制作时遇到了问题。正常的过程是这样的
wget https://download.aircrack-ng.org/aircrack-ng-1.4.tar.gz
tar -zxvf aircrack-ng-1.4.tar.gz
cd aircrack-ng-1.4
autoreconf -i
./configure --with-experimental
make
make install
Run Code Online (Sandbox Code Playgroud)
我正常地做了前三个步骤。然后我做了autoreconf -i:
patatoide@PotatoePC:~/git/aircrack-ng-1.4$ autoreconf -i
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build/m4/stubs'.
libtoolize: copying file 'build/m4/stubs/libtool.m4'
libtoolize: copying file 'build/m4/stubs/ltoptions.m4'
libtoolize: copying file 'build/m4/stubs/ltsugar.m4'
libtoolize: copying file 'build/m4/stubs/ltversion.m4'
libtoolize: copying file 'build/m4/stubs/lt~obsolete.m4'
configure.ac:69: installing './compile'
configure.ac:50: installing './config.guess'
configure.ac:50: installing './config.sub'
configure.ac:60: installing './install-sh'
configure.ac:60: installing './missing'
src/Makefile.am: installing './depcomp'
parallel-tests: installing …Run Code Online (Sandbox Code Playgroud) 当我尝试制作主线(暂存测试)内核时,它最终出现错误
BTF: .tmp_vmlinux.btf: pahole version v1.15 is too old, need at least v1.16\
Failed to generate BTF for vmlinux\
Try to disable CONFIG_DEBUG_INFO_BTF
make: *** [Makefile:1162: vmlinux] Error 1
Run Code Online (Sandbox Code Playgroud)
所以,当我谷歌它时,我发现要安装矮人。
当我安装它时,它显示它已经存在,这是 V1.15-2 的较新版本。所以它没有升级到 V1.16+,但最近的版本是 V1.18+
这是我的发行版和内核版本,
发行商 ID:Ubuntu
描述:Ubuntu 20.04.1 LTS
版本:20.04
代号:focus
Linux 5.9.0-050900rc7-generic x86_64 GNU/Linux
我该如何解决这个问题?
我正在使用 ubuntu 16.04 当我尝试使用以下命令编译程序时
g++ -g main.cpp -o main
Run Code Online (Sandbox Code Playgroud)
这是我的 g++ 版本
g++ --version
Run Code Online (Sandbox Code Playgroud)
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Run Code Online (Sandbox Code Playgroud)
我收到这个编译错误
main.cpp:8: undefined reference to `Helper::IsStringNumeric(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
主要.cpp:
#include "Helper.h"
#include <iostream>
#include <vector>
int main()
{
std::cout << Helper::IsStringNumeric("200");
} …Run Code Online (Sandbox Code Playgroud) 如何转换您的 java 程序,使其作为批处理程序运行,即它可以像在 ubuntu 或任何 linux 机器中的命令一样运行。程序是什么?要遵循哪些步骤?特别是java程序。C程序也不错。
我想知道是否有任何库要添加到 java/c 程序中,以及放置程序的位置以及如何编写手册页。
我收到以下错误:
jay@ubuntu:~/Downloads/systemc-2.3.1/objdir
$ sudo ../configure –prefix=/usr/local/systemc-2.2
configure: error: invalid variable name: `–prefix'
Run Code Online (Sandbox Code Playgroud) 我在终端中尝试过这些命令,
sudu apt-get upgrade
sudu apt-get update
sudu apt-get install build essential
Run Code Online (Sandbox Code Playgroud)
但失败了。请帮助我,我收到以下错误。
No command 'sudu' found, did you mean:
Command 'sudo' from package 'sudo' (main)
Command 'sudo' from package 'sudo-ldap' (universe)
Command 'tudu' from package 'tudu' (universe)
sudu: command not found
Run Code Online (Sandbox Code Playgroud)