无法解析外部符号:
1 没有添加库, 依赖项等;
2 字符集-->使用多字符集;
应用程序无法正常启动0Xc000007b opencv+vs2010 编译通过,运行出错:要将 dll 放到 exe 的同级目录下!
我犯了一个特别蠢得错误,这里我以为exe在Debug里面,而实际上它在哪个位置是在这里设置的:
属性--> 配置属性--> 常规--> 输出目录 里面
release 也可以调试 : 将C/C++ ---> 优化 禁用即可
Cmake的时候 目录通常应选择include所在文件夹,如 "opencv_Dir" 应选择 include 文件夹所在目录
64位exe和dll在目录c:\windows\system32目录下;
32位exe和dll在目录c:\windows\syswow64目录下;
今天2017.2.12写的程序本来跑一遍下来没有问题,将主要实现部分放到循环里面,遍历文件夹里面的影像
,却发现有问题。找到的原因是要记得释放指针后要赋予NULL, vector也要记得释放, 比如:
指针型: _mm_free(dispLeft); dispLeft = NULL;
向量型:coordinates.clear(); vector
以下内容转发自:http://blog.csdn.net/sunmenggmail/article/details/7853081
在Linux下有两个函数
isnan(x)
isinf(x)
对应在windows下的函数:
_isnan(x)
!_finite(x)
为了跨平台,要么用boost要么这样写:
int isnan(double x) { return x != x; }
int isinf(double x) { return !isnan(x) && isnan(x - x); }
int iserr(double x) {return isnan(x)||isinf(x);}
关于extern的使用:
如果在一个cpp里面定义了一个变量int a = 10; 然后在另外cpp里面想要使用的话(不在此cpp开头的时候把定义了a的cpp加进来的话),在使用的时候先声明一下extern int a;
关于 #include "png++/png.hpp"
需要在 包含目录 和 库目录 以及 链接器中分别 按照图中 进行设置。
然后需要一个 png++ 的包,可以在很多源码中找到这个,比如这位学者的Meshstereo代码:http://chizhang.me/
最近一段时间使用error.hpp老是出现的一个错误:
1>h:\spatial-temporal-stereo-matching\spsstereo\png++\error.hpp(77): error C2784: “std::_Array_iterator<_Ty,_Size> std::operator +(_Array_iterator<_Ty,_Size>::difference_type,std::_Array_iterator<_Ty,_Size>)”: 未能从“const char [3]”为“std::_Array_iterator<_Ty,_Size>”推导 模板 参数
按照 http://blog.csdn.net/bcypxl/article/details/8689317
在error.hpp中添加 #include
代码中有
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t1 = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t1 = std::chrono::monotonic_clock::now();
#endif
编译无法识别出chrono,解决方法是
工程 属性 C/C++ preprocessor 中的preprocessor definitions中添加COMPILEDWITHC11
一定要注意lib跟include的路径是不是一致的,尤其是在某个第三方库经常出现的时候,太多的话一定要弄清楚是哪个,不匹配会带来问题。
https://bbs.csdn.net/topics/390880988
Add this to your PATH environment variables:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
Copy those files:
msobj110.dll
mspdb110.dll
mspdbcore.dll
mspdbsrv.exe
From
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
to
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
Congrats, you _should_ be able to build your project now..