CentOS下安装mysql,make时出现make[1]: *** [link_sources] Error 1 make: *** [all-recursive] Error 1

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS下安装mysql,make时出现make[1]: *** [link_sources] Error 1 make: *** [all-recursive] Error 1相关的知识,希望对你有一定的参考价值。

操作如下:
[root@CentOS CentOS_6.4]# /usr/sbin/groupadd mysql
[root@CentOS CentOS_6.4]# /usr/sbin/useradd -g mysql mysql
[root@CentOS mysql-5.1.58]# ./configure --prefix=/usr/local/mysql --localstatedir=/data/mysql_db --with-extra-charsets=all
[root@CentOS mysql-5.1.58]# make
....
/usr/bin/diff -w include/mysql.h.pp ./abi_check.out
+ /bin/rm ./abi_check.out
make[2]: Leaving directory `/mnt/hgfs/CentOS_6.4/mysql-5.1.58'
make[1]: Leaving directory `/mnt/hgfs/CentOS_6.4/mysql-5.1.58'
Making all in include
make[1]: Entering directory `/mnt/hgfs/CentOS_6.4/mysql-5.1.58/include'
/bin/cp config.h my_config.h
/bin/rm -f readline openssl
/bin/ln -s ../cmd-line-utils/libedit/readline readline
/bin/ln: creating symbolic link `readline': Operation not supported
make[1]: *** [link_sources] Error 1
make[1]: Leaving directory `/mnt/hgfs/CentOS_6.4/mysql-5.1.58/include'
make: *** [all-recursive] Error 1

参考技术A 出现这种情况是由于在编译的时候,要用ln去建立一些软链接,而这些文件是虚拟机在Windows与Linux中共享的文件夹下,虽然ln命令在Linux系统中很常见,但Windows不支持,所以,编译会报错。
解决办法:
1.最简单的办法就是把mysql源文件移到共享文件夹以外的其它文件夹下!
2.在VMWare下的Linux中,建立Samba服务,之后新创建新samba用户和文件夹,在windows中就可以访问到该文件夹了。然后把在Linux中,从共享目录拷贝到你所要共享的samba目录中,这样,也可以实现我们所要的文件共享本回答被提问者采纳
参考技术B 【环境】
VmWare的Linux + Windows XP + vmhgfs文件共享
【问题】
在编译VMware下的Linux系统对从Windows中共享过来的文件,进行编译的时候,遇到:
ln: creating symbolic link XXXXXX : Operation not supported
【解决办法】
出现这类问题,主要是由于在编译的时候,要用ln去建立一些软链接,
而这些文件是从Windows中,通过VMWare虚拟机共享进Linux的,
而虽然此种操作在Linux系统中很常见,但Windows不支持,所以,
编译会报错。
有个解决办法就是,在VMWare下的Linux中,建立Samba服务,
然后新创建新samba用户和文件夹,然后在windows中就可以访问到该文件夹了。
然后把在Linux中,从共享目录拷贝到你所要共享的samba目录中,
这样,也可以实现我们所要的文件共享。
此时在去编译这些代码的时候,由于是在Linux系统中的,所以就OK了。追问

谢谢你的回答!帮助很大

从源代码安装 grpc 时出现“make: protoc: Command not found”

【中文标题】从源代码安装 grpc 时出现“make: protoc: Command not found”【英文标题】:“make: protoc: Command not found” while installing grpc from source 【发布时间】:2019-01-16 10:35:54 【问题描述】:

我已经克隆了这个存储库https://github.com/grpc/grpc.git 用于安装 grpc。我想将框架与C++ 编程一起使用,所以我按照文件夹src/cpp 中给出的说明进行操作。

要从源代码(在 OpenSUSE 中)为 C++ 构建 grpc,有一些先决条件 given in this link

 $ [sudo] apt-get install build-essential autoconf libtool pkg-config

如前所述,要从源代码构建并运行测试,需要

$ [sudo] apt-get install libgflags-dev libgtest-dev
$ [sudo] apt-get install clang libc++-dev

我找不到任何 build-essentiallibgflags-devlibgtest-dev。我不知道这是否是没有安装grpc的原因。

后来, 在运行make之前,我已经手动安装了协议缓冲区编译器protoc

当我在 grpc 根目录中运行 make 时。我收到此错误

[PROTOC]  Generating protobuf CC file from src/proto/grpc/channelz/channelz.proto
make: protoc: Command not found
make: *** [Makefile:2601: /home/rohan/Downloads/grpc/gens/src/proto/grpc/channelz/channelz.pb.cc] Error 127

由于我已经安装了protoc,所以无法弄清楚为什么会显示此错误。是一些链接问题,那么请分享如何解决它。我是 Linux 新手,所以我真的有点犹豫要更改 env 文件或我自己的一些 make 文件。

请提供一些帮助。感谢您的宝贵时间。

【问题讨论】:

你在哪里手动安装了protoc?我希望在您的PATH 中的路径中? 嗨@MatthieuBrucher 我在.bashrc 中没有设置PATH。这就是你要问的吗?也就是说,我认为 protobuff 安装在某个默认位置,例如 /usr/include/usr/lib64我如何确保它? 当我执行protoc --IPATH 时,它也会给出 Missing value for flag: --IPATH 你必须弄清楚这一点,因为路径却被添加到环境变量PATH。不确定你认为protoc -IPATH 应该做什么。 如果你输入which protoc,它会搜索你的PATH,并告诉你安装在哪里,如果能找到的话。 嗨@NickODell 和@MatthieuBrucher,这绝对是protobuf 安装问题。当我再次重新安装 protobuff 时,这个问题就解决了。显然我下载了错误的 git repo,现在已修复。 由于我是新手,所以我不知道如何在没有任何答案的情况下关闭此问题。 【参考方案1】:

我已经通过正确安装协议缓冲区编译器解决了这个问题。

我之前忘记做的重要步骤是在使用 git 存储库构建 protoc 时使用 git submodule update --init --recursive 更新子模块。

this link提到了C++版本的步骤。

谢谢,

【讨论】:

以上是关于CentOS下安装mysql,make时出现make[1]: *** [link_sources] Error 1 make: *** [all-recursive] Error 1的主要内容,如果未能解决你的问题,请参考以下文章

Linux centos6.5系统下升级gcc4.8.2时,编译gcc时出现错误,请求帮助

安装cygwin中的make时出现了一下错误,应该怎么办啊,求大神解决!

linux 下make 时出现如下错误,怎么办?

CentOS 6.5 安装 Redis 执行 make #error "Newer version of jemalloc required"

Kali Linux中,make编译时出现错误怎么解决?

CentOS 6.7 编译PHP7 make时出现错误:undefined reference to `libiconv_close’