필터 지우기
필터 지우기

How can I load a dll, created in Embarcadero, into Matlab?

조회 수: 2 (최근 30일)
kazinkie
kazinkie 2015년 6월 23일
댓글: Philip Borghesani 2015년 6월 23일
I have created a dll in Embarcadero, but when I try to load it with the loadlibrary() function, I keep getting a message: filename.dll is not a valid Win32 application. The dll is written in C and not C++. I have created the same dll as a C++ dll, but get the same message. I also tried to create in in C++ Builder, but always the same message. The .h file I created for the dll contains the function specifications as follows: extern __declspec(dllexport) void FunctionName(int iPar1, int iPar2, char * pcResult1, char * pcResult2); In the source files of the dll, the winsock2.h file is included. I am not sure if this is part of the problem. I have added the Embarcadero bin/lib/include paths to the system environment variables as well, but it makes no difference. Any help/suggestions would be appreciated.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 6월 23일
Possibly you compiled as x64 but are trying to use it from a 32 bit MATLAB
  댓글 수: 2
kazinkie
kazinkie 2015년 6월 23일
I am using version R2014b which is a 64-bit MATLAB
Philip Borghesani
Philip Borghesani 2015년 6월 23일
How about the other way around? Is the DLL 32 bits? Windows has an idiosyncrasy where all (32 and 64 bit) dlls and programs are called win32 applications and will issue that error when a 64 bit program tries to load a 32 bit dll.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by