D
Danny Anderson
Hola!
I am working on a program where I am including a library that came with my
numerical methods textbook. The "util.h" simply includes a large number
of files. I had to change the util.h slightly to adjust path names and
also take into account I am working with a case-sensitive OS.
My program is below. The sticky point is that adding (#include "util.h")
seems to negate the (#include <string>) statement somehow. How can I get
around this? For obvious size reasons, I don't include the util.h
library, etc. I did include the compiler error messages below.
As always, thanks!
Danny
//---START CODE---------
/*
* Commenting out the first #include allows for program compilation
* on my Redhat9.0 box using g++ 3.2.2.
*
*/
#include "util.h" //modified NLIB for my gnu/linux system
#include <iostream>
#include <string>
using namespace std;
void pause(string s);
int main()
{
pause("end test0");
return 0;
}
//---func definitions----
void pause(string s)
{
char c;
cout << s; cin >> c;
}
//---END CODE-----------
//---COMPILER OUTPUT----
cd /home/bturnip/cs417/mod2/
make -k
g++ -g -o nlibtest nlibtest0.cpp
nlibtest0.cpp:9: `string' was not declared in this scope
nlibtest0.cpp:9: parse error before `)' token
nlibtest0.cpp:18: `string' was not declared in this scope
nlibtest0.cpp:18: parse error before `)' token
nlibtest0.cpp: In function `void pause(...)':
nlibtest0.cpp:21: `s' undeclared (first use this function)
nlibtest0.cpp:21: (Each undeclared identifier is reported only once
for each function it appears in.)
make: *** [nlibtest] Error 1
Compilation exited abnormally with code 2 at Thu Aug 14 22:35:40
//---END COMPILER OUTPUT-
I am working on a program where I am including a library that came with my
numerical methods textbook. The "util.h" simply includes a large number
of files. I had to change the util.h slightly to adjust path names and
also take into account I am working with a case-sensitive OS.
My program is below. The sticky point is that adding (#include "util.h")
seems to negate the (#include <string>) statement somehow. How can I get
around this? For obvious size reasons, I don't include the util.h
library, etc. I did include the compiler error messages below.
As always, thanks!
Danny
//---START CODE---------
/*
* Commenting out the first #include allows for program compilation
* on my Redhat9.0 box using g++ 3.2.2.
*
*/
#include "util.h" //modified NLIB for my gnu/linux system
#include <iostream>
#include <string>
using namespace std;
void pause(string s);
int main()
{
pause("end test0");
return 0;
}
//---func definitions----
void pause(string s)
{
char c;
cout << s; cin >> c;
}
//---END CODE-----------
//---COMPILER OUTPUT----
cd /home/bturnip/cs417/mod2/
make -k
g++ -g -o nlibtest nlibtest0.cpp
nlibtest0.cpp:9: `string' was not declared in this scope
nlibtest0.cpp:9: parse error before `)' token
nlibtest0.cpp:18: `string' was not declared in this scope
nlibtest0.cpp:18: parse error before `)' token
nlibtest0.cpp: In function `void pause(...)':
nlibtest0.cpp:21: `s' undeclared (first use this function)
nlibtest0.cpp:21: (Each undeclared identifier is reported only once
for each function it appears in.)
make: *** [nlibtest] Error 1
Compilation exited abnormally with code 2 at Thu Aug 14 22:35:40
//---END COMPILER OUTPUT-