Thread: Another pitiful request for help

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    16

    Another pitiful request for help

    Please excuse me,

    I'm a proficient C programmer in a GNU/Linux environment who is attempting to learn to program on Windows. I decided I would use MinGW and MSYS to mimic the environment I was already used to (I'm not inclined to get to used to VC++ if you get my drift).

    So, after reading the lovely documentation, I seem to have everything installed correctly and even got my hello world program running. Huzzah.

    Well, suddenly an error came up when trying to port one of my old programs. I have a function which does this:
    Code:
    int isDir(char *candidate)
    {
    	DIR * dir = opendir(candidate);
    
    	if (dir == NULL)
    	{
    		return 0;
    	} else
    	{
    		return 1;
    	}
    }
    Yes, I'm sure there is a better way to check to see if something is a directory, but let's focus on the error

    I compile like so: gcc donner4.c -o donner4 -lpthreads (pthreads is working)

    I get this:

    In file included from donner4.c:16:
    C:/msys/1.0/mingw/include/sys/dirent.h:62: parse error before "__ino64_t"
    C:/msys/1.0/mingw/include/sys/dirent.h:66: parse error before '}' token
    C:/msys/1.0/mingw/include/sys/dirent.h:69: parse error before '*' token
    C:/msys/1.0/mingw/include/sys/dirent.h:70: parse error before '*' token
    C:/msys/1.0/mingw/include/sys/dirent.h:71: parse error before '*' token
    C:/msys/1.0/mingw/include/sys/dirent.h:72: parse error before '*' token
    C:/msys/1.0/mingw/include/sys/dirent.h:73: parse error before '*' token
    C:/msys/1.0/mingw/include/sys/dirent.h:75: parse error before '*' token
    C:/msys/1.0/mingw/include/sys/dirent.h:79: parse error before '*' token
    C:/msys/1.0/mingw/include/sys/dirent.h:80: parse error before '*' token
    donner4.c: In function `isDir':
    donner4.c:54: `dir' undeclared (first use in this function)
    donner4.c:54: (Each undeclared identifier is reported only once
    donner4.c:54: for each function it appears in.)

    So we at least know dirent.h is being included.

    Again, I'm not experienced enough with MinGW or Windows programming in general to know what the matter is, only that Google has a bunch of dirent.h problems online (of course, my ignorance renders me incapable of comprehending them).

    Would a kind soul be willing to help me? I would most appreciate it.

    Thanks!

    rokenrol

    EDIT (a few minutes later):
    You should also know that this is a completely new install of what I believe is the latest version of everything involved, so if versions matter that might help you.

    Also, the program works perfectly fine back on Slackware. But in Windowsland it fails. Anyone surprised?

    Again, grazie!
    Last edited by rokenrol; 10-12-2006 at 07:56 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Trouble with client GET request path
    By NuNn in forum C Programming
    Replies: 1
    Last Post: 02-25-2009, 03:34 PM
  2. Can you check what is wrong with this code
    By Ron in forum C++ Programming
    Replies: 4
    Last Post: 08-01-2008, 10:59 PM
  3. my HTTP request handler code correct?
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 04-25-2008, 04:01 AM
  4. denied request
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 09-20-2001, 11:35 PM