This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

stat( ) function or equivalent in CCS v3.3

Hi

I am compiling an image compression code on the DSK6713. The code is originally written in C for windows. I am porting the code on the DSP. a large part of code is compatible with standard C and DSP CCS. I am using CCS V3.3. but i am stuck at one part where the code has following include file:

#include <sys/stat.h>

the ccs gives the error : could not open <sys/stat.h>

now the inside of code I have a stat structure and a function stat( ).

basically these are windows C library functions.

the function stat is used to examine the attributes of files. They return the attribute information in a struct stat object. 

function is declared in the header file sys/stat.h.

 int stat (const char *filename, struct stat *buf)
Now here is the listing of a portion of my code where the problem arises:

struct stat status;
int res;

res = stat(PtrStructCodingPara->InputFile, &status);
if (res != 0)
{
return (-1);
}
img_len = status.st_size;

we can clearly see that there is a stat( ) function call and the returning structure is stored in the stat structure named status here.

So can somebody help me how can i implement these windows library functions and structures on DSK6713 in CCS v3.3. these windows header files when included in CCS contain a series of other header files and give error for WIN_32 target only.

i shall be very thankful to you if you tell me a way around.

  • Hi,

    Thanks for your path.

    Please ensure whether the above mentioned include paths and appropriate library paths are added in the CCS project properties. You should see linker file search path in which, you should add the corresponding directories for library search path and include paths, as well, the appropriate libaray file should be linked to it. Also, on the compiler include options, please check whether appropriate include search path is added or not.

    After ensuring the above, please try to build the project and see whether the issue is occuring or not.

    We are working on it and will provide more inputs on this.

    Thanks & regards,
    Sivaraj K

  • Hi Muhammad,

    Muhammad said:

    #include <sys/stat.h>

    the ccs gives the error : could not open <sys/stat.h>

    This error implies that the CCS could not find the file "stat.h" at the path included in the CCS for building your project.

    In CCS-->Project-->properties-->Build-->Compiler-->Include Options--> under "Add dir to #include the search path" --> include the path where the sys/stat.h lies.

     

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------