PDA

View Full Version : C++ and web access



outsider
03-07-2004, 06:14 PM
I done some programming in UNIX and I hope to port it over to Linux. What should I do? I am new to Linux. Need to use for programming and web access. What are the steps to d so? Does Knoppix comes with gcc, perl and web access(e.g. setup webserver)?

fingers99
03-07-2004, 09:30 PM
Yes to all 3 :wink:

You might like to see if there's a compatable gcc on your *nix system. From (ancient) memory, it's nice to check that the code compiles on gcc on the original platform before trying to port it over -- it rules out compiler quirks.

On my *nix course I used to drive everyone nuts by insisting on using bash instead of ksh and gcc instead of whatever compiler HP-UX has as default.

outsider
03-08-2004, 11:21 AM
So what are the steps to setup the web server? Does it have CGI?

fingers99
03-08-2004, 04:17 PM
It's Apache. CGI is available (although very much out of fashion). Just get hold of the Apache documentation: it's all there.

outsider
03-09-2004, 05:07 AM
Can anyone help me? I was trying to compile in Knoppix, but I got the following error. When I did it in Sun Solaris, it was ok. What is wrong?

g++ -c stopword.cpp
In file included from stopword.cpp:3:
stopword.h:6:20: hash_set: No such file or directory
In file included from /usr/include/c++/3.3/backward/fstream.h:31,
from stopword.h:7,
from stopword.cpp:3:
/usr/include/c++/3.3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
In file included from stopword.cpp:3:
stopword.h:19: error: `hash' was not declared in this scope
stopword.h:19: error: parse error before `char'
stopword.cpp: In member function `void CStopWord::load(char*)':
stopword.cpp:16: error: `ios' undeclared (first use this function)
stopword.cpp:16: error: (Each undeclared identifier is reported only once for
each function it appears in.)
stopword.cpp:16: error: parse error before `::' token
stopword.cpp:19: error: request for member `fail' in `stopwordFile', which is
of non-aggregate type `std::fstream ()(...)'
stopword.cpp:21: error: `cout' undeclared (first use this function)
stopword.cpp:29: error: request for member `getline' in `stopwordFile', which
is of non-aggregate type `std::fstream ()(...)'
stopword.cpp:39: error: `stopwordSet' undeclared (first use this function)
stopword.cpp: In member function `bool CStopWord::lookup(const char*)':
stopword.cpp:49: error: `hash_set' undeclared (first use this function)
stopword.cpp:49: error: parse error before `char'
stopword.cpp:50: error: `it' undeclared (first use this function)

outsider
03-09-2004, 05:02 PM
:?:

A. Jorge Garcia
03-09-2004, 09:45 PM
Take a look at:

http://www.knoppix.net/forum/viewtopic.php?p=38190

Good Luck!

Regards,
AJG

outsider
03-10-2004, 12:00 AM
what are the changes that I need to make?
It can't seem to find hash_set which is a library file.

"stopword.h:6:20: hash_set: No such file or directory"

Stephen
03-10-2004, 01:01 AM
what are the changes that I need to make?
It can't seem to find hash_set which is a library file.

"stopword.h:6:20: hash_set: No such file or directory"

It could be one of several packages if you are installed to the HD then you should check to see if you have them installed, the search at http://packages.debian.org.

http://packages.debian.org/cgi-bin/search_contents.pl?word=hash_set&arch=i386&version=testing&searchmode=searchfilesanddirs&case=insensitive

A. Jorge Garcia
03-10-2004, 01:13 AM
g++ requires

using namespace std;

are you including this line?

Regards,
AJG

outsider
03-10-2004, 02:45 PM
It still does not work even though I included "using namespace std;".

It still have the error "stopword.h:6:20: hash_set: No such file or directory"

A. Jorge Garcia
03-10-2004, 08:54 PM
Maybe if you found the folder where that interface file resides you can add the -I option for g++ to find include files in other directories. For example, if stopword.h is in the folder /usr/bin/gcc and I needed it in my hello world program hello.cc the compile line would be something like:

g++ -o hello -I/usr/bin/gcc hello.cc

HTH,
AJG