平台: VMware上装的Ubuntu-15.10

环境准备工作:装Fortran, lapack, blas, cblas (理论上装好lapack后面两个应该是自动的),其他的有需要的随时安装就可以

=====  开始编译 =====

cd到CorrsTmplt的目录

1. sleep的error

在命令行执行

make

此时,出现error

FileManagement.cpp:25:25: error: ‘sleep’ was not declared in this scope
sleep(checkEveySeconds);

解决方案:在FileManagement.cpp文件的引用中加入

#include <unistd.h>

保存后再次 make

出现类似的错误:

LinAlg.cpp:41:25: error: ‘sleep’ was not declared in this scope
sleep(checkEveySeconds);

道理是一样的,找到LinAlg.cpp文件,在引用中加入

#include <unistd.h>

保存后再次make

2. stderr,fprintf was not declared

这次make后出现了新的错误:

LinAlgMatrixComplex.cpp:340:11: error: ‘stderr’ was not declared in this scope
fprintf(stderr, "[ERROR] Error solving system of equations: %d\n", info);

这个也不难,找到LinAlgMatrixComplex.cpp文件,在引用中加入

#include <stdio.h>

保存后,make

3. NULL was not declared

make后出现新的错误:

VKGraph.h:60:51: error: ‘NULL’ was not declared in this scope

找到VKGraph.h,在引用中加入

#include <cstdlib>

保存后,继续make

4. fopen, fwrite... was not declared in this scope

make后出现了新的error,好开心哦~!

Clustering.cpp:118:36: error: ‘fopen’ was not declared in this scope

找到Clustering.cpp, 在引用中加入

#include <stdio.h>

保存后,接着make

(不是在make就是在走向make的路上,且make且珍惜。。。)


5. 找不到类型

make后出现如下error

GCoptimization.h:389:16: error: ‘ptrdiff_t’ does not name a type

找到GCoptimization.h,在引用部分(不是文件头部哦,在靠近中间的地方)加入

#include <cstddef>

保存后,继续make

6. add_edge, add_tweights was not declared in this scope

当然不会这么简单让你make成功啦~~这次又出现了长成下面这个样子的一系列error:

energy.h:220:14: error: ‘add_tweights’ was not declared in this scope

不要怕!打开energy.h

把所有的 add_edge 都替换成 this->add_edge

把所有的 add_tweights 都替换成 this->add_tweights

注意,已经有this->就不要再加了哦~

保存后,make

又来error

energy.h:328:89: error: ‘what_segment’ was not declared in this scope

哦,有漏网之鱼啊,找到这一行,在what_segment前面加上this-> 变成this->what_segment

保存,继续make吧~~

7.  redeclaration

新的error

VisModel3D.cpp:378:7: error: redeclaration of ‘int matID’

这个简单,找到那一行,注释掉就行

保存,继续make

8. redeclaration

出现error:

VisShapeTemplateDraw.cpp:594:12: error: redeclaration of ‘R3Point p’

找到这个文件的594行,

原来是长这样:

R3Point p = pnts->PointPosition(gid);

model2cam.Apply(tpnt);
model2cam.Apply(p); glColor3d(., ., .);
glVertex3d(p.X(), p.Y(), p.Z());
glColor3d(., ., .);
glVertex3d(tpnt.X(), tpnt.Y(), tpnt.Z());
edges.push_back(tpnt);
edges.push_back(p);

把p替换成point,修改后长这样:

R3Point point = pnts->PointPosition(gid);

model2cam.Apply(tpnt);
model2cam.Apply(point); glColor3d(.2, .2, .2);
glVertex3d(point.X(), point.Y(), point.Z());
glColor3d(.2, 1., .2);
glVertex3d(tpnt.X(), tpnt.Y(), tpnt.Z());
edges.push_back(tpnt);
edges.push_back(point);

注意,594行之前的p不要替换哦~

保存后,接着make

9. 各种undefined references to ...

这时候似乎出现了逆天的bug...前方一大波undefined reference to...向我走来,伦家好害怕!!

这个error可能长这样:

