C++ API 数据阶段 0xc000007b

C++ API DataStage 0xc000007b

有没有大佬指点一下如何实现DataStage连接?
API Link: https://www.ibm.com/docs/en/iis/11.3?topic=interfaces-infosphere-datastage-development-kit
我尝试包含 api 但是当我 运行 程序时出现错误:0xc000007b
我哪里弄错了?
谢谢解答!

main.cpp

#include <iostream>
#include "dsapi.h"

int main() {
    DSSetServerParams("domain", "username", "password", "server");
    char* result = DSGetProjectList();
    if(result != NULL)
    {
        printf(result);
    }
    else
    {
        printf(DSGetLastError());
    }
    return 0;
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.15)
project(datastage_api)

set(CMAKE_CXX_STANDARD 17)

add_library(vmdsapi SHARED IMPORTED)
set_target_properties(
        vmdsapi
        PROPERTIES LINKER_LANGUAGE CXX COMPILE_FLAGS "-m32" LINK_FLAGS "-m32"
        IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/lib/vmdsapi.dll
        IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/lib/vmdsapi.lib)

add_library(ACS_client_cpp STATIC IMPORTED)
set_target_properties(
        ACS_client_cpp
        PROPERTIES LINKER_LANGUAGE CXX COMPILE_FLAGS "-m32" LINK_FLAGS "-m32"
        IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/lib/ACS_client_cpp.dll
)

add_library(ACS_common_cpp STATIC IMPORTED)
set_target_properties(
        ACS_common_cpp
        PROPERTIES LINKER_LANGUAGE CXX COMPILE_FLAGS "-m32" LINK_FLAGS "-m32"
        IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/lib/ACS_common_cpp.dll)

add_library(DSCLNT32 STATIC IMPORTED)
set_target_properties(
        DSCLNT32
        PROPERTIES LINKER_LANGUAGE CXX COMPILE_FLAGS "-m32" LINK_FLAGS "-m32"
        IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/lib/DSCLNT32.dll)

add_library(dsrpc32 STATIC IMPORTED)
set_target_properties(
        dsrpc32
        PROPERTIES LINKER_LANGUAGE CXX
        IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/lib/dsrpc32.dll)

add_library(invocation_cpp STATIC IMPORTED)
set_target_properties(
        invocation_cpp
        PROPERTIES LINKER_LANGUAGE CXX
        IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/lib/invocation_cpp.dll)

add_library(xmogrt STATIC IMPORTED)
set_target_properties(
        xmogrt
        PROPERTIES LINKER_LANGUAGE CXX
        IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/lib/xmogrt.dll)

include_directories(${PROJECT_SOURCE_DIR}/inc)
link_directories(${PROJECT_SOURCE_DIR}/lib)

