Calling a C function from MATLAB
古いコメントを表示
Hello,
I have one question: While I successfully create a dll file for my C file via MinGW, whenever I call my file with certain parameters I keep getting an error that is related to that this code in C returns NULL , any ideas please?
#ifdef WINDOWS
hLibrary = LoadLibrary ("fcnsuite.dll");
#else
hLibrary = dlopen ("./fcnsuite.so", RTLD_NOW);
#endif
And this gives "failed to load procedure"!!!
6 件のコメント
Walter Roberson
2013 年 4 月 22 日
Does your C code have a "return" statement? http://msdn.microsoft.com/en-us/library/sta56yeb%28v=vs.80%29.aspx
seldeeno
2013 年 4 月 22 日
Friedrich
2013 年 4 月 23 日
"failed to load procedure" is not a standard C error. Seems more like a selfmade error somewhere in your code (I would guess when you call GetProcAdress which fails). Are you sure the LoadLibrary call works? So the DLL can be found? Is hLibrary a valid pointer?
seldeeno
2013 年 4 月 23 日
Jan
2013 年 4 月 23 日
In which folders does LoadLibrary look for this dll-file?
seldeeno
2013 年 4 月 23 日
回答 (1 件)
seldeeno
2013 年 4 月 23 日
0 投票
1 件のコメント
Victor Hugo Cantú
2018 年 9 月 20 日
please give more details about how you fixed this problem. at the end, the problem was in matlab or when compiling this:
gcc -c fcnsuite.c -DWINDOWS
dllwrap -o fcnsuite.dll fcnsuite.o
I really want to have access to this files. Thanks in advance
カテゴリ
ヘルプ センター および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!