Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

gnu g++ problem when compiling

Status
Not open for further replies.

ktrumbla

MIS
Oct 24, 2001
13
US
AIX version 4.3.3
g++ version 2.95.3.0
when I try to compile my program it gives me an error Collect2: Library libm not found. I can not find a library libm on bulls freeware where I had gotten g++ from.
here is my code, any help would be appreciated.
the command I used to compile was "g++ parsing.cpp".

When compiled with MS Visual C++ as a consol application works perfectly

THIS PROGRAM IS USELESS THE WAY IT IS BUT i AM TESTING THE FUNCTIONALITY FOR ANOTHER PERPOSE.

#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main()
{
string field[23];

string line;
int Pipe;
int counter;
ifstream inputfile;
ofstream outputfile;

inputfile.open (&quot;filename&quot;);
outputfile.open (&quot;output.txt&quot;);
if ( !inputfile )
{
cout << &quot;FILE NOT OPENED&quot;;
return 1;
}

while (true)
{
getline(inputfile, line); // priming read for EOF

if(inputfile.eof()) // break on EOF
break;

for(counter = 0; counter < 23; counter++)
{
Pipe = line.find(&quot;|&quot;);
field[counter] = line.substr(0, Pipe);
line = line.substr(Pipe + 1);
outputfile << field[counter] << &quot;|&quot;;
}

outputfile << endl;
}

return 0;
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top