add_executable(datastage_api main.cpp )
set_target_properties(datastage_api PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")

target_link_libraries (datastage_api vmdsapi ACS_client_cpp ACS_common_cpp DSCLNT32 dsrpc32 invocation_cpp xmogrt)

add_custom_command(
        TARGET datastage_api POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy_if_different
        "${PROJECT_SOURCE_DIR}/lib/vmdsapi.dll"
        "$<TARGET_FILE_DIR:datastage_api>")

ProcessMonitor 性能:
正在尝试查找 x64 dll

看起来 wow64.dll 没有 x32 模拟。正确吗?
这个图书馆工作得怎么样?

获取错误:0xc000007b

关闭后我发现线程退出,退出状态为:-1073741701

奇怪的是,在使用的模块中不存在来自 CMakeLists.txt 的 dll 模块:

SFC.DLL
WINTRUST.dll
ntmarta.dll
GrooveIntlResource.d
UIRibbonRes.dll
7-zip.dll
fzshellext_64.dll
TortoiseOverlays.dll
cpwinet.dll
pkivalidator.dll
cpsspap.dll
cpschan.dll
cpadvai.dll
detoured.dll
cpcrypt.dll
Explorer.EXE
ntoskrnl.exe
UIRibbon.dll
DUI70.dll
ucrtbase.dll
msoshext.dll
prremote.dll
ieproxy.dll
werconcpl.dll
wscui.cpl
tiptsf.dll
ShellExImpl.dll
ShellEx.dll
zipfldr.dll
igfxDTCM.dll
WSCAPI.dll
wscinterop.dll
syncui.dll
framedynos.dll
DUser.dll
SyncCenter.dll
bthprops.cpl
srchadmin.dll
cscobj.dll
cscui.dll
EthernetMediaManager
SettingMonitor.dll
NetworkUXBroker.dll
pnidui.dll
PortableDeviceTypes.
wpdshserviceobj.dll
mssprxy.dll
AUDIOSES.DLL
wcmapi.dll
Actioncenter.dll
Syncreg.dll
SHDOCVW.dll
dxp.dll
prnfldr.dll
Windows.UI.Shell.dll
BatMeter.dll
stobject.dll
EhStorShell.dll
NetworkExplorer.dll
GROOVEEX.DLL
ieframe.dll
MSVCP140.dll
MLANG.dll
zlib1_tgit.dll
VCRUNTIME140.dll
VCRUNTIME140_1.dll
gitdll.dll
libgit2_tgit.dll
TortoiseGit.dll
TortoiseGitStub.dll
Windows.Internal.She:20
DDRAW.dll
d3d10_1core.dll
GLU32.dll
OPENGL32.dll
igfxLHM.dll
Windows.Networking.Slease.160715-1
DCIMAN32.dll
d3d10_1.dll
igfxDI.dll
igfxDH.dll
atlthunk.dll
Windows.Security.Aut0410)
wpnprv.dll
Windows.Networking.C42
NotificationObjFacto
wpnapps.dll
Windows.Web.dll
npsm.dll
AboveLockAppHost.dll
NotificationControll
ntshrui.dll
twinui.pcshell.dll
edputil.dll
thumbcache.dll
windows.immersiveshe28.04.20187:2
TwinUI.dll
explorerframe.dll
dataexchange.dll
OLEACC.dll
SndVolSSO.DLL
SharedStartModel.dll
settingsynccore.dll
wwapi.dll
AppVEntSubsystems64.
NotificationControll
settingsyncpolicy.dl
TWINAPI.dll
MSOXEV.DLL
wlidprov.dll
TokenBroker.dll
twinui.appcore.dll
execmodelproxy.dll
DAVHLPR.dll
ntlanman.dll
drprov.dll
WorkFoldersShell.dll
sfc_os.dll
twext.dll
OneCoreCommonProxySt
provsvc.dll
MsftEdit.dll
msiltcfg.dll
NInput.dll
InputSwitch.dll
Geolocation.dll
keepaliveprovider.dl
IDStore.dll
PhotoMetadataHandler
hgcpl.dll
dlnashext.dll
imapi2.dll
BiWinrt.dll
SYNCENG.dll
StructuredQuery.dll
Windows.Storage.Sear
deviceaccess.dll
Windows.Globalizatio
Windows.UI.Immersive
Windows.UI.dll
wincorlib.DLL
gdiplus.dll
ondemandconnroutehel
MPR.dll
msxml6.dll
MrmCoreR.dll
comctl32.dll
ActXPrxy.dll
MFPlat.DLL
WINBRAND.dll
RTWorkQ.DLL
cscapi.dll
StateRepository.Core
Windows.StateReposit
iertutil.dll
srvcli.dll
cdp.dll
urlmon.dll
WININET.dll
winsqlite3.dll
wpncore.dll
VERSION.dll
CHARTV.dll
DevDispItemProvider.
NETAPI32.dll
policymanager.dll
rmclient.dll
dsreg.dll
LocationFrameworkPS.
IconCodecService.dll
ShellExtensionX64.dl
d2d1.dll
SAMLIB.dll
MMDevApi.dll
igc64.dll
XmlLite.dll
npmproxy.dll
igd10iumd64.dll
es.dll
wlanapi.dll
UIAnimation.dll
DEVRTL.dll
d3d11.dll
usermgrcli.dll
wkscli.dll
wintypes.dll
CoreUIComponents.dll
windowscodecs.dll
PortableDeviceApi.dl
hcproviders.dll
wevtapi.dll
netprofm.dll
WMICLNT.dll
PROPSYS.dll
wer.dll
WINHTTP.dll
Secur32.dll
smartscreenps.dll
dhcpcsvc.DLL
dhcpcsvc6.DLL
CoreMessaging.dll
globinputhost.dll
dcomp.dll
MSOHEVI.DLL
MSWB7.dll
wtsapi32.dll
fwpuclnt.dll
Bcp47Langs.dll
WINNSI.DLL
dwmapi.dll
apphelp.dll
nlaapi.dll
sppc.dll
WINMMBASE.dll
SLC.dll
WINMM.dll
pcacli.dll
UxTheme.dll
twinapi.appcore.dll
msvcp110_win.dll
VEEventDispatcher.dl
resourcepolicyclient
DEVOBJ.dll
dxgi.dll
WLDP.DLL
DPAPI.DLL
schannel.DLL
rsaenh.dll
IPHLPAPI.DLL
DNSAPI.dll
netutils.dll
USERENV.dll
mswsock.dll
cpmsi.dll
msi.dll
cryptsp.dll
CRYPTBASE.dll
NTASN1.dll
ncrypt.dll
SspiCli.dll
EventAggregation.dll
sxs.dll
WINSTA.dll
bcrypt.dll
kernel.appcore.dll
profapi.dll
powrprof.dll
KERNELBASE.dll
bcryptPrimitives.dll
ucrtbase.dll
windows.storage.dll
CRYPT32.dll
shcore.dll
msvcp_win.dll
win32u.dll
gdi32full.dll
cfgmgr32.dll
combase.dll
shlwapi.dll
coml2.dll
MSCTF.dll
RPCRT4.dll
msvcrt.dll
ole32.dll
COMDLG32.dll
PSAPI.DLL
sechost.dll
WS2_32.dll
KERNEL32.DLL
IMM32.DLL
GDI32.dll
clbcatq.dll
SETUPAPI.dll
ADVAPI32.dll
NSI.dll
USER32.dll
SHELL32.dll
OLEAUT32.dll
ntdll.dll

您可能需要添加以下两行以确保将您的代码编译为 32 位:

set(CMAKE_C_FLAGS -m32)
set(CMAKE_CXX_FLAGS -m32)

传说说,如果您使用 Eclipse IDE 会自动执行,而 CLion 不一定会执行。