Link to home
Start Free TrialLog in
Avatar of sai4
sai4

asked on

MinGW gcc -c no such file or directory

I'm trying to compile a C programing in windows using MINGW

below is the command I'm using

c:\MinGW\bin\gcc –c  ddefit95.c ddeq.c w95dde.c matrix.c qp.c spline.c gcv.c rangen.c stochmin.c map.c cr.c

and the files listed are in the current directory.

However my output is "no such file or directory"

I then tried

c:\MinGW\bin\gcc –c  ddefit95.c

and


c:\MinGW\bin\gcc –c  DDEFIT95.c

but got the same output.  Any help would be greatly appreciated.

Thank you,

Steve
Avatar of sai4
sai4

ASKER

I thought I should also add that   gcc.exe is located in  C:\MinGW\bin\gcc


thanks

Steve
SOLUTION
Avatar of phoffric
phoffric

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sai4

ASKER

Hi phoffric  thank you for your comment, I was able to compile a "hello world" program using the following steps


c:\MinGW\bin\gcc -c hello.cpp

c:\MinGw\bin\gcc -o hello.exe hello.o

which gives me a working  hello.exe program
Avatar of sai4

ASKER

Hi DaveBaldwin I tried c:\MinGW\bin\gcc hello.o  which gives a.exe as a working "hello world" program

when I tried that with my original problem I got

C:\ddefit>c:\MinGW\bin\gcc ddefit95.c ddeq.c w95dde.c matrix.c qp.c spline.c gcv
.c rangen.c stochmin.c map.c cr.c

results in the following:

ddefit95.c: In function 'G':
ddefit95.c:433:3: warning: passing argument 1 of 'Jacobian' from incompatible po
inter type [enabled by default]
ddefit95.c:133:6: note: expected 'int (*)(struct matrix,  struct matrix,  struct
 matrix,  struct matrix,  struct matrix,  void *, int,  double)' but argument is
 of type 'void (*)(struct matrix,  struct matrix,  struct matrix,  struct matrix
,  struct matrix,  void *, int,  double)'
ddefit95.c: In function 'getno':
ddefit95.c:661:20: warning: cast from pointer to integer of different size [-Wpo
inter-to-int-cast]
C:\Users\JIMSHA~1\AppData\Local\Temp\ccQl6gPm.o:w95dde.c:(.text+0x8a6): undefine
d reference to `CreatePen@12'
Avatar of sai4

ASKER

Hi jkr thank you  I corrected the path variable, and used   gcc in stead of c:\MinGw\bin\gcc but I still got the same error.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sai4

ASKER

Thank you phoffric,

The error was saying   that the missing file was "gcc -c " but no specific file was listed. I can't reproduce the error now. All I've done is change the path variable as was mentioned above.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sai4

ASKER

Thank you David phoffric and everyone for your responses. does this mean the problem is not with MinGW?  The code is maintained on a website and I do know it works though.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sai4

ASKER

I should correct myself,

to set the path I used

set PATH=%PATH%;C:\MinGW\bin

Yeah it is weird that there is no makefile. I was under the impression though that make files weren't something used in windows?

Well it seems we're onto a different problem now though, MinGW is trying to compile just failing so I'll post the points and probably open up a new question once I figure out what to ask.

Thank you everyone for your responses.

Best,

Steve
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
actually any ide uses some kind of makefiles even if they were called differently or were based on xml. the main reason is simple: for any non-trivial project the number of files and options to handle are far too much as that you could pass them via commandline. moreover, by using a makefile or projectfile, you can do an incremental build, what means that you were building only those files that have changed or were dependent on changed files but not the whole project any time.  

Sara