mex compile of a .c code for SIMULINK, using __timeb64

Hi,
I'm trying to make a code for SIMULINK which can use __timeb64 to get timing information and have it compile for use in SIMULINK as a s-function. I'm starting off with the example 'timestwo.c' and placed the call to __timeb64 @ line 70 in the code link below. I also included the necessary libraries (<sys/timeb.h>,<sys/types.h>, time.h)
https://gist.github.com/1061629
When I attempt to compile (in MATLAB using mex timestwo.c) I get the error:
Error timestwo.c: 70 undefined size for `incomplete struct __timeb64 defined at timestwo.c 70 timebuffer' 1 errors, 0 warnings
C:\PROGRA~1\MATLAB\R2009A\BIN\MEX.PL: Error: Compile of 'timestwo.c' failed.
??? Error using ==> mex at 218 Unable to complete successfully.
Any ideas? I'm stuck! (New to compiling .mex functions).
Thanks for any help!
JR

7 Comments

Please post the relevant code. I do not like to open an unknown link with a cyptic name. And as far as I can see, the problem concerns a single line only.
What compiler have you setup for MEX? Also, please post the verbose build log (compile with mex -v option).
Why do you bother to ask, if you do not care about our questions for clarification? If you are on holidays: Have a nice time!
Jan,
my sincere apologies, I have typically been sent an email when there was a response, I didn't think to check the original post. I was able to correct the problem by changing '__timeb64' to '_timeb'. Thanks again for the help!
Kaustubha,
I'm using MATLAB's default compiler, lcc.
JR
One last thing Jan, github is a commonly used place to post source codes, many forums consider it bad practice to post the entire code (perhaps MATLAB answers is not that type), it is a convenient place to share code.
John, perhaps you could add it to the list of upload sites, http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
@John: Ok, I did not know github before. Usually it is more efficient to post the relevant lines of the code directly. because the readers do not have to trust the link, download a file and open it in an editor.
Hopefully there will be an email notification about new comments in the future. Obviously my "OP has left the building" prejudice was wrong. There was a discouraging number of *other* users, who asked a question, but did not care about comments and answers.

Sign in to comment.

 Accepted Answer

Repeating my solution which was posted as a comment (not answer):
"I was able to correct the problem by changing '__timeb64' to '_timeb'."

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!