c++ - Accelerated C++
- jim p (25/25) Jul 02 2003 I'm finally getting around to teaching myself C++ using DM.
- Andrew Edwards (7/8) Jul 02 2003 I think it's the same reason you cannot use the following:
- jim p (3/13) Jul 02 2003 So the -A switch for strict ANSI is of little use ?
- Andrew Edwards (11/12) Jul 02 2003 I wouldn't say that. Considering that the follwing code works just fine,...
- Wichetael (15/40) Jul 02 2003 This is because the way the SGI iostream library is set up, it is not fu...
- jim p (14/65) Jul 02 2003 I've updated my CD releases until the latest one.
-
Walter
(3/4)
Jul 02 2003
is in \dm\stlport\stlport. Try using the -I\dm\stlport\stlpor...
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 ??I think it's the same reason you cannot use the following: using namespace std; It is not yet implemented; DM it is not yet fully ANSI compliant. Regards, Andrew
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 ??I think it's the same reason you cannot use the following: using namespace std; It is not yet implemented; DM it is not yet fully ANSI compliant. Regards, Andrew
Jul 02 2003
"jim p" <x y.com> wrote ...So the -A switch for strict ANSI is of little use ?I wouldn't say that. Considering that the follwing code works just fine, I would say it's just not fully implemented as yet. // a small C++ program #include <iostream.h> // not the added extension .h using namespace std; // as stated by the ANSI standard int main() { cout << "Hello, world!" << endl; return 0; }
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 beANSI)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
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 allError on line 63: bad syntax for implicit rule, should be .frm.to: Any ideas why this is happening ?? James "Wichetael" <wichetael gmx.net> wrote in message news:bdug0k$2h2u$1 digitaldaemon.com...This is because the way the SGI iostream library is set up, it is notfullyimplemented yet and is still experimental. There are indeed two versionsofthe iostreams library, one which is iostream.h, which simply defines everything in the global namespace and iostream, which defines everythinginthe std namespace. The SGI iostreams implementation does not yet includetheiostream header, which is why you get an error for your program. Whatyou'dwant to do is use STLport instead, you can get it off the DM CD ordownloadthe 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 beANSI)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 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 followingTo build the STLport libraries and dll's: cd \dm\stlport\src smake -f dm.mak which will build them into \dm\stlport\lib. To install them: xcopy \dm\stlport\lib\*.lib \dm\lib xcopy \dm\stlport\lib\*.dll \dm\bin Please check out \dm\stlport\readme.txt for more details.make -fdm.mak clean allError on line 63: bad syntax for implicit rule, should be .frm.to: Any ideas why this is happening ??
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 followingTo build the STLport libraries and dll's: cd \dm\stlport\src smake -f dm.mak which will build them into \dm\stlport\lib. To install them: xcopy \dm\stlport\lib\*.lib \dm\lib xcopy \dm\stlport\lib\*.dll \dm\bin Please check out \dm\stlport\readme.txt for more details.make -fdm.mak clean allError on line 63: bad syntax for implicit rule, should be .frm.to: Any ideas why this is happening ??
Jul 02 2003