How is compiling a C code in matlab?

2 ビュー (過去 30 日間)
Azade Jamshidi
Azade Jamshidi 2019 年 1 月 2 日
I am using ASAMIN package, a matlab gateway for ASA (adaptive simulated annealing).
ASAMIN and ASA Packages are available in http://ssakata.sdf.org/software/ and http://ingber.com, respectively.
The manual for ASAMIN is available in http://www.diva-portal.org/smash/get/diva2:18667/fulltext01 .
Based on The manual, I made following code in command line:
>> mex asamin.c asa.c -DUSER_ACCEPTANCE_TEST -DUSER_ASA_OUT -DDBL_MIN=2.2250738585072014e-308
Matlab return me following error. Please find the issue.
>> mex asamin.c asa.c -DUSER_ACCEPTANCE_TEST -DUSER_ASA_OUT -DDBL_MIN=2.2250738585072014e-308
Building with 'MinGW64 Compiler (C)'.
E:\asamin\asamin.c: In function 'mexFunction':
E:\asamin\asamin.c:467:39: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
USER_ASA_OPTIONS->Acceptance_Test = user_acceptance_test;
^
E:\asamin\asamin.c:935:33: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
matlab_cost_func_prhs[1 + i] = prhs[6 + i];
^
E:\asamin\asamin.c:955:33: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
matlab_cost_func_prhs[3 + i] = prhs[6 + i];
^
Error using mex
E:\asamin\asa.c: In function 'accept_new_state':
E:\asamin\asa.c:4503:12: error: 'USER_DEFINES {aka struct <anonymous>}' has no member named 'Acceptance_Fit'
OPTIONS->Acceptance_Fit (current_generated_state->cost,
^
E:\asamin\asa.c: In function 'asa_test_asa_options':
E:\asamin\asa.c:6491:14: error: 'USER_DEFINES {aka struct <anonymous>}' has no member named 'Acceptance_Fit'
if (OPTIONS->Acceptance_Fit == NULL) {

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by