Hi everyone?
I have this persistent error that appeared after I had worked on all 45errors in my code. It is the [Linked error] undefined reference'winMain@16'.
I have read all your comments about this error, plus many online and text book statements about the error and followed them in my Dev C++ compiler but i am achieving zero results.
I surely need your help in this problem.
For reference, let me attache below the codes I am talking about. Its supposed to be a reference code in a namespace called Matrix1.
The main is in the Application file and is supposed to use the header file Matrix1.h.
Actually, all objects created in the main class, of the Matrix1::MatrixClass, cannot be understood by the compiler since MatrixClass is not properly compiled and yet the compiler cannot compile MatrixClass due to the above mentioned linker error.
Please help.
The two codes are as follows:
//first file: Matrix1.cpp
// 20/07/05 21:52
include <string>
include <math.h>
//using namespace std;
namespace Matrix1
{
class MatrixClass
{
class here.
private:
int maxPrice;
int expiry_time;
float r;
int size;
float k; //strike price
int spaceincrements;
int timeincrements;
char typedoption;
[timeincrements]; //the array bound cannot be a variable
//Refer to B.Stroustrup,chapter 5.2.
Else you
//use vectors.
//this is a store for the matrix values
0)
{
buffer[i][j] = (i * 1.0 *
spaceincrements);
}
else
{
buffer[i][j] = 0;
}
}
}
break;
case 'p':
for (int i = 0; i < timeincrements; i++)
{
for (int j = 0; j < timeincrements; j++)
{
while (j * delta_T == (1.0 *
expiry_time))
{
if ((i * 1.0 * spaceincrements) - k >
0)
{
buffer[i][j] = 0;
}
else
{
buffer[i][j] = (i * 1.0 *
spaceincrements) - k;
}
}
}
}
break;
}
//setting boundary condition
values, but depending on option type.
switch (typedoption)
{
case 'c':
for (int i =0; i < spaceincrements; i++)
{
for (int j = 0; j < timeincrements ; j++)
{
buffer[0][j] = 0;
buffer[maxPrice][j] =
maxPrice;
}
};
break;
case 'p':
for (int i = 0; i < spaceincrements; i++)
{
for (int j = 0; j < timeincrements ; j++)
{
buffer[0][j] = (k * exp(-r(expiry_time-
(jtimeincrements))));
buffer[maxPrice][j] = 0;
}
};
break;
}
};
};
}
//The second file: Application.cpp
// This is the main project file for DeV-C++ application project
//generated using a Wizard
include "Matrix1.h"
include <iostream>
include <tchar.h>
include <stdio.h>
include <stdlib.h>
include <string>
//#include <mscorlib.dll>
using namespace std;
int main()
{
// TODO: Please replace the sample code below with your
own.
cout<<("Hello, welcome to this finite difference option
pricing scheme for European Options.");
cout<<"Thank you, now set your expiry time";
cin>>expirytime;
//Setting the strike price.
cout<<"Thank you, now set your strike price";
cin>>strikeprice;
//setting the riskless interest rate.
cout<<"Thank you, now set your current interest
rate";
cin>>interest_rate;
//setting the standard deviation.
cout<<"Thank you, now set the stock volatility";
cin>>stddev;
//determining the type of European option under
consideration.
cout<<"Thank you, now type either " << c << " for
call option type or " << p <<" for put option type";
cin>>optiontype;
while (optiontype != p || optiontype != c)
{
cout << "Sorry, but you have made an unclear input:"
<< endl;
cout << "Please type either " << c << "or " << p <<" for
your option type";
}
//create the matrices
Matrix1::MatrixClass Matrix1st = new
Matrix1::MatrixClass(maxprice, expirytime, interest_rate,
strikeprice, optiontype);
for(intj=expirytime-MatrixClass::deltaT;j=0;j--
)
{
for (int i = 1; i = (maxprice - MatrixClass::deltaS); i++)
{
//computing the Black Scholes coefficients varA,
varB and varC:
// This is to be done for every point of the grid for
which the
// option value is to be computed.
// computing (int. rate * stock price at point i *
Hi?
I have points mentioned earlier as follows:
1. I have uninstalled version 4.9.9.1 completely (with the pc advising me to also uninstall the C::...\Dev C++ directory if I dont have any personal data in it. I removed the trial files I had saved in a subdirectory and deleted the directory). After I installed Dev C++ - version 4.9.9.2 with the mgw compiler, from the net. This time I installed it directly under dir C:\, as in C:\DevC++.
2. I have opened a new project as you mentioned and inserted the code files that I had done earlier, into it like main.cpp (which initially was Application.c), Matrix1.cpp and Matrix1.h
3. I have also followed the advise mentioned under NO.3 of "what does a compile log tell us?". Since I had created a project with all files in it, I used the second option (for projects).
4. I then decided to compile and got the following compile log:
Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Makefile.win" all
g++.exe -D__DEBUG__ -c Application/main.cpp -o Application/main.o -I"lib/gcc/mingw32/3.4.2/include" -I"include/c++/3.4.2/backward" -I"include/c++/3.4.2/mingw32" -I"include/c++/3.4.2" -I"include" -fexpensive-optimizations -pg -g3
Application/main.cpp: In function int main()':
Application/main.cpp:58: error:Matrix1' has not been declared
Application/main.cpp:58: error: MatrixClass' undeclared (first use this function)
Application/main.cpp:58: error: (Each undeclared identifier is reported only once for each function it appears in.)
Application/main.cpp:58: error: expected;' before "Matrix1st"
Application/main.cpp:60: error: MatrixClass' has not been declared
Application/main.cpp:60: error:deltaT' undeclared (first use this function)
Application/main.cpp:62: error: MatrixClass' has not been declared
Application/main.cpp:62: error:deltaS' undeclared (first use this function)
Application/main.cpp:69: error: MatrixClass' has not been declared
Application/main.cpp:69: error:MatrixClass' has not been declared
Application/main.cpp:69: error: MatrixClass' has not been declared
Application/main.cpp:71: error:MatrixClass' has not been declared
Application/main.cpp:71: error: MatrixClass' has not been declared
Application/main.cpp:71: error:MatrixClass' has not been declared
Application/main.cpp:71: error: MatrixClass' has not been declared
Application/main.cpp:71: error:MatrixClass' has not been declared
Application/main.cpp:77: error: Matrix1st' undeclared (first use this function)
Application/main.cpp:86: error:MatrixClass' has not been declared
Application/main.cpp:86: error: "For stock price ="' cannot be used as a function
Application/main.cpp:86: error: expected;' before string constant
Application/main.cpp:86: error: expected primary-expression before '<<' token
make.exe: *** [Application/main.o] Error 1
Questions:
1. Why is it that the compiler still searches for files in the long thread as in: make.exe -f "C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Makefile.win"?
2. Many of the errors that you spoke of yesterday (the ones you said I could sort out) are as a result of the compiler not recognising the other source code through the compiler because they are used by the object of its class in the main. So under a project, how do I compile one source file at a time, because I think if I dont compile that other Matrix1.cpp, objects of its class in the main will remain undefined. I hope I am right with this.
Its a husstle for me now but I think I am learning Dev C++ pretty fast. Thank you.
Roy.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"I have uninstalled version 4.9.9.1 completely (with the pc advising me to also uninstall the C::...\Dev C++ directory if I dont have any personal data in it. I removed the trial files I had saved in a subdirectory and deleted the directory). After I installed Dev C++ - version 4.9.9.2 with the mgw compiler, from the net. This time I installed it directly under dir C:\, as in C:\DevC++. "
Sounds like you didn't follow the directions for a clean uninstall that are in the FAQ thread. Deleting the directory is not enough.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Wayne,
Very sorry, I hadn't read those details about what needs to be included when posting a querry. However, here they are:
1. The OS is windows XP
The Version of Dev C++ that I am using is: 4.9.9.1
Hi Wayne,
Very sorry, I hadn't read those details about what needs to be included when posting a querry. However, here they are:
1. The OS is windows XP
The Version of Dev C++ that I am using is: 4.9.9.1
Hi?
Sorry I meant the compile log and not the compile statement for no.4.
The compile log is:
Compiler: New compiler
Executing g++.exe...
g++.exe "C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Application\Matrix1.cpp" -o "C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Application\Matrix1.exe" -fexpensive-optimizations -pg -g3 -I"C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Application" -L"C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\C++ info\Dev-Cpp\lib" -lgmon -pg -g3
C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\C++ info\Dev-Cpp\lib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
Execution terminated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now, you went crazy with putting spaces in directory names. This ia a VERY bad idea. Spaces in paths are not well parsed. Not to mention long path names will get you into trouble with command line lenght issues.
Now, you have Dev installed in:
C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\C++ info\Dev-Cpp
This is an even worse idea. Take a piece of advice, unless you really understand a tool, NEVER override its preferred installation path. Personally, I would rip it out of there and install it where it goes, i.e. c:\dev-cpp
Now, the code you posted includes three files, NONE of which are named main.c. Yet your log refers to it.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I created a New:Empty Project, put your code in, and compiled it.
I got a lot of errors, but they appear to be legitimate coding errors on your part - undeclated variables (note C++ is case senstive, so maxprice is not the same as maxPrice), missing comments etc.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry Wayne,
I know i have been a pain to you insome way but please bare with me on some of these issues. I didnt know many of the stuff you mentioned until you detailed them.
Now I didnt understand the comment:
Note that since this is now a windows project, you sould not use a windows project. I used:
File:New:Project:Empty Project
You have a number of compile options set as well, like -pgmon, did you do that on purpose?
Could you please elaborate?
IN addition, please explain to me how I can access the New:Empty project so that I can use it. This site is not yet stright forward to me.
Otherwise, I seriously appreciate every comment you give.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How you set them, I have not a clue, I have not been there with you.
Start Dev, go up to the menu item File - click it. Go down to the item New: Click it. Go to the menu item Project. This will open a new window with a bunch of icons, one of which is Empty Project. Click it. (Or double click). It will ask you for a name for your project. Name it, and you are now working in a new project. You can add file to your project by going to Project:Add to Project, or create stuff new for it by going to New:Source File.
You really need to bump around in the menus and see what's there.
Note that, as I tolld you, there are a lot of errors in your code, misnamed and undeclared variables etc. You will need to fix those.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi?
All errors cleared as of now and the code compiles and runs properly.
I appreciate all your tireless assistance and patience, Wayne.
I just have one more question.
I have tried to read topics on how I can out put my data and retrieve it from MS-Excel but its confusing me. Any ideas on this?
cheers,
Martin.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone?
I have this persistent error that appeared after I had worked on all 45errors in my code. It is the [Linked error] undefined reference'winMain@16'.
I have read all your comments about this error, plus many online and text book statements about the error and followed them in my Dev C++ compiler but i am achieving zero results.
I surely need your help in this problem.
For reference, let me attache below the codes I am talking about. Its supposed to be a reference code in a namespace called Matrix1.
The main is in the Application file and is supposed to use the header file Matrix1.h.
Actually, all objects created in the main class, of the Matrix1::MatrixClass, cannot be understood by the compiler since MatrixClass is not properly compiled and yet the compiler cannot compile MatrixClass due to the above mentioned linker error.
Please help.
The two codes are as follows:
//first file: Matrix1.cpp
// 20/07/05 21:52
include <string>
include <math.h>
//using namespace std;
namespace Matrix1
{
class MatrixClass
{
class here.
private:
int maxPrice;
int expiry_time;
float r;
int size;
float k; //strike price
int spaceincrements;
int timeincrements;
char typedoption;
intRate, float strikePrice, char opType)
{
float deltaT = 0.5;
float deltaS = 0.5;
maxPrice = maxS;
int spaceincrements = 10; //
(max_price / deltaS);
expiry_time = expiryT;
r = intRate;
int timeincrements =
10; //expiry_time / deltaT;
k = strikePrice;
[timeincrements]; //the array bound cannot be a variable
//Refer to B.Stroustrup,chapter 5.2.
Else you
//use vectors.
//this is a store for the matrix values
0)
{
buffer[i][j] = (i * 1.0 *
spaceincrements);
}
else
{
buffer[i][j] = 0;
}
}
}
break;
case 'p':
for (int i = 0; i < timeincrements; i++)
{
for (int j = 0; j < timeincrements; j++)
{
while (j * delta_T == (1.0 *
expiry_time))
{
if ((i * 1.0 * spaceincrements) - k >
0)
{
buffer[i][j] = 0;
}
else
{
buffer[i][j] = (i * 1.0 *
spaceincrements) - k;
}
}
}
}
break;
}
values, but depending on option type.
switch (typedoption)
{
case 'c':
for (int i =0; i < spaceincrements; i++)
{
for (int j = 0; j < timeincrements ; j++)
{
buffer[0][j] = 0;
buffer[maxPrice][j] =
maxPrice;
}
};
break;
case 'p':
for (int i = 0; i < spaceincrements; i++)
{
for (int j = 0; j < timeincrements ; j++)
{
buffer[0][j] = (k * exp(-r(expiry_time-
(jtimeincrements))));
buffer[maxPrice][j] = 0;
}
};
break;
}
}
//The second file: Application.cpp
// This is the main project file for DeV-C++ application project
//generated using a Wizard
include "Matrix1.h"
include <iostream>
include <tchar.h>
include <stdio.h>
include <stdlib.h>
include <string>
//#include <mscorlib.dll>
using namespace std;
int main()
{
// TODO: Please replace the sample code below with your
own.
cout<<("Hello, welcome to this finite difference option
pricing scheme for European Options.");
cout<<"Thank you, now set your expiry time";
cin>>expirytime;
//Setting the strike price.
cout<<"Thank you, now set your strike price";
cin>>strikeprice;
//setting the riskless interest rate.
cout<<"Thank you, now set your current interest
rate";
cin>>interest_rate;
//setting the standard deviation.
cout<<"Thank you, now set the stock volatility";
cin>>stddev;
//determining the type of European option under
consideration.
cout<<"Thank you, now type either " << c << " for
call option type or " << p <<" for put option type";
cin>>optiontype;
while (optiontype != p || optiontype != c)
{
cout << "Sorry, but you have made an unclear input:"
<< endl;
cout << "Please type either " << c << "or " << p <<" for
your option type";
}
//create the matrices
Matrix1::MatrixClass Matrix1st = new
Matrix1::MatrixClass(maxprice, expirytime, interest_rate,
strikeprice, optiontype);
)
{
for (int i = 1; i = (maxprice - MatrixClass::deltaS); i++)
{
//computing the Black Scholes coefficients varA,
varB and varC:
// This is to be done for every point of the grid for
which the
// option value is to be computed.
theta)
float rstheta = (interest_rate * ( i *
MatrixClass::deltaS ) * MatrixClass::deltaT /
MatrixClass::deltaS );
//computing a variable factor - square of
(sigma * lambda).
float siglambsquared = ( stddev * stddev * ( i *
MatrixClass::deltaS ) * ( i * MatrixClass::deltaS ) *
MatrixClass::deltaT / (MatrixClass::deltaS *
MatrixClass::deltaS));
Matrix1st[i][j+1]constvarB + Matrix1st[i-1][j-1]constvarC;
}
}
for (int j = 0; j < expirytime; j++)
{
while (j = 0)
{
for (int i = 0; i < maxprice; i++)
{
cout<< "For stock price ="
(i*MatrixClass::deltaS) ", the fair price is:" Matrix1st[i][j];
<<endl;
}
}
}
}
Hi?
I have points mentioned earlier as follows:
1. I have uninstalled version 4.9.9.1 completely (with the pc advising me to also uninstall the C::...\Dev C++ directory if I dont have any personal data in it. I removed the trial files I had saved in a subdirectory and deleted the directory). After I installed Dev C++ - version 4.9.9.2 with the mgw compiler, from the net. This time I installed it directly under dir C:\, as in C:\DevC++.
2. I have opened a new project as you mentioned and inserted the code files that I had done earlier, into it like main.cpp (which initially was Application.c), Matrix1.cpp and Matrix1.h
3. I have also followed the advise mentioned under NO.3 of "what does a compile log tell us?". Since I had created a project with all files in it, I used the second option (for projects).
4. I then decided to compile and got the following compile log:
Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Makefile.win" all
g++.exe -D__DEBUG__ -c Application/main.cpp -o Application/main.o -I"lib/gcc/mingw32/3.4.2/include" -I"include/c++/3.4.2/backward" -I"include/c++/3.4.2/mingw32" -I"include/c++/3.4.2" -I"include" -fexpensive-optimizations -pg -g3
Application/main.cpp: In function
int main()': Application/main.cpp:58: error:Matrix1' has not been declaredApplication/main.cpp:58: error:
MatrixClass' undeclared (first use this function) Application/main.cpp:58: error: (Each undeclared identifier is reported only once for each function it appears in.) Application/main.cpp:58: error: expected;' before "Matrix1st"Application/main.cpp:60: error:
MatrixClass' has not been declared Application/main.cpp:60: error:deltaT' undeclared (first use this function)Application/main.cpp:62: error:
MatrixClass' has not been declared Application/main.cpp:62: error:deltaS' undeclared (first use this function)Application/main.cpp:69: error:
MatrixClass' has not been declared Application/main.cpp:69: error:MatrixClass' has not been declaredApplication/main.cpp:69: error:
MatrixClass' has not been declared Application/main.cpp:71: error:MatrixClass' has not been declaredApplication/main.cpp:71: error:
MatrixClass' has not been declared Application/main.cpp:71: error:MatrixClass' has not been declaredApplication/main.cpp:71: error:
MatrixClass' has not been declared Application/main.cpp:71: error:MatrixClass' has not been declaredApplication/main.cpp:77: error:
Matrix1st' undeclared (first use this function) Application/main.cpp:86: error:MatrixClass' has not been declaredApplication/main.cpp:86: error:
"For stock price ="' cannot be used as a function Application/main.cpp:86: error: expected;' before string constantApplication/main.cpp:86: error: expected primary-expression before '<<' token
make.exe: *** [Application/main.o] Error 1
Questions:
1. Why is it that the compiler still searches for files in the long thread as in: make.exe -f "C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Makefile.win"?
2. Many of the errors that you spoke of yesterday (the ones you said I could sort out) are as a result of the compiler not recognising the other source code through the compiler because they are used by the object of its class in the main. So under a project, how do I compile one source file at a time, because I think if I dont compile that other Matrix1.cpp, objects of its class in the main will remain undefined. I hope I am right with this.
Its a husstle for me now but I think I am learning Dev C++ pretty fast. Thank you.
Roy.
"I have uninstalled version 4.9.9.1 completely (with the pc advising me to also uninstall the C::...\Dev C++ directory if I dont have any personal data in it. I removed the trial files I had saved in a subdirectory and deleted the directory). After I installed Dev C++ - version 4.9.9.2 with the mgw compiler, from the net. This time I installed it directly under dir C:\, as in C:\DevC++. "
Sounds like you didn't follow the directions for a clean uninstall that are in the FAQ thread. Deleting the directory is not enough.
Wayne
Could you please post the other two elements of the "Basic 3" - see the FAQ thread in this forum for a description if you need it...
Wayne
You also failed to include your header file
Matrix1.h
in your post.
Wayne
And what exactly is this line of code supposed to do?
class here.
It looks like a comment that has been mangled.
Wayne
Hi Wayne,
Very sorry, I hadn't read those details about what needs to be included when posting a querry. However, here they are:
1. The OS is windows XP
The Version of Dev C++ that I am using is: 4.9.9.1
The header file is as follows:
// Matrix1.h
include <iostream>
ifndef MATRIX_1_H;
define MATRIX_1_H;
namespace Matrix1
{
MatrixClass(int maxS, int expiryT, float intRate, float strikePrice, char opType);
}
endif
//To be honest, I have not met a book that has properly explained the creation (not the use) of non-standard header files.
[Linker error] undefined reference to `WinMain@16'
Hi Wayne,
Very sorry, I hadn't read those details about what needs to be included when posting a querry. However, here they are:
1. The OS is windows XP
The Version of Dev C++ that I am using is: 4.9.9.1
The header file is as follows:
// Matrix1.h
include <iostream>
ifndef MATRIX_1_H;
define MATRIX_1_H;
namespace Matrix1
{
MatrixClass(int maxS, int expiryT, float intRate, float strikePrice, char opType);
}
endif
//To be honest, I have not met a book that has properly explained the creation (not the use) of non-standard header files.
[Linker error] undefined reference to `WinMain@16'
Arghgh, reading is not your strong point eh?
I did NOT ask for a compile "statement", I asked for the compile LOG. Please read the directions again.
Wayne
PLEASE do not start a bunch of new threads about the same question. It is really quite rude.
Wayne
Repost from other unneccesarily started thread:
Hi?
Sorry I meant the compile log and not the compile statement for no.4.
The compile log is:
Compiler: New compiler
Executing g++.exe...
g++.exe "C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Application\Matrix1.cpp" -o "C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Application\Matrix1.exe" -fexpensive-optimizations -pg -g3 -I"C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\Computer Implementation of finite difference option pricing schemes\Martins2\Application" -L"C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\C++ info\Dev-Cpp\lib" -lgmon -pg -g3
C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\C++ info\Dev-Cpp\lib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
Execution terminated
Now, you went crazy with putting spaces in directory names. This ia a VERY bad idea. Spaces in paths are not well parsed. Not to mention long path names will get you into trouble with command line lenght issues.
Now, you have Dev installed in:
C:\Documents and Settings\Martin Roy Lukwago\My Documents\study information\MSC MathFin at Hull Univ\C++ info\Dev-Cpp
This is an even worse idea. Take a piece of advice, unless you really understand a tool, NEVER override its preferred installation path. Personally, I would rip it out of there and install it where it goes, i.e. c:\dev-cpp
Now, the code you posted includes three files, NONE of which are named main.c. Yet your log refers to it.
Wayne
I created a New:Empty Project, put your code in, and compiled it.
I got a lot of errors, but they appear to be legitimate coding errors on your part - undeclated variables (note C++ is case senstive, so maxprice is not the same as maxPrice), missing comments etc.
Wayne
Yep, there are a large numbers of errors in your code, but you should be able to fix them.
Wayne
Note that since this is now a windows project, you sould not use a windows project. I used:
File:New:Project:Empty Project
You have a number of compile options set as well, like -pgmon, did you do that on purpose?
Wayne
Sorry Wayne,
I know i have been a pain to you insome way but please bare with me on some of these issues. I didnt know many of the stuff you mentioned until you detailed them.
Now I didnt understand the comment:
Note that since this is now a windows project, you sould not use a windows project. I used:
File:New:Project:Empty Project
You have a number of compile options set as well, like -pgmon, did you do that on purpose?
Could you please elaborate?
IN addition, please explain to me how I can access the New:Empty project so that I can use it. This site is not yet stright forward to me.
Otherwise, I seriously appreciate every comment you give.
Your log shows these compile options are set:
-lgmon -pg -g3
How you set them, I have not a clue, I have not been there with you.
Start Dev, go up to the menu item File - click it. Go down to the item New: Click it. Go to the menu item Project. This will open a new window with a bunch of icons, one of which is Empty Project. Click it. (Or double click). It will ask you for a name for your project. Name it, and you are now working in a new project. You can add file to your project by going to Project:Add to Project, or create stuff new for it by going to New:Source File.
You really need to bump around in the menus and see what's there.
Note that, as I tolld you, there are a lot of errors in your code, misnamed and undeclared variables etc. You will need to fix those.
Wayne
Thanks, hadnt imagined it was that simple.
I will try it all out asap and reinstall the software.
Once again, thanks Wayne,
Roy.
Don't be a scared-to-try-stuff old fart like me. Play with it. Have fun. "I wonder what that does?" is a good attitude to have.
Wayne
Hi?
All errors cleared as of now and the code compiles and runs properly.
I appreciate all your tireless assistance and patience, Wayne.
I just have one more question.
I have tried to read topics on how I can out put my data and retrieve it from MS-Excel but its confusing me. Any ideas on this?
cheers,
Martin.
I will generally write my data out with commas between the elements, i.e.
2,3,4,5
6,7,8,9
1,1,1,1
and call the file something like
test.csv
which Excel will open properly.
Wayne