英文:
VS2017 building app shows error LNK1181 cannot open input file 'C:\instantclient_19_3\sdk\lib\msvc\oraocci19d.lib
问题
我正在使用VS 2017开发一个传统的MFC应用程序。
我已经安装了Oracle 19.13.0,并下载了intantclient_19_18 SDK包(instantclient-sdk-windows.x64-19.18.0.0.0dbru.zip,从https://www.oracle.com/ca-fr/database/technologies/instant-client/winx64-64-downloads.html下载),并解压到了我的C:文件夹中,所以它安装在了C驱动器中,路径如下:
C:\instantclient_19_18。
然后我转到项目
->属性
->配置属性
->C/C++
->附加包含目录
,并添加了路径到我的C:\instantclient_19_18\sdk\include文件夹。
我还转到项目
->属性
->配置属性
->链接器
->常规
->附加库目录
,并添加了路径到我的C:\instantclient_19_18\sdk\lib\msvc,以告诉链接器在哪里找到Oracle库。
如果我现在构建我的项目,我会得到错误:
LNK1181 无法打开输入文件 'C:\instantclient_19_3\sdk\lib\msvc\oraocci19d.lib
我刚开始学习C++,希望能得到帮助解决这个错误。谢谢。
英文:
I am using VS 2017 for a legacy MFC app.
I have Oracle 19.13.0 installed and I downloaded intantclient_19_18 SDK Package (instantclient-sdk-windows.x64-19.18.0.0.0dbru.zip from https://www.oracle.com/ca-fr/database/technologies/instant-client/winx64-64-downloads.html) and unzipped in my C: folder, so I have it installed in my C drive like:
C:\instantclient_19_18.
Then I went to Project
->Properties
->Configuration Properties
->C/C++
->Additional Include Directories
and add path to my C:\instantclient_19_18\sdk\include folder
I also went to Project
->Properties
->Configuration Properties
->Linker
->General
->Additional Library Directories
and add path to my C:\instantclient_19_18\sdk\lib\msvc to tell the linker where to find Oracle libraries.
If I build my project now, I am getting error:
LNK1181 cannot open input file 'C:\instantclient_19_3\sdk\lib\msvc\oraocci19d.lib
I am just starting to work in C++ and would appreciate help to resolve this error. Thank you.
答案1
得分: 1
错误信息:
>LNK1181 无法打开输入文件 'C:\instantclient_19_3\sdk\lib\msvc\oraocci19d.lib
通常表示以下1个或多个原因:1)路径或文件名不正确,2)您混合使用了32位和64位,或者3)文件损坏。
从下载的命名方式来看,我预计您正在安装64位二进制文件,而您的IDE显示您正在构建32位应用程序。您需要一个32位编译的库,不能混合使用。
英文:
The error:
>LNK1181 cannot open input file 'C:\instantclient_19_3\sdk\lib\msvc\oraocci19d.lib
usually means 1 or more of the following: 1) The path or file name is incorrect, 2) You are mixing 32 and 64 bit, or 3) The file is corrupt.
From the naming of the download I expect that you are installing a 64 bit binary while your IDE shows you are building a 32 bit application. You need a 32 bit compiled library you can not mix and match.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论