cxong / tinydir

Lightweight, portable and easy to integrate C directory and file reader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About how to use it in vs2010 under win7

SJTUsuperxu opened this issue · comments

Hello, the lib is fantastic.
I am a newer in C language and I wonder how to implement it. Should I just include the header file tinydir.h ? But when I do this I cannot run the samples because there are many errors about strict type transforms. Should I do something more? Thank you.

For simple use, just include tinydir.h and run the samples.
And if you want to support unicode in windows, you need to do something more. Refer to list_to_file.c or read tinydir.h.
Here is Windows 7 64bit + VS 2010, and there is no error when compiling. Which sample are you using? And could you please show us the details of the error messages?

@lautis0503 Thank you and I seem to have some ideas. I also use Windows 7 64bit + VS 2010.
Errors happen when I run "list_to_file.c", which declares debug asserations failed! And it happened in line 77. Other samples are normal.
Another question: I don't know where to add my own dir to the program. Could you please show me in details? Thanks again.

Line 13 /path/to/dir
Line 21 /file/to/output
Change this two lines as you like. Keep the original form may lead to errors, since there are no such path.
Line 77 in which file? Try the above and then run it.

@lautis0503 Thank you very much.
According to your explanations, I have successfully implement most samples And I found when I need to modify the path, I should add TINYDIR_STRING("mypath").
There are still some samples I cannot compile including random_access_sampe and cppsample. Maybe the issue comes from the limitations of widechar?

All other samples are written without unicode support. Should work fine with no modification.
Extra codes are required to support unicode.