简体   繁体   English

'IM003', '[IM003]系统错误126:找不到指定的模块(使用ICU库时)

[英]'IM003', '[IM003] system error 126: The specified module could not be found (When using ICU library)

Building C/C++ code in windows for the first time in my career,在我的职业生涯中第一次在windows中构建 C/C++ 代码,

I need to make a change in a 'legacy' ( odbc ) code to use a new ( ICU , static) library.我需要更改“遗留”( odbc )代码以使用新的( ICU ,静态)库。

I made code changes via Vidual studio (2015) and added include and lib dependncies via project properties.我通过 Vidual studio (2015) 更改了代码,并通过项目属性添加了 include 和 lib 依赖项。

Build (dll) and packaging (msi) is done via a script in command line.构建 (dll) 和打包 (msi) 是通过命令行中的脚本完成的。

If I build the original code base with no changes, application works as expected.如果我构建原始代码库而不做任何更改,应用程序将按预期工作。

As soos as I add minimal ICU related stuff, I get an error:当我添加最少的 ICU 相关内容时,我收到一个错误:

#include <unicode/ucnv.h>
#include <unicode/unistr.h>
#include <unicode/urename.h>
#include <unicode/stringpiece.h>

// Unicode version of SQLExecDirect.
//
SQLRETURN SQL_API SQLExecDirectW(SQLHSTMT   phstmt,
                                    SQLWCHAR* pwCmd,
                                    SQLINTEGER  cchLen)
{
    icu::UnicodeString ustr(pwCmd, cchLen*sizeof(SQLWCHAR));
    //...
}

When I test the build using:当我使用以下方法测试构建时:

import pyodbc
query = 'anything'
statement = f"SELECT '{query}'"
print(statement)
cnxn = pyodbc.connect('Driver={Amazon Redshift ODBC Driver (x64)};Server=xxx;Port=5439;Database=dev;UID=xxx;PWD=xxx')
cursor = cnxn.cursor()
cursor.execute(statement)
val = cursor.fetchall()[0][0]

I get:我得到:

InterfaceError                            Traceback (most recent call last)
xxx\Documents\test.py in line 9
      10 query = 'anything'
      11 statement = f"SELECT '{query}'"
----> 12 cnxn = pyodbc.connect('Driver={Amazon Redshift ODBC Driver (x64)};Server=xxx;Port=5439;Database=dev;UID=xxx;PWD=xxx')
     13 cursor = cnxn.cursor()

    InterfaceError: ('IM003', '[IM003] Specified driver could not be loaded due to system error  126: 
 The specified module could not be found. 
(Amazon Redshift ODBC Driver (x64), C:\\Program Files\\Amazon Redshift ODBC Driver x64\\Drivers\\rsodbc.dll). 
(160) (SQLDriverConnect)')
  • I do not have this problem in Linux.我在Linux没有这个问题。
  • I used dumpbin against rsodbc.dll and it doesn't seem to contain SQLDriverConnect the way it apeared before linking ICU lib(not 100% sure though)我对 rsodbc.dll 使用了dumpbin ,它似乎不包含 SQLDriverConnect 在链接 ICU lib 之前出现的方式(虽然不是 100% 确定)

Any hints plz?有什么提示吗?

Checking my odbc.dll using Dependencies app, I realized that, I also needed to include icuuc70.dll & icudt70.dll in the same folder as my odbc.dll.使用Dependencies应用检查我的 odbc.dll,我意识到,我还需要将 icuuc70.dll 和 icudt70.dll 包含在与我的 odbc.dll.8 相同的文件夹中(i had just linked against icu*.lib files) (我刚刚链接到 icu*.lib 文件)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我尝试在 firebase 存储上导入文件时出现错误 - im getting error when im trying to import file on firebase storage 我在传递缩略图值时使用 firebase 存储的反应代码出现错误,它在 object 上具有名称属性,错误 givin - I'm getting error in my react code im using firebase storage while im passing the thumbnail value and it has name property on that object, error givin 在 Jest 测试中需要库子模块时找不到模块 - Module not found when requiring library submodule in Jest tests 找不到库 libcrypto - The library libcrypto could not be found 使用 SAM cli 和 AWS CDK 在本地调试时,AWS lambda 模块未找到错误? - AWS lambda module not found error when debugging locally using SAM cli and AWS CDK? 我正在尝试编写代码以从 Firebase 获取(文档 ID) - Im trying to write code to get (doc id) from Firebase 找不到模块:当我导入 twilio 显示时无法解析 .net,Nextjs 错误 - Module not found: Can't resolve 'net' when i importing twilio shows,Nextjs error 使用 python pyodbc 库创建 AWS Lambda function 抛出错误“模块‘pyodbc’没有属性‘connect’ - Creating AWS Lambda function using python pyodbc library throw an error "module 'pyodbc' has no attribute ' connect' 错误:在 iOS 上本地找不到 RNFirebase 核心模块 - Error: RNFirebase core module was not found natively on iOS 在 AWS 上使用带有 api 密钥的 2 个阶段时,如何修复无服务器错误“指定的 API 密钥标识符无效”? - How to fix Serverless error "Invalid API Key identifier specified" when using 2 stages with api keys on AWS?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM