2009年10月14日 星期三

[C++]error LNK1104: cannot open file "python25_d.lib"

snap003

(Open Computer Vision Library)

在編譯 OpenCV Debug 模式時, 你可能會像我一樣遇到這個問題. 就是在編譯到一半, 就出現下面的訊息

error LNK1104: cannot open file "python25_d.lib"

發生原因, 似乎是我沒有編譯 python Debug 版本,  可是我不想再去下載 Python 然後重新編譯. (主要是怕 Python 又出現什麼問題).

 

所以我的解法是: 先繞過這個問題.

我的環境是:

1. CMake 2.6

2. Visual Studio 2005

3. OpenCV 2.0 souce code

 

繞過這個問題的方式:

1. 使用 Release Mode 編譯整個 OpenCV --- 完全沒問題

2. 如果想要用 Debug 模式編譯整個 Project

        a. 在 CMake 的 configure 裡面, 把所有關於 python 的編譯選項取消
             (代價: 在 OpenCV 中, 不能使用 python 介面)

              -- 因為我沒使用 python, 所以我的選項是 ‘a’ 

        b. 重新把 Python source code 抓回來用 Debug 模式編譯.

 

Enjoy.

by Jing