ShapePointCloud.cpp:(.text+0xfc9): undefined reference to `R3Vector::Length() const'

实际上会有更多的这个link error,仔细观察一下,发现这些link error都是发生在对R3***或者相关的引用上面。

R3***在什么地方呢?找一下,发现它们在/external/gaps/pkgs 中,由于某种不可知的原因,这些东西似乎木有编译成功。。

阅读一下gaps目录下的README.txt,上面告诉我们可以在这个目录下进行一下make。试一下~~

cd 到 CorrsTmplt/external/gaps ,先后执行:

make clean

make

再回到CorrsTmplt目录下,make一下

到这里,编译就已经结束了……那是不可能滴。

革命尚未成功。。。继续

10. error: expected type-specifier

保证这是最后一个error哈~~

这次make后那一大堆莫名其妙的undefined reference已经没有了,但是出现了下面的error

EvalCorrs.cpp:113:27: error: expected type-specifier

EvalCorrs.cpp:340:27: error: expected type-specifier

你以为这样就会击垮我吗?Naive~~

打开EvalCorrs.cpp,找到113行和340行

ModelDatabase * db = new ModelDatabase::ModelDatabase();

替换成

ModelDatabase * db = new ModelDatabase();

保存,make

yeah~~~居然没有error了??哈哈,这样整个编译就结束啦~~

打开CorrsTmplt/bin/x86_64,可以看到9个可执行文件,说明编译成功啦。

下一步就是要怎么使用这份源码了,会用了再来写~!

Learning part-based templates from large collections of 3D shapse CorrsTmplt Kim 代码调试的更多相关文章

  1. 三维重建项目:Photo Tourism: Exploring Photo Collections in 3D

    项目地址:http://phototour.cs.washington.edu/ Photo Tourism是华盛顿大学的SFM重建的过程 Paper:Photo Tourism: Exploring ...

  2. Look Further to Recognize Better: Learning Shared Topics and Category-Specific Dictionaries for Open-Ended 3D Object Recognition

    张宁 Look Further to Recognize Better: Learning Shared Topics and Category-Specific Dictionaries for O ...

  3. Mongoid Paging and Iterating Over Large Collections

    遍历数据库中的所有记录时,我们首先想到的是Model.all.each.但是,当数据量很大的时候(数万?),这就不怎么合适了,因为Model.all.each会一次性加载所有记录,并将其实例化成 Mo ...

  4. Learning ROS: Roslaunch tips for large projects

    Design tip: Top-level launch files should be short, and consist of include's to other files correspo ...

  5. Guava 教程1-使用 Google Collections,Guava,static imports 编写漂亮代码

    原文出处: oschina (API:http://ifeve.com/category/framework/guava-2/ JAR DOC Source 链接:http://pan.baidu.c ...

  6. 类Collections的静态方法的使用(代码)

    package cn.itcast.p2.toolclass.collections.demo; import java.util.ArrayList; import java.util.Collec ...

  7. webstorm的live templates快速编辑功能,让你的css JS代码书写速度飞起来

    前言: Emmet的前身是大名鼎鼎的Zen coding,如果你从事Web前端开发的话,对该插件一定不会陌生.它使用仿CSS选择器的语法来生成代码, 大大提高了HTML/CSS代码编写的速度,比如下面 ...

  8. Introduction to statistical learning:with Applications in R (书,数据,R代码,链接)

    http://faculty.marshall.usc.edu/gareth-james/ http://faculty.marshall.usc.edu/gareth-james/ISL/

  9. 20155316 2016-2017-2 《Java程序设计》第2周学习总结

    教材学习内容总结 学习主要内容:基本类型介绍及流程控制简介 关键点:关键记住JAVA的大体框架,可以类比C语言结合着记.相较于C不同且值得关注的主要信息有: 基本类型的不同:byte.boolean. ...

随机推荐

  1. POJ1743 Musical Theme [后缀自动机]

    题意:不重叠最长重复子串 后缀数组做法:http://www.cnblogs.com/candy99/p/6227659.html 后缀自动机的话,首先|Right|>=2 然后min(t[u] ...

  2. 面向对象编程总结--Python

    万物皆为对象.自然环境赋予人类无尽的遐想,而面向对象编程之思想就是来自于大自然.自然界,类和对象比比皆是,比如:鸟类和麻雀,鱼和鲤鱼......其中鸟类就是各种鸟的总称,而麻雀只不过是其中之一(对象) ...

  3. IDA学习笔记 函数调用约定

    stdcall和cdecl: stdcall和cdecl 压栈方向都是从右到左 区别在于c约定是调用方在函数返回后add esp,n指令清除堆栈中的参数,而stdcall在被调函数内使用ret n来清 ...

  4. JaveScript函数(JS知识点归纳六)

    1.函数的基本使用 a)作用:代码的复用,灵活性比较强 b)声明方式:function 名 (形参){函数体} c)调用: 名(实参); d)封装函数--书写一个函数的结构,而且放入一些功能,在需要使 ...

  5. 学习Yii框架,有哪些比较好的网站

    1.http://www.yiiframework.com/ 2.http://www.kancloud.cn/curder/yii/247741 3.http://www.manks.top/yii ...

  6. hdu1061(2015-N1):1.快速幂;2.找规律

    1.快速幂 原理:求a的b次方,将b转化为二进制数,该二进制位第i位的权是2^(i-1), 例如 11的二进制是1011 11 = 2³×1 + 2²×0 + 2¹×1 + 2º×1 因此,我们将a¹ ...

  7. SharedPreferences封装类

    最近一直在读马伟奇老师的简书,给人以不一样的感觉,接下来的时间会做做笔记,毕竟好东西变成自己的才有用 原文地址SharedPreferencesUtils 依赖 dependencies { comp ...

  8. hdu 2047递推

    A[N]表示以E或者F结尾的情况下的方案数,B[N]表示以O结尾的情况下的方案数,F[N]=3*A[N-1]+2*B[N-1] 同时,A[N]=2*B[N-1]+2*A[N-1],B[N-1]=A[N ...

  9. HDU - 2181 dfs [kuangbin带你飞]专题二

    保存每个节点的下一个节点一直往下面走就行了,不能重复经过某个点,当经过的点达到20个而且当前节点的下一个节点是起点就打印答案. AC代码 #include<cstdio> #include ...

  10. Redux:从action到saga

    前端应用消失的部分 一个现代的.使用了redux的前端应用架构可以这样描述: 一个存储了应用不可变状态(state)的store 状态(state)可以被绘制在组件里(html或者其他的东西).这个绘 ...