Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#110 MinGW make does not include files

closed-invalid
nobody
None
5
2008-05-22
2008-04-19
James Rome
No

I am doing a C project in NB 6.1RC1 on WinXP with the MinGW tools.

When I compile anything, the include directories are not found! For example, here is the start of some code (GPC_WIN and
GPC_MinGW are defined):

#include "comp.h"
#include <stdio.h>
#include <memory.h>
#ifdef GPC_WIN
#define JAVA_LOCATION "\"c:\\Program Files\\Java\\jre1.6.0_05\\bin\\java\""
#define TP_LOCATION "C:\\NetBeansProjects\\tekplot\\tekplot\\dist\\tekPlot.jar"
#include <process.h>
#ifdef GPC_CYGWIN
#include <w32api/winsock2.h>
#endif
#ifdef GPC_MinGW
#include <winsock2.h>
#endif
#include <time.h>
#include <errno.h>
#include <windows.h>
#endif

#ifdef GPC_UNX
#define GPC_OSX
#define JAVA_LOCATION "/usr/bin/java"

#ifdef GPC_OSX
#define TP_LOCATION "/Users/jar/Tekdraw2/tekPlot/dist/tekPlot.jar"
#else
// Note: unable to use ~ here
#define TP_LOCATION "/home/jar/Tekdraw2/tekPlot/dist/tekPlot.jar"
#endif

// Note:Only include the main include directory in NetBeans C options
#include <unistd.h>
#include <errno.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#endif

NetBeans "sees" the comp.h include file because the #ifdefs are properly colored. But when I try to compile the code,
make cannot seem to find any of my include files. comp.h is in C:\nbprojects\graphic2dll\trunk\include

mkdir -p build/Windows-Debug/MinGW-Windows/src
gcc.exe -c -g -IC\:/nbprojects/graphic2dll/trunk/include -IC\:/MinGW/include -o
build/Windows-Debug/MinGW-Windows/src/tkfPush.o src/tkfPush.c
src/tkfPush.c:9:18: comp.h: No such file or directory
src/tkfPush.c: In function `tkfpush':
src/tkfPush.c:60: error: storage size of 'addr' isn't known
src/tkfPush.c:61: error: storage size of 'inputaddress' isn't known

------- Additional comments from jarome Sat Apr 19 14:52:21 +0000 2008 -------

GPC_WIN and GPC_MinGW are defined in comp.h

------- Additional comments from jarome Sat Apr 19 15:22:01 +0000 2008 -------

The problem is the MinGW make. When I used cygwin's make, this worked. why?

Discussion

  • Keith Marshall
    Keith Marshall
    2008-04-19

    Logged In: YES
    user_id=823908
    Originator: NO

    This has nothing to do with `make' -- the issue is with GCC's resolution of your include file paths.

    MinGW's GCC can't understand POSIX paths, even when you use MSYS. If you must specify absolute include file paths within your source code, then you *must* specify them in *native* Windows syntax, (although you *may* use normal slashes, in preference to backslashes, as the directory separators). Most projects avoid this issue, by using *relative* include file paths.

    Cygwin's GCC *can* understand POSIX paths, WRT it's own emulated POSIX mapping of the file system; this is why it does work in Cygwin.

    I'm closing this as `invalid' for now. If you feel I've misinterpreted your problem, please feel free to add a follow-up comment, and I'll reopen it.

     
  • Keith Marshall
    Keith Marshall
    2008-04-19

    • status: open --> closed-invalid
     
  • James Rome
    James Rome
    2008-04-19

    Logged In: YES
    user_id=529678
    Originator: YES

    Ah, but the MinGW gcc worked just fine if I used the cygwin make, so I don't see how it can be a gcc issue.

     
  • Keith Marshall
    Keith Marshall
    2008-04-21

    Logged In: YES
    user_id=823908
    Originator: NO

    > ... but the MinGW gcc worked just fine if I used the cygwin make,
    > so I don't see how it can be a gcc issue.

    Your include files are referenced in C/C++ source code *only*, right? So make doesn't need to find them, (and will never look for them); GCC *does* need to be able to find them, and apparently it can't.

    I see no justification for calling this a bug, but I'm willing to address it as a support request. However, you will need to provide much better information, to enable us to provide any sort of useful support:

    1) Provide a complete, self-contained *minimal* test case, to illustrate your problem; include *both* C/C++ source code, *and* a Makefile.

    2) Tell us *exactly* what commands to execute, in order to reproduce your problem; include details of directory hierarchy, if it is relevant, and whatever shell environment you are using.

    3) Explain *exactly* what you mean by `MinGW make'; (there is no such current product). Include details of the versions off *all* tools you've used.

     
  • Keith Marshall
    Keith Marshall
    2008-04-21

    • status: closed-invalid --> pending-invalid
     
  • Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 30 days (the time period specified by
    the administrator of this Tracker).

     
    • status: pending-invalid --> closed-invalid