Hi All,
My appologies in advance, this is one of those situations where I feel like an idiot because I know the answer to my question will be real simple, but I've already spent a couple of hours trying to work this out and am getting frustrated.
I installed code::blocks and MinGW, along with smartwin. I've been able to compile all of the examples in the smartwin\test\ folder without any problems by simply selecting the .dev file therein and hitting ctrl-f9
however I've been having problems running other source. for example.. the following code seems to be a really popular example of how to use findfirst() and findnext() functions from dir.h:
/* findfirst and findnext example */
#include <stdio.h>
#include <dir.h>
int main(void)
{
struct ffblk ffblk;
int done;
printf("Directory listing of *.*\n");
done = findfirst("*.*",&ffblk,0);
while (!done)
{
printf(" %s\n", ffblk.ff_name);
done = findnext(&ffblk);
}
return 0;
}
but when I compile it I get:
C:\repo\cpp\test2.cpp||In function `int main()':|
C:\repo\cpp\test2.cpp|9|error: aggregate `ffblk ffblk' has incomplete type and cannot be defined|
C:\repo\cpp\test2.cpp|12|error: `findfirst' was not declared in this scope|
C:\repo\cpp\test2.cpp|16|error: `findnext' was not declared in this scope|
||=== Build finished: 3 errors, 0 warnings ===|
I dont really understand whats happening because it looks as though the compiler has found the header file ok.. but then the findfirst and findnext functions declared there-in dont seem to work?
To create the .cpp file I've just used "File > New > File" rather than creating a new project - is that the trouble?
Thanks a bunch in advance for taking the time to read all this. If you could point me in the right direction would be much appreciated!