Discussion:
[Dev-C++] compile problems - please help
Zachary Uram
2002-12-06 20:38:04 UTC
Permalink
I installed the full Dev-C++ 4.9.60 package and then used the Update
facility to upgrade to Dev-C++ 4.9.7.0. I have the Win32 build with the
Mingw compiler (g++).

My problem is that the compiler doesn't seem to be able to find all my
source files or it is building in some other directory. Here is the steps I
took for this project:

C:\Dev-Cpp is root directory where Dev-C++ is installed

I clicked File-> New-> Project.

It brought up the "New project" dialog box .

Under Basic I selected Console Application

Under Project options I selected entered graph-adj for Name and selected
C++ Project.

Then it brought up the "Create new project" dialog box.

For File name I entered "C:\Dev-cpp\graph-adj.dev".

Then it brought up the Project window. So it listed Project: graph-adj and
had a main.cpp default file in there. I removed that file and
then I clicked "Add to Project" and selected the following files to add to
my project:
graph-adj.cpp, graph-adj.h, & main.cpp

These files I had earlier copied into the directory C:\Dev-cpp.
I also copied matrix.h and graph.txt which my graph-adj program uses into
this directory.

I went to the Execute menu and selected Compile.

It compiles and I get the following 5 errors:

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/DEV-CPP/include" -I"C:/DEV-CPP/include"

In file included from graph-adj.h:12,
from main.cpp:9:
matrix.h: In method `Matrix<Type>::Matrix(int, int, const Type &)':
matrix.h:76: parse error before `)'

g++.exe -c graph-adj.cpp -o graph-adj.o
-I"C:/DEV-CPP/include" -I"C:/DEV-CPP/include"

In file included from graph-adj.h:12,
from graph-adj.cpp:8:
matrix.h: In method `Matrix<Type>::Matrix(int, int, const Type &)':
matrix.h:76: parse error before `)'

g++.exe main.o graph-adj.o -o "graph-adj.exe"
-L"C:/DEV-CPP/lib" -I"C:/DEV-CPP/include" -I"C:/DEV-CPP/include"

G__~1.EXE: main.o: No such file or directory
G__~1.EXE: graph-adj.o: No such file or directory
G__~1.EXE: No input files

Execution terminated


The first error: "In file included from graph-adj.h:12," points to the
statement:
#include "matrix.h"

The second error: "In file included from main.cpp:9:" points to the statement:
#include "graph-adj.h"

Both these errors appear twice.

The fifth error "In method `Matrix<Type>::Matrix(int, int, const Type &)':"
is I believe
because for some reason the compiler cannot find the header file matrix.h
where this Matrix class
is defined.

ALso notice the compiler says it cannot find main.o, graph-adj.o or any
input files.

So what is the procedure for compiling a new project and how do I tell it
where my source files
are and where to build them?

Ideally I want the project to be in some other directory such as
C:\c++\projects\graph-adj\

BTW this same code compiled fine in Linux using g++ from command line. I
also tried adding matrix.h to my Dev-C++ Project window but I still get the
same errors.

Regards,
Zach


Zachary Uram
John 3:16
<><
Carlos García del Monte
2002-12-07 09:37:06 UTC
Permalink
Post by Zachary Uram
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/DEV-CPP/include"
-I"C:/DEV-CPP/include"
In file included from graph-adj.h:12,
matrix.h:76: parse error before `)'
matrix.h was included in grpah-adj, graph.adj.h was included from
main.cpp. The only error is in matrix.h, line 76. I don't see what's in
this line or the previous, watch at them, perhaps some silly mistake
like having seen at it and pressed a key. (I assume you compiled it
successfully with 4.9.6.0). Are you using some non-english character? It
also sounds like you are using some bad syntax like saying Matrix(Type),
or using a wrong kind of variable there.
Post by Zachary Uram
g++.exe -c graph-adj.cpp -o graph-adj.o -I"C:/DEV-CPP/include"
-I"C:/DEV-CPP/include"
In file included from graph-adj.h:12,
matrix.h:76: parse error before `)'
The same error, which is reported twice.
Post by Zachary Uram
g++.exe main.o graph-adj.o -o "graph-adj.exe" -L"C:/DEV-CPP/lib"
-I"C:/DEV-CPP/include" -I"C:/DEV-CPP/include"
G__~1.EXE: main.o: No such file or directory
G__~1.EXE: graph-adj.o: No such file or directory
G__~1.EXE: No input files
Due to the error in the matrix.h graph.adj.cpp was not compiled, neither
cpp, so when it tries to link it doesn't find the object files.

Hope this helps
Zachary Uram
2002-12-07 17:00:02 UTC
Permalink
Post by Carlos García del Monte
matrix.h was included in grpah-adj, graph.adj.h was included from
main.cpp. The only error is in matrix.h, line 76. I don't see what's in
this line or the previous, watch at them, perhaps some silly mistake like
having seen at it and pressed a key. (I assume you compiled it
successfully with 4.9.6.0). Are you using some non-english character? It
also sounds like you are using some bad syntax like saying Matrix(Type),
or using a wrong kind of variable there.
Thanks Carlos. Yes it was a silly error I overlooked. I had "))" instead of
what I needed was just ")" hehe.

The code compiles fine now.

Zach


Zachary Uram
John 3:16
<><

Loading...