错误C3861:' __ cpuidex':使用Visual Studio 2008构建OpenCV 2.4.11时找不到标识符

时间:2015-05-21 13:22:10

标签: c++ visual-studio opencv visual-studio-2008

由于 OpenCV 2.4.11 没有为 Visual Studio 2008 x64 提供预构建的库,我尝试了(不成功)通过使用 CMake 3.2.2 生成VC9 x64项目来自己构建它们。

在追踪VC的输出时,结果发现问题来自 opencv_core 。构建它时,我收到以下错误:

3>..\..\..\..\..\sources\modules\core\src\system.cpp(257) : error C3861: '__cpuidex': identifier not found

如何使用VC9 x64构建(最好是静态)OpenCV 2.4.11的库来解决这个问题?

顺便说一下,我正在使用 Windows 7 Utimate SP1 x64

这是构建opencv_core时视觉工作室的完整输出:

1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>Deleting intermediate and output files for project 'ZERO_CHECK', configuration 'Debug|x64'
1>Checking Build System
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/3rdparty/zlib/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/3rdparty/libtiff/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/3rdparty/libjpeg/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/3rdparty/libjasper/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/3rdparty/libpng/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/include/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/androidcamera/.androidcamera/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/calib3d/.calib3d/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/contrib/.contrib/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/core/.core/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/dynamicuda/.dynamicuda/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/features2d/.features2d/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/flann/.flann/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/gpu/.gpu/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/highgui/.highgui/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/imgproc/.imgproc/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/java/.java/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/legacy/.legacy/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/ml/.ml/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/nonfree/.nonfree/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/objdetect/.objdetect/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/ocl/.ocl/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/photo/.photo/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/python/.python/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/stitching/.stitching/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/superres/.superres/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/ts/.ts/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/video/.video/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/videostab/.videostab/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/viz/.viz/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/world/.world/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/core/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/flann/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/imgproc/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/highgui/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/features2d/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/calib3d/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/ml/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/video/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/legacy/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/objdetect/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/photo/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/gpu/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/nonfree/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/contrib/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/stitching/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/superres/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/ts/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/modules/videostab/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/doc/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because C:/Users/MY_USER_NAME/Downloads/opencv/cmake_build/x64/vc9/data/CMakeFiles/generate.stamp is up-to-date.
1>Build log was saved at "file://c:\Users\MY_USER_NAME\Downloads\opencv\cmake_build\x64\vc9\ZERO_CHECK.dir\Debug\BuildLog.htm"
1>ZERO_CHECK - 0 error(s), 0 warning(s)
2>------ Rebuild All started: Project: zlib, Configuration: Debug x64 ------
2>Deleting intermediate and output files for project 'zlib', configuration 'Debug|x64'
2>Building Custom Rule C:/Users/MY_USER_NAME/Downloads/opencv/sources/3rdparty/zlib/CMakeLists.txt
2>CMake does not need to re-run because C:\Users\MY_USER_NAME\Downloads\opencv\cmake_build\x64\vc9\3rdparty\zlib\CMakeFiles\generate.stamp is up-to-date.
2>Compiling...
2>adler32.c
2>zutil.c
2>uncompr.c
2>trees.c
2>inffast.c
2>inftrees.c
2>infback.c
2>inflate.c
2>gzwrite.c
2>gzread.c
2>gzlib.c
2>gzclose.c
2>deflate.c
2>crc32.c
2>compress.c
2>Generating Code...
2>Creating library...
2>Build log was saved at "file://c:\Users\MY_USER_NAME\Downloads\opencv\cmake_build\x64\vc9\3rdparty\zlib\zlib.dir\Debug\BuildLog.htm"
2>zlib - 0 error(s), 0 warning(s)
3>------ Rebuild All started: Project: opencv_core, Configuration: Debug x64 ------
3>Deleting intermediate and output files for project 'opencv_core', configuration 'Debug|x64'
3>Building Custom Rule C:/Users/MY_USER_NAME/Downloads/opencv/sources/modules/core/CMakeLists.txt
3>CMake does not need to re-run because C:\Users\MY_USER_NAME\Downloads\opencv\cmake_build\x64\vc9\modules\core\CMakeFiles\generate.stamp is up-to-date.
3>Compiling...
3>opencv_core_pch.cpp
3>Compiling...
3>tables.cpp
3>system.cpp
3>..\..\..\..\..\sources\modules\core\src\system.cpp(257) : error C3861: '__cpuidex': identifier not found
3>stat.cpp
3>rand.cpp
3>persistence.cpp
3>parallel.cpp
3>out.cpp
3>opengl_interop_deprecated.cpp
3>opengl_interop.cpp
3>matrix.cpp
3>matop.cpp
3>matmul.cpp
3>mathfuncs.cpp
3>lapack.cpp
3>gpumat.cpp
3>gl_core_3_1.cpp
3>glob.cpp
3>dxt.cpp
3>drawing.cpp
3>datastructs.cpp
3>Generating Code...
3>Compiling...
3>copy.cpp
3>convert.cpp
3>cmdparser.cpp
3>array.cpp
3>arithm.cpp
3>alloc.cpp
3>algorithm.cpp
3>Generating Code...
3>Build log was saved at "file://c:\Users\MY_USER_NAME\Downloads\opencv\cmake_build\x64\vc9\modules\core\opencv_core.dir\Debug\BuildLog.htm"
3>opencv_core - 1 error(s), 0 warning(s)
========== Rebuild All: 2 succeeded, 1 failed, 0 skipped ==========

最后,我还为 Visual Studio 2013 生成了另一个项目,但这次构建成功了......

1 个答案:

答案 0 :(得分:3)

我今天遇到了同样的问题。我碰巧看到了谷歌的问题。

我有两个桌面VS 2008;我使用的前一个似乎没问题(我稍后会检查出来,暂时不在手边),但我现在使用的那个却无法实现。

我唯一记得的是,你的VS 2008有SP1升级吗? 如果我的内存正常,我将SP1包安装到我以前的计算机上。在检查以前的设置后,我会评论或更新答案。

/ *附加消息* /

是的,请安装SP1并再试一次!希望你能成功!