Problem with compiling mex with gcc-4.7

2 ビュー (過去 30 日間)
Bulat Khusainov
Bulat Khusainov 2015 年 9 月 24 日
回答済み: Dasharath Gulvady 2015 年 9 月 28 日
I am trying to compile a c-file using the command
mex file_name.c
In windows 7 everything works fine. However, in Ubuntu I get the following warnings:
  • warning: implicit declaration of function ‘TCPclient_wrap’ [-Wimplicit-function-declaration]
  • warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
  • warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
And the compiled mex file is not working properly.
I am using gcc-4.7 compiler as recommended. Other c-files are compiled fine from Ubuntu with gcc-4.7.
I am attaching the files, that I am trying to compile.

回答 (1 件)

Dasharath Gulvady
Dasharath Gulvady 2015 年 9 月 28 日
Bulat,
The warnings might not be specific to MEX files, but may be related to the difference between C/C++ compilers in Windows and GCC compiler.
1. You might be missing function prototypes in your code.
2. You might not be using the right header files.

カテゴリ

Help Center および File ExchangeWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by