Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - Accelerated C++
I'm finally getting around to teaching myself C++ using DM. The book I'm using is Accelerated C++. I only started today, but the already the simple examples (said to be ANSI) are not compiling. For example: // a small C++ program #include <iostream> int main() { std::cout << "Hello, world!" << std::endl; return 0; } This fails because it requires the #include to include the .h extension. Changing this and recompiling gives the following messages: tip.cpp: std::cout << "Hello, world!" << std::endl; ^ tip.cpp(6) : Error: 'cout' is not a member of namespace 'std' std::cout << "Hello, world!" << std::endl; ^ tip.cpp(6) : Warning 6: value of expression is not used tip.cpp(10) : Error: need at least one external def --- errorlevel 1 OK, I know it works when std:: is removed, but why ?? Jim Jul 02 2003
"jim p" <x y.com> wrote...OK, I know it works when std:: is removed, but why ?? Jul 02 2003
So the -A switch for strict ANSI is of little use ? "Andrew Edwards" <edwardsac spamfreeusa.com> wrote in message news:bdu928$2ai6$1 digitaldaemon.com..."jim p" <x y.com> wrote...OK, I know it works when std:: is removed, but why ?? Jul 02 2003
"jim p" <x y.com> wrote ...So the -A switch for strict ANSI is of little use ? Jul 02 2003
This is because the way the SGI iostream library is set up, it is not fully implemented yet and is still experimental. There are indeed two versions of the iostreams library, one which is iostream.h, which simply defines everything in the global namespace and iostream, which defines everything in the std namespace. The SGI iostreams implementation does not yet include the iostream header, which is why you get an error for your program. What you'd want to do is use STLport instead, you can get it off the DM CD or download the latest version from the DM site. Follow the installation instructions and make sure you place the stlport path before the SGI stl path in the SC.INI file. Try your initial program again and you should find that it compiles and works beautifully. Regards, Remko van der Vossen "jim p" <x y.com> wrote in message news:bdu7ib$294j$1 digitaldaemon.com...I'm finally getting around to teaching myself C++ using DM. The book I'm using is Accelerated C++. I only started today, but the already the simple examples (said to be Jul 02 2003
I've updated my CD releases until the latest one. I've downloaded and installed the STLport files. When I try to make the library I get the followingmake -fdm.mak clean all Jul 02 2003
"jim p" <x y.com> wrote in message news:bdv45r$5kk$1 digitaldaemon.com...I've updated my CD releases until the latest one. I've downloaded and installed the STLport files. When I try to make the library I get the followingmake -fdm.mak clean all Jul 02 2003
Cheers Walter. I found the readme.txt at the same time I got your reply. "Walter" <walter digitalmars.com> wrote in message news:bdv7pa$9es$2 digitaldaemon.com..."jim p" <x y.com> wrote in message news:bdv45r$5kk$1 digitaldaemon.com...I've updated my CD releases until the latest one. I've downloaded and installed the STLport files. When I try to make the library I get the followingmake -fdm.mak clean all Jul 02 2003
"jim p" <x y.com> wrote in message news:bdu7ib$294j$1 digitaldaemon.com...This fails because it requires the #include to include the .h extension. Jul 02 2003
|