opencv做三维重构程序调试中出现的问题解决方案

    xiaoxiao2021-03-25  62

    1.opencv和OpenGL的配置

    参考牧野的博客OpenGL+VS2012编译环境配置:http://blog.csdn.net/dcrmg/article/details/53049070

    2.OpengGL 在配置时 出现__imp____glutInitWithExit@12 或__imp____glutCreateWindowWit

     

    unresolved external symbol __imp____glutInitWithExit@12 unresolved external symbol__imp____glutCreateWindowWithExit@8 I have the folling files in the following locations: - glut.h glu.h gl.h C:\Program Files\Microsoft Visual Studio 8\VC\include\GL glut.32.lib C:\Program Files\Microsoft Visual Studio 8\VC\lib glut32.dll glu32.gll C:\WINDOWS\system32 I make a new project (Win32 Console App). Set the Additional Dependencies under Project | Properties | Config Properties | Linker | Input I have: - opengl32.lib glu32.lib glut32.lib This is basically what just about every site I look at tells me to do. So I copy over some code that I know compiles and runs under my Dev C++ setup... And it fails to compile with the following errors: - 1>main.obj : error LNK2019: unresolved external symbol __imp____glutInitWithExit@12 referenced in function _glutInit_ATEXIT_HACK@8 1>main.obj : error LNK2019: unresolved external symbol __imp____glutCreateWindowWithExit@8 referenced in function _glutCreateWindow_ATEXIT_HACK@4 This is didn't happen a little while ago, as I was trying to solve a previous problem. This was that when I tried to run a successfully compiled program, an error would say: - The procedure entry point __glutInitWithExit could not be located in the dynamic link library glut32.dll solution: Try define the following line right before including the header, glut.h. #define GLUT_DISABLE_ATEXIT_HACK

    3.运行出现问题:无法启动此程序因为计算机丢失glut32.dll

    将下载的压缩包解开,将得到5个文件(glut.dll, glut32.dll, glut.lib, glut32.lib,glut.h)

    1)把glut.h复制到x:\Program Files\Microsoft\Visual Studio 10.0\VC\include\gl文件夹中,如果没有gl这个文件夹则可以自己新建一个。(x是你安装VS的盘符号)

    2)把解压得到的glut.lib和glut32.lib放到静态函数库所在文件夹(即与include并排的lib文件夹下)。

    3)把解压得到的glut.dll和glut32.dll放到操作系统目录下面的system32文件夹内。(典型的位置为:C:\Windows\System32)

    (注:如在开发应用程序时用到OpenGL辅助库函数,则还需下载相应动态链接库,包含glaux.dll, glaux.lib, glaux.h,相应步骤同上)

     解决方法:如果是windows7 32位系统,那么上述环境配置已经完成。如果是64位系统话按照上述设置,当编译一个程序是会图示错误“无法启动此程序,因为计算机中丢失glut32.dll。。。”。问题出在第(3)步,这时应该将glut.dll和glut32.dll放到操作系统目录下面的C:\Windows\SysWOW64文件夹内,这时再编译就没有问题了。

     

    转载请注明原文地址: https://ju.6miu.com/read-32888.html

    最新回复(0)