sys/times.h Compiling issue

10 Ansichten (letzte 30 Tage)
Abdelrahman Aldik
Abdelrahman Aldik am 31 Aug. 2021
Hello
I was trying to compile a mex file and I got the following error
>> mex -setup
MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN
>> compileSparseCoLO
Compiling Libraries...Building with 'MinGW64 Compiler (C++)'.
Error using mex
In file included from
C:\Users\Abd-PC\Downloads\SparseCoLO112\SparseCoLO112\mex\ccputime.cpp:26:0:
C:\Users\Abd-PC\Downloads\SparseCoLO112\SparseCoLO112\mex\ccputime.h:28:23: fatal error:
sys/times.h: No such file or directory
#include <sys/times.h>
^
compilation terminated.
Error in compileSparseCoLO (line 81)
eval(command);
I'm not sure where is the problem and how to solve it. I would appreiate your help.
  13 Kommentare
Abdelrahman Aldik
Abdelrahman Aldik am 7 Sep. 2021
Upon usng this line:
MexFlags = ' -O -I"C:\Users\Abd-PC\Downloads\SparseCoLO112\SparseCoLO112" -L"C:\Users\Abd-PC\Downloads\SparseCoLO112\SparseCoLO112\sys" -ltime';
I have received the following error
>> compileSparseCoLO
Current directory is = C:\Users\Abd-PC\Downloads\SparseCoLO112\SparseCoLO112\mex
Cannot find sub-directory "mex"
Execute this script at the top directory of SparseCoLO
>> compileSparseCoLO
Compiling Libraries...Error using mex
MEX cannot find library 'time', specified with the -l option.
MEX searched for a file with one of the following names:
libtime.a
time.lib
libtime.lib
Verify the library name is correct. If the library is not
on the existing path, specify the path with the -L option.
Error in compileSparseCoLO (line 81)
eval(command);
And upon using this line
MexFlags = ' -O -I"C:\Users\Abd-PC\Downloads\SparseCoLO112\SparseCoLO112" "C:\Users\Abd-PC\Downloads\SparseCoLO112\SparseCoLO112\sys\time.obj"';
I received this following error
>> compileSparseCoLO
Compiling Libraries...Building with 'MinGW64 Compiler (C++)'.
MEX completed successfully.
done
Compiling mexForestConvert.cpp...Error using mex
C:\Users\Abd-PC\Downloads\SparseCoLO112\SparseCoLO112\mex\"C:\Users\Abd-PC\Downloads\SparseCoLO112\SparseCoLO112\sys\time.obj"mexForestConvert.cpp
not found; check that you are in the correct current folder, and check the spelling of
'C:\Users\Abd-PC\Downloads\SparseCoLO112\SparseCoLO112\mex\"C:\Users\Abd-PC\Downloads\SparseCoLO112\SparseCoLO112\sys\time.obj"mexForestConvert.cpp'.
Error in compileSparseCoLO (line 93)
eval(command);
I'm not sure what to do next?
Abdelrahman Aldik
Abdelrahman Aldik am 8 Sep. 2021
I have installed Microsoft Visual C++ 2019 and used it to compile the mex file, I got the following error
>> compileSparseCoLO
Compiling Libraries...Building with 'MinGW64 Compiler (C++)'.
MEX completed successfully.
done
Compiling mexForestConvert.cpp...Building with 'Microsoft Visual C++ 2019 (C)'.
Error using mex
LINK : error LNK2001: unresolved external symbol mexFunction
ccputime.lib : fatal error LNK1120: 1 unresolved externals
I would appreciate your help.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by