C++ 架构x86_64的Apple Mach-0链接器id错误和未定义符号
我的代码运行正常,我决定重命名cpp和hpp文件,但没有找到,然后我尝试更改生成设置/库搜索路径,现在找到了 但它显示了架构x86_64的错误定义符号: “摄影机::查找圆(摄影机::弯月面查找器上下文&”, 标准::_1::deque>&)”,引用自: _main中的main.oC++ 架构x86_64的Apple Mach-0链接器id错误和未定义符号,c++,xcode,linker,C++,Xcode,Linker,我的代码运行正常,我决定重命名cpp和hpp文件,但没有找到,然后我尝试更改生成设置/库搜索路径,现在找到了 但它显示了架构x86_64的错误定义符号: “摄影机::查找圆(摄影机::弯月面查找器上下文&”, 标准::_1::deque>&)”,引用自: _main中的main.o ld:找不到架构x86_64的符号 叮当声:错误:链接器命令失败,退出代码为1(使用-v查看 调用) 这是我的代码: source.hpp #ifndef source_hpp #define so
ld:找不到架构x86_64的符号 叮当声:错误:链接器命令失败,退出代码为1(使用-v查看 调用) 这是我的代码:
source.hpp
#ifndef source_hpp
#define source_hpp
#include <iostream>
#include <list>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <cmath>
#include <deque>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <float.h>
#include <sys/time.h>
/*!
* @brief Models a camera which can provide an array of Rays
*
* dist_coeff: (k1, k2, p1, p2, k3, k4, k5, k6)
*/
class Camera {
public:
Camera ();
struct uint8_image_t {
uint32_t w;
uint32_t h;
uint8_t *data;
};
typedef struct uint8_image_t uint8_image_t;
struct int8_image_t {
uint32_t w;
uint32_t h;
int8_t *data;
};
typedef struct int8_image_t int8_image_t;
struct uint16_image_t {
uint32_t w;
uint32_t h;
uint16_t *data;
};
typedef struct uint16_image_t uint16_image_t;
struct int16_image_t {
uint32_t w;
uint32_t h;
int16_t *data;
};
typedef struct int16_image_t int16_image_t;
struct meniscus_finder_context {
uint8_t bright_ring_threshold;
double threshold_fraction;
uint32_t cent_x;
uint32_t cent_y;
double_t cam_tilt;
double_t edge_points_percent;
double_t circle_x;
double_t circle_y;
double_t circle_r;
uint8_image_t *input_image;
uint8_image_t *mask_image;
uint8_image_t *output_image;
uint8_image_t *dilation_kernel;
uint8_image_t *threshold_mask_image;
uint8_image_t *temp_image;
uint16_image_t *temp16_uimage;
int8_image_t *kernel33v_image;
int8_image_t *kernel33h_image;
int16_image_t *grad_x_image;
int16_image_t *grad_y_image;
int16_image_t *outward_x_image;
int16_image_t *outward_y_image;
int16_image_t *dot_product_image;
};
struct edge_point_t {
uint32_t i;
uint32_t j;
double_t v;
};
typedef struct edge_point_t edge_point_t;
void find_circle(meniscus_finder_context &c, std::deque<edge_point_t *> &points);
};
#endif
source.cpp
#include "source.hpp"
#include "cholesky.c"
void Camera :: find_circle(meniscus_finder_context &c, std::deque<edge_point_t *> &points) {
double_t _A_[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
double_t *A[3] = {&_A_[0], &_A_[3], &_A_[6]};
double_t bx[3] = {0, 0, 0};
double cos_tilt = cos(c.cam_tilt * M_PI / 180.0);
double_t x, x2, xy, y, y2, wz, w;
for(int i = 0; i < points.size(); ++i) {
edge_point_t *p = points[i];
x = (double_t(p->j) - double_t(c.cent_x));
y = (double_t(p->i) - double_t(c.cent_y)) / cos_tilt;
w = p->v;
x2 = x*x;
y2 = y*y;
xy = x*y;
wz = w * (x2 + y2);
bx[0] += wz;
bx[1] += wz * x;
bx[2] += wz * y;
A[0][0] += w;
A[0][1] += w * x;
A[0][2] += w * y;
A[1][1] += w * x2;
A[1][2] += w * xy;
A[2][2] += w * y2;
}
A[1][0] = A[0][1];
A[2][0] = A[0][2];
A[2][1] = A[1][2];
solve(A, bx, 3);
c.circle_x = 0.5 * bx[1];
c.circle_y = 0.5 * bx[2];
c.circle_r = sqrt(bx[0] + c.circle_x*c.circle_x + c.circle_y*c.circle_y);
}
source.hpp
#ifndef源水电站
#定义水电站的水源
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
/*!
*@brief制作了一个可以提供光线阵列的相机
*
*地区系数:(k1、k2、p1、p2、k3、k4、k5、k6)
*/
类摄像机{
公众:
摄像机();
结构单元8\u图像\u t{
uint32_t w;
uint32_t h;
uint8_t*数据;
};
typedef struct uint8_image\u t uint8_image\t;
结构int8\u图像\u t{
uint32_t w;
uint32_t h;
int8_t*数据;
};
typedef struct int8_image_t int8_image_t;
结构uint16\u图像\u t{
uint32_t w;
uint32_t h;
uint16_t*数据;
};
类型定义结构uint16_图像uint16_图像;
结构int16\u图像\u t{
uint32_t w;
uint32_t h;
int16_t*数据;
};
typedef struct int16_image\t int16_image\t;
结构弯月面查找器上下文{
uint8亮环阈值;
双阈值_分数;
uint32分;
单位32美分;
双凸轮倾斜;
双边缘点百分比;
双圆;
双t圆;
双圆;
uint8_image_t*输入_image;
uint8_图像_t*遮罩图像;
uint8_image_t*输出_image;
uint8_图像_t*膨胀_核;
uint8_图像_t*阈值_掩码_图像;
uint8_图像_t*临时图像;
uint16图像*temp16图像;
int8_image_t*内核33V_image;
int8_图像_t*内核33H_图像;
int16_图像*grad_x_图像;
int16_图像*grad_y_图像;
int16_图像\u t*向外_x_图像;
int16_图像\u t*向外_y图像;
int16_图像_t*点产品_图像;
};
结构边缘点{
uint32_t i;
uint32_t j;
双t-v;
};
typedef结构边点边点;
无效查找圆(弯月面查找器上下文和c,标准::deque和points);
};
#恩迪夫
source.cpp
#包括“source.hpp”
#包括“cholesky.c”
无效摄影机::查找圆(弯月面查找器上下文和c,标准::deque和points){
double_t_A_[9]={0,0,0,0,0,0,0,0};
double_t*A[3]={&&_A_[0]、&_A_[3]、&_A_[6]};
double_t bx[3]={0,0,0};
双cos_tilt=cos(c.cam_tilt*M_PI/180.0);
双_t x,x2,xy,y,y2,wz,w;
对于(int i=0;ij)-双_t(c.cent_x));
y=(双t(p->i)-双t(c.cent\u y))/cos\u tilt;
w=p->v;
x2=x*x;
y2=y*y;
xy=x*y;
wz=w*(x2+y2);
bx[0]+=wz;
bx[1]+=wz*x;
bx[2]+=wz*y;
A[0][0]+=w;
A[0][1]+=w*x;
A[0][2]+=w*y;
A[1][1]+=w*x2;
A[1][2]+=w*xy;
A[2][2]+=w*y2;
}
A[1][0]=A[0][1];
A[2][0]=A[0][2];
A[2][1]=A[1][2];
求解(A,bx,3);
c、 圆_x=0.5*bx[1];
c、 圆_y=0.5*bx[2];
c、 圆r=sqrt(bx[0]+c.circle\ux*c.circle\ux+c.circle\uy*c.circle\uy);
}
<代码>是否有任何理由来为C++问题滥发C标签?实际上我的源代码和头文件是以前.c和h文件,然后当我重命名时,问题开始了,然后没有找到“iOxField>”,所以我相信可能有一些关联,所以你会理解为什么两种不同的语言不兼容?认真:你应该学习和实践一种语言一次。它不是我的代码,我正在试图修改它,现在我在C++学习阶段,并阅读一些书建议在这里。你知道这个问题吗?