ld:在结构数组上找不到体系结构x86_64错误的符号
ld: symbol(s) not found for architecture x86_64 error on array of structs
在将结构数组的类型def传递给函数时遇到这个奇怪的错误。我的代码如下:
#include <fstream>
#include <iostream>
#include <iomanip>
using namespace std;
const int MAXRECORDS = 50;
struct Grades // declares a structure
{
char name[NAMESIZE + 1];
};
typedef Grades gradeType[MAXRECORDS];
void ReadIt( ifstream &i, gradeType gradeRec, int &h);
int main()
{
ifstream indata;
int numRecord; // number of records read in
gradeType studentRecord;
/* Some stuff */
ReadIt(indata, studentRecord, numRecord);
/* Other Stuff*/
return 0;
}
void readIt(ifstream &inData, gradeType gradeRec, int &total)
{
// never make it here, does not compile
}
g++给出以下错误:
体系结构x86_64的未定义符号:
"ReadIt(std::__1::basic_ifstream>&,成绩*,int&)",引用自:_等级-10db96中的main。o ld:找不到体系结构x86_64的符号clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
C++是一种区分大小写的语言。CCD_ 1与CCD_。
在声明中使用的是gradeRec
,而在定义中使用的却是gradeRec&
。这是两个不同的符号。
相关文章:
- Apple Mach-O-Linker 错误:在体系结构 x86-64 中找不到从(行)引用的变量
- 致命错误LNK1112:在 npm 安装期间,模块计算机类型'X86'与目标计算机类型'x64'冲突
- C++/CLR:仅在编译 x86 时出现命令行错误
- Bullet Physics源代码未在X86中构建 - Visual Studio 2017中错误的预处理器指令
- LNK2001在X64环境中的编译代码上看到的错误.但是,该代码在X86环境中填充了罚款
- 致命错误LNK1112:通过 vcvarsall .bat x86 运行构建'X86'模块计算机类型'x64'与目标计算机类型冲突
- QtGui4.lib(QtGui4.dll):致命错误LNK1112:模块计算机类型"X86"与目标计算机类型"x64"冲突
- Visual C 2012(x86)中可能的编译器错误
- x86逻辑地址语法错误
- Solaris 5.10 x86 CC链接器错误:ld:致命:找不到库-lcryptoki:
- C:x86 英特尔内在函数对 _mm_log2_ps() -> 错误的用法:不兼容的类型"int"?
- C++中的指针和对象,x86 编译错误
- x86 上的 Android NDK 和 STL 相关参考错误
- 链接错误:QtCore.framework/Versions/4/QtCore for Architecture x86
- 错误0xc000007b:试图在没有VS的计算机上运行编译为Release x86的C++.exe文件
- 没有规则来使目标"类.cpp,"构建/..."需要x86/class.o' 停止。乌班图中的错误
- 用于调试X86构建的Visual Studio链接器错误
- 将c++项目类型从x86更改为x64后的链接器错误
- msvcprtd.lib(MSVCP100D.dll):致命错误LNK1112:模块计算机类型"X86"与目标计算机类型"x64"冲突
- LNK2019错误:在x64机器上使用x86库