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. Is this a bug of VC2005?

Is this a bug of VC2005?

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
6 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.
  • Z Offline
    Z Offline
    zengkun100
    wrote on last edited by
    #1

    int nmaxint = std::numeric_limits::max();

    this line generates two compile errors when I built in vs2005 sp1. error C2589: '(' : illegal token on right side of '::' error C2059: syntax error : '::' I don't think there are something wrong in this line. PLZ help :)

    A Chinese VC++ programmer

    Z N 2 Replies Last reply
    0
    • Z zengkun100

      int nmaxint = std::numeric_limits::max();

      this line generates two compile errors when I built in vs2005 sp1. error C2589: '(' : illegal token on right side of '::' error C2059: syntax error : '::' I don't think there are something wrong in this line. PLZ help :)

      A Chinese VC++ programmer

      Z Offline
      Z Offline
      zengkun100
      wrote on last edited by
      #2

      sorry, I mean std::numeric_limits::max(); the "" part was ripped. A Chinese VC++ programmer

      1 Reply Last reply
      0
      • Z zengkun100

        int nmaxint = std::numeric_limits::max();

        this line generates two compile errors when I built in vs2005 sp1. error C2589: '(' : illegal token on right side of '::' error C2059: syntax error : '::' I don't think there are something wrong in this line. PLZ help :)

        A Chinese VC++ programmer

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #3

        I think this error is coming because of the max() macro. Try one thing. Just above the include of limit.h, put #undef max

        nave [OpenedFileFinder] [My Blog]

        Z 1 Reply Last reply
        0
        • N Naveen

          I think this error is coming because of the max() macro. Try one thing. Just above the include of limit.h, put #undef max

          nave [OpenedFileFinder] [My Blog]

          Z Offline
          Z Offline
          zengkun100
          wrote on last edited by
          #4

          Naveen wrote:

          #undef max

          Maybe you are right! When I choose the "Go To Definition" menu item in the context menu, the ide open "windef.h", not STL's limit. It does work when I undef max. :laugh:

          A Chinese VC++ programmer

          C 1 Reply Last reply
          0
          • Z zengkun100

            Naveen wrote:

            #undef max

            Maybe you are right! When I choose the "Go To Definition" menu item in the context menu, the ide open "windef.h", not STL's limit. It does work when I undef max. :laugh:

            A Chinese VC++ programmer

            C Offline
            C Offline
            CPallini
            wrote on last edited by
            #5

            zengkun100 wrote:

            When I choose the "Go To Definition" menu item in the context menu, the ide open "windef.h", not STL's limit.

            zengkun100 wrote:

            It does work when I undef max.

            zengkun100 wrote:

            Maybe you are right!

            How many evidences do you need? :-D

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            Z 1 Reply Last reply
            0
            • C CPallini

              zengkun100 wrote:

              When I choose the "Go To Definition" menu item in the context menu, the ide open "windef.h", not STL's limit.

              zengkun100 wrote:

              It does work when I undef max.

              zengkun100 wrote:

              Maybe you are right!

              How many evidences do you need? :-D

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              Z Offline
              Z Offline
              zengkun100
              wrote on last edited by
              #6

              Thank you! :-D

              A Chinese VC++ programmer

              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