Having trouble compiling a C code.

Hello Dear MATLAB team and other researchers.
I'm using a software including ".m" files and MATLAB codes but one of its functions is referring to a "C" file (disloc.c) and I'm having trouble using it.
I tried MinGW C/C++ compiler but I face errors l will show at the end.
I would really appreciate it if someone helps me fix this problem.
I'm a student and i'm working on my thises so thanks in advance.
mex disloc_mex.c
{Error using mex
C:\Users\Reza\AppData\Local\Temp\mex_114665193179698_12228\disloc_mex.obj:disloc_mex.c:(.text+0xfa):
undefined reference to `Disloc'
collect2.exe: error: ld returned 1 exit status}
mex disloc_mex.c
1

3 件のコメント

Reza Rahimipour
Reza Rahimipour 2021 年 11 月 22 日
I attached the main file including C files
James Tursa
James Tursa 2021 年 11 月 22 日
You will need to show us the code. That being said, the "implicit int" warning tells us that mexFunction( ) was called prior to defining it, so the C compiler assumed the return value is an int and gave you a warning. This should not happen with properly written code.
Reza Rahimipour
Reza Rahimipour 2021 年 11 月 23 日
The main codes are in a .zip file(60Mb) so I can't send in here. I would really appreciate if I could email it to you I really nedd help with it

サインインしてコメントする。

回答 (1 件)

Mark McBroom
Mark McBroom 2021 年 11 月 23 日

0 投票

You need to provide both the mex C source code and your source code to the mex function:
mex disloc_mex.c disloc.c
Thanks.
Mark.

1 件のコメント

Reza Rahimipour
Reza Rahimipour 2021 年 11 月 23 日
I tried
again errors like before.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMATLAB Compiler SDK についてさらに検索

製品

リリース

R2021b

質問済み:

2021 年 11 月 22 日

コメント済み:

2021 年 11 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by