Help ! I just cannot compile with mex !

Help
2008-02-13
2013-04-26
  • Rafael  March

    Rafael March - 2008-02-13

    Hi,

    I'm trying to compile the file 'ta_sar.c' with mex in Matlab under the comand:

    >> mex ta_sar.c ..\..\lib\ta_libc_cdr.lib

    But i'm getting the following error messages:

    lcc preprocessor error: ta_sar.c:74 Could not find include file "ta_func.h"
    lcc preprocessor error: .\ta_utility.h:12 ta_sar.c:78 Could not find include file "ta_func.h"
    lcc preprocessor error: .\ta_utility.h:16 ta_sar.c:78 Could not find include file "ta_global.h"
    lcc preprocessor error: ta_sar.c:82 Could not find include file "ta_memory.h"
    Error ta_sar.c: .\ta_utility.h: 31  syntax error; found `TA_INT_SMA' expecting `;'
    Error ta_sar.c: .\ta_utility.h: 39  syntax error; found `TA_S_INT_SMA' expecting `;'
    Error ta_sar.c: .\ta_utility.h: 53  syntax error; found `TA_INT_EMA' expecting `;'
    Error ta_sar.c: .\ta_utility.h: 62  syntax error; found `TA_S_INT_EMA' expecting `;'
    Error ta_sar.c: .\ta_utility.h: 77  syntax error; found `TA_INT_MACD' expecting `;'
    Error ta_sar.c: .\ta_utility.h: 89  syntax error; found `TA_S_INT_MACD' expecting `;'
    Error ta_sar.c: .\ta_utility.h: 108  syntax error; found `TA_INT_PO' expecting `;'
    Error ta_sar.c: .\ta_utility.h: 113  missing parameter type
    Error ta_sar.c: .\ta_utility.h: 113  syntax error; found `optInMethod_2' expecting `)'
    Error ta_sar.c: .\ta_utility.h: 113  skipping `optInMethod_2' `,'
    Error ta_sar.c: .\ta_utility.h: 114  syntax error; found `int' expecting `{'
    Error ta_sar.c: .\ta_utility.h: 115  missing identifier
    Error ta_sar.c: .\ta_utility.h: 115  syntax error; found `int' expecting `;'
    Error ta_sar.c: .\ta_utility.h: 116  missing identifier
    Error ta_sar.c: .\ta_utility.h: 116  syntax error; found `double' expecting `;'
    Error ta_sar.c: .\ta_utility.h: 117  missing identifier
    Error ta_sar.c: .\ta_utility.h: 117  too many errors

      C:\MATLAB6P5\BIN\WIN32\MEX.PL: Error: Compile of 'ta_sar.c' failed.

    What should I do ? I really want to use this function !

    Thx,
    Rafael March.

     
    • Pranas

      Pranas - 2008-05-16

      Check how to pass location of HEADER files to your compiler. I may be environment variable (probably INCLUDE for msvc) and/or switch with parameter in mex script for compiler. Also don't forget adding required LIBs e.g. to LIB environment var or some compiler switch with parameter.

      http://lists.trolltech.com/qt-interest/2002-09/thread01094-0.html

      Creating correct compilation environment for MATLAB takes > 1 minute ...

       
  • mlmechtrade

    mlmechtrade - 2010-03-28

    hello pranas_baliuka, I am so glad to find this project. I need this function much. But I don't know how to begin since I know few about c program under matlab with mex. Can you give a startup guide on how to compile the project step by step. I think it will help many beginner and let the project  develop quickly. Thanks very much.

     
  • mlmechtrade

    mlmechtrade - 2010-03-28

    hi,I use nmake -f makefile ,It can run,but every time, it can just produce one .mexwin32 and exit. why?
    THANKS!!

     
  • mlmechtrade

    mlmechtrade - 2010-03-28

    D:\mlmechtrade\ta-lib-mex\generated-mex>nmake

            mex TA_CDLHOMINGPIGEON.c ta_libc_cdd.lib
    'cmd' is not the internal command
    NMAKE : fatal error U1077: “"C:\Program Files\MATLAB\R2008a\bin\mex.BAT"”: return code“0x1”
    Stop.

     
  • r_pankevicius

    r_pankevicius - 2010-04-23

    Sorry for not "such instant" reply.

    I guess we didn't make an assumption about compiling from different drive than matlab is on.
    Try to copy our code to C: (i.e. c:\mlmechtrade\ta-lib-mex) and run make again.

    If you succeeded to compile earlier, please write "your story" as comment here.

    /r

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks