Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Reagarding error with ostream

Reagarding error with ostream

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadminalgorithmshelp
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Manoj7390
    wrote on last edited by
    #1

    Hi.. I have implemented ECC algorithm in C++ and it is working fine with g++ compiler... I need to apply this program to network simulator - 3. Complier of NS-3 is "./waf", there it is not building and it is giving countless errors mainly regarding "ostream". there is a line regarding ostream in my header function....---

    // ostream handler
    template<int T>
    friend ostream& operator<<(ostream& os, const FiniteFieldElement<T>& g)
    {
    return os << g.i_;
    }

    L 1 Reply Last reply
    0
    • M Manoj7390

      Hi.. I have implemented ECC algorithm in C++ and it is working fine with g++ compiler... I need to apply this program to network simulator - 3. Complier of NS-3 is "./waf", there it is not building and it is giving countless errors mainly regarding "ostream". there is a line regarding ostream in my header function....---

      // ostream handler
      template<int T>
      friend ostream& operator<<(ostream& os, const FiniteFieldElement<T>& g)
      {
      return os << g.i_;
      }

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Manoj7390 wrote:

      it is giving countless errors

      Without the detail of those errors no one can guess what is wrong.

      Use the best guess

      M 1 Reply Last reply
      0
      • L Lost User

        Manoj7390 wrote:

        it is giving countless errors

        Without the detail of those errors no one can guess what is wrong.

        Use the best guess

        M Offline
        M Offline
        Manoj7390
        wrote on last edited by
        #3

        In the main program i am calling another header function called "FiniteFieldElement.h" function. In that function i have used --

        // ostream handler
        template<int T>
        friend ostream& operator<<(ostream& os, const FiniteFieldElement<T>& g)
        {
        return os << g.i_;
        }

        I am calling this function and using "ostream" in so many places in main function. I am getting the errors like.. /usr/include/c++/4.6/ostream:493:5: note: template std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const _CharT*) /usr/include/c++/4.6/ostream:473:5: note: template std::basic_ostream& std::operator<<(std::basic_ostream&, unsigned char) /usr/include/c++/4.6/ostream:468:5: note: template std::basic_ostream& std::operator<<(std::basic_ostream&, signed char) /usr/include/c++/4.6/ostream:462:5: note: template std::basic_ostream& std::operator<<(std::basic_ostream&, char) /usr/include/c++/4.6/ostream:456:5: note: template std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) /usr/include/c++/4.6/ostream:451:5: note: template std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, _CharT)

        L 1 Reply Last reply
        0
        • M Manoj7390

          In the main program i am calling another header function called "FiniteFieldElement.h" function. In that function i have used --

          // ostream handler
          template<int T>
          friend ostream& operator<<(ostream& os, const FiniteFieldElement<T>& g)
          {
          return os << g.i_;
          }

          I am calling this function and using "ostream" in so many places in main function. I am getting the errors like.. /usr/include/c++/4.6/ostream:493:5: note: template std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const _CharT*) /usr/include/c++/4.6/ostream:473:5: note: template std::basic_ostream& std::operator<<(std::basic_ostream&, unsigned char) /usr/include/c++/4.6/ostream:468:5: note: template std::basic_ostream& std::operator<<(std::basic_ostream&, signed char) /usr/include/c++/4.6/ostream:462:5: note: template std::basic_ostream& std::operator<<(std::basic_ostream&, char) /usr/include/c++/4.6/ostream:456:5: note: template std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) /usr/include/c++/4.6/ostream:451:5: note: template std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, _CharT)

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I'm not sure that

          template

          is correct for overloading the << operator. See http://msdn.microsoft.com/en-us/library/1z2f6c2k.aspx[^].

          Use the best guess

          M 1 Reply Last reply
          0
          • L Lost User

            I'm not sure that

            template

            is correct for overloading the << operator. See http://msdn.microsoft.com/en-us/library/1z2f6c2k.aspx[^].

            Use the best guess

            M Offline
            M Offline
            Manoj7390
            wrote on last edited by
            #5

            I think it is not the problem with the code, because i am getting the output with g++ compiler. Now i am using ./waf compiler for NS-3, where i am facing problem. I am not sure ostream is supported by NS-3 because there they use NS_LOG_UNCOND("message") instead of "cout". I am getting errors where i have used ostream. What do you mean by "ostream" and is it compiler dependent.

            L 1 Reply Last reply
            0
            • M Manoj7390

              I think it is not the problem with the code, because i am getting the output with g++ compiler. Now i am using ./waf compiler for NS-3, where i am facing problem. I am not sure ostream is supported by NS-3 because there they use NS_LOG_UNCOND("message") instead of "cout". I am getting errors where i have used ostream. What do you mean by "ostream" and is it compiler dependent.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Manoj7390 wrote:

              What do you mean by "ostream"

              I don't mean anything by it, it is part of the standard C++ library. Also, I have no idea what ./waf compiler for NS-3 is, or what features it supports.

              Use the best guess

              CPalliniC 1 Reply Last reply
              0
              • L Lost User

                Manoj7390 wrote:

                What do you mean by "ostream"

                I don't mean anything by it, it is part of the standard C++ library. Also, I have no idea what ./waf compiler for NS-3 is, or what features it supports.

                Use the best guess

                CPalliniC Offline
                CPalliniC Offline
                CPallini
                wrote on last edited by
                #7

                Richard MacCutchan wrote:

                I have no idea what ./waf compiler

                I suspect it is not even a compiler: waf[^].

                Veni, vidi, vici.

                In testa che avete, signor di Ceprano?

                L 1 Reply Last reply
                0
                • CPalliniC CPallini

                  Richard MacCutchan wrote:

                  I have no idea what ./waf compiler

                  I suspect it is not even a compiler: waf[^].

                  Veni, vidi, vici.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  No surprise there. ;)

                  Use the best guess

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups