下载到开发包了,遇见如下挠头的问题:
编译StereoAPI工程时,出现很多链接错误,以前编译directshow sdk的时候会出现链接错误,那会基本都是unicode编译类型之类问题引起的。这次自己解决不了了,向您请教:
1>StereoAPIApp.obj : error LNK2019: unresolved external symbol "long __cdecl DXUTCreateWindow(wchar_t const *,struct HINSTANCE__ *,struct HICON__ *,struct HMENU__ *,int,int)" (?DXUTCreateWindow@@YAJPB_WPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z) referenced in function _WinMain@16
1>StereoAPIApp.obj : error LNK2019: unresolved external symbol "public: __thiscall CDXUTMesh::CDXUTMesh(wchar_t const *)" (??0CDXUTMesh@@QAE@PB_W@Z) referenced in function "void __cdecl InitApp(void)" (?InitApp@@YAXXZ)
1>StereoAPIApp.obj : error LNK2019: unresolved external symbol "public: long __thiscall CDXUTDialog::AddStatic(int,wchar_t const *,int,int,int,int,bool,class CDXUTStatic * *)" (?AddStatic@CDXUTDialog@@QAEJHPB_WHHHH_NPAPAVCDXUTStatic@@@Z) referenced in function "void __cdecl InitApp(void)" (?InitApp@@YAXXZ)
1>StereoAPIApp.obj : error LNK2019: unresolved external symbol "public: long __thiscall CDXUTListBox::AddItem(wchar_t const *,void *)" (?AddItem@CDXUTListBox@@QAEJPB_WPAX@Z) referenced in function "void __cdecl InitApp(void)" (?InitApp@@YAXXZ)
编译StereoAPI工程时,出现很多链接错误,以前编译directshow sdk的时候会出现链接错误,那会基本都是unicode编译类型之类问题引起的。这次自己解决不了了,向您请教:
1>StereoAPIApp.obj : error LNK2019: unresolved external symbol "long __cdecl DXUTCreateWindow(wchar_t const *,struct HINSTANCE__ *,struct HICON__ *,struct HMENU__ *,int,int)" (?DXUTCreateWindow@@YAJPB_WPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z) referenced in function _WinMain@16
1>StereoAPIApp.obj : error LNK2019: unresolved external symbol "public: __thiscall CDXUTMesh::CDXUTMesh(wchar_t const *)" (??0CDXUTMesh@@QAE@PB_W@Z) referenced in function "void __cdecl InitApp(void)" (?InitApp@@YAXXZ)
1>StereoAPIApp.obj : error LNK2019: unresolved external symbol "public: long __thiscall CDXUTDialog::AddStatic(int,wchar_t const *,int,int,int,int,bool,class CDXUTStatic * *)" (?AddStatic@CDXUTDialog@@QAEJHPB_WHHHH_NPAPAVCDXUTStatic@@@Z) referenced in function "void __cdecl InitApp(void)" (?InitApp@@YAXXZ)
1>StereoAPIApp.obj : error LNK2019: unresolved external symbol "public: long __thiscall CDXUTListBox::AddItem(wchar_t const *,void *)" (?AddItem@CDXUTListBox@@QAEJPB_WPAX@Z) referenced in function "void __cdecl InitApp(void)" (?InitApp@@YAXXZ)
是的,nvidia官网上给出的lib库和它工程中调用的函数的接口不同,因此有上面的错误。上面的链接错误排除了,接着在要运行时出现错误:弹出对话框:
Unable to start program 'd:\stereoapi\demos\direct3d9\bin\debug\StereoAPI.exe'
This application has failed to start because the application configuration is incorrect. Review the manifest file for possible errors. Reinstalling the application may fix this problem. For more details. please see the application event log.下载到的源码的工程文件configuration 有两种:Debug Multithreaded Dll 和Release Multithreaded Dll;
在网上搜了一下资料,说是出现上面错误的原因和Runtime Library 有关,我也分别试验了上面的几种:Multi-threaded Debug DLL,Multi-threaded等等,问题依然存在;
各位高人给出出主意吧,先谢谢了;
1.打开工程属性页(工程->属性)
2.将最上面的组态改为Release
3.选中左面树状菜单中的 组态属性->一般,将右面的工程预设值下的MFC库设置为使用MFC静态库
4.点最上面的组态管理员,使用中的方案组态下拉菜单中选中Release
5.关闭属性页
生成程序时,点菜单中的 生成 -〉生成**即可
这样生成的可执行文件便可以在别的机器上运行了,无须再拷贝任何DLL另外,你要确认nvidia所提供的DLL也在程序目录中或系统目录中。但是要方便的话,还是安装完整的库文件包比较好:微软网站上发布的vc8的runtime发布包的以及安装的vc2005里面带的包。总之,你能编译的话,说明你的系统的配置是正确的,在别的机器上不能运行是因为缺少库文件,最笨的方法是将VC也在该机器上安装一遍,并安装nvidia相关的SDK或可以单独使用的DLL文件。