如何在 os x 10.10 中使用自制软件安装 gcc -4.8.4
How to install gcc -4.8.4 using homebrew in os x 10.10
我已经从github克隆了某人的c ++代码,但未能成功。作者告诉我,他使用的 gcc 版本是 4.8.4,他可以成功运行它。所以我使用 brew install homebrew/versions/gcc48
安装了 gcc48,并在放置在他代码文件夹中的makefile
中指定了 gcc
的版本。
但是,编译过程中出现错误:
g++-4.8 -c -pipe -O3 BurstyBTM.cpp -o BurstyBTM.o
BurstyBTM.cpp: In member function 'Pvec<double> BurstyBTM::compute_pz_b(Biterm&)':
BurstyBTM.cpp:129:23: error: could not convert 'pz.Pvec<T>::normalize<double>(0.0)' from 'void' to 'Pvec<double>'
return pz.normalize();
^
BurstyBTM.cpp: In member function 'void BurstyBTM::save_pz(std::string)':
BurstyBTM.cpp:158:41: error: conversion from 'void' to non-scalar type 'Pvec<double>' requested
Pvec<double> pz = nb_z.normalize(alpha);
^
BurstyBTM.cpp: In member function 'void BurstyBTM::save_pw_z(std::string)':
BurstyBTM.cpp:164:37: error: conversion from 'void' to non-scalar type 'Pmat<double>' requested
Pmat<double> pw_z = nwz.normr(beta);
^
make: *** [BurstyBTM.o] Error 1
如何专门安装带有 4.8.4 版的 gcc?否则,我该如何处理此问题?提前感谢!
您尝试使用 C 编译器而不是C++编译器编译代码。
在"生成文件"中,替换
CC=gcc-4.8
由
CC=g++-4.8
如果您没有安装 g++,请使用
brew install gcc48 --enable-cxx
相关文章:
- 从C++调用 Python 并访问通过 Anaconda 安装的软件包
- 通过自制软件(macOS)安装的clang++:编译错误
- 尝试使用 RTool 在 R4.0 上安装软件包时出现编译错误
- 如何导入使用自制软件安装的 GMP?
- mingw-64 - 安装软件包
- 使用 PYbombs 安装软件包 GNU 无线电时出错
- 安装CMake后,我找不到带有"find_package"的软件包
- 代表软件包安装和系统依赖关系的最佳数据结构
- CMake - 安装问题以制作软件包
- vcpkg 在安装软件包时找不到 cmake.cmd
- OSX 自制软件安装后使用 curlpp 的问题
- 如何在本地商店中安装软件包
- 在Docker构建过程中安装C 软件包
- 使用git安装多个版本的软件
- 通过自制软件安装 freetype,似乎无法正确包含标题
- 我应该使用哪个数据库,需要最小的软件安装到最终用户计算机
- 如何列出/处理C++中安装在 Windows 计算机上的所有软件和相关.exe
- Qt安装程序框架 - 读取下载的软件包版本
- 为什么我在安装软件包中收到这样的错误消息
- 如何在 os x 10.10 中使用自制软件安装 gcc -4.8.4