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. std::string declaration in header file error

std::string declaration in header file error

Scheduled Pinned Locked Moved C / C++ / MFC
5 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
    Member 12244972
    wrote on last edited by
    #1

    Hi, I need your help a bit in C++. I am coding a dll but my source code has 2 errors. Both issues stem from the same declaration in my header file.

    void execute_assert(bool expr, std::string str);

    When I do the function calls...

    v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

    and

    v_assert(s < 1, "Illegal acl size (" + deb + ")");

    I get the error message...

    Error: too many arguments to function ‘void execute_assert(bool, std::string)’

    On both counts, the parameter count is ok, so what's the problem? Please help.

    D L 2 Replies Last reply
    0
    • M Member 12244972

      Hi, I need your help a bit in C++. I am coding a dll but my source code has 2 errors. Both issues stem from the same declaration in my header file.

      void execute_assert(bool expr, std::string str);

      When I do the function calls...

      v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

      and

      v_assert(s < 1, "Illegal acl size (" + deb + ")");

      I get the error message...

      Error: too many arguments to function ‘void execute_assert(bool, std::string)’

      On both counts, the parameter count is ok, so what's the problem? Please help.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Does v_assert() call execute_assert() or vice-versa?

      Member 12244972 wrote:

      v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

      Shouldn't this be:

      v_assert(s == MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

      or maybe

      v_assert((s == MAX_ACL_DEPTH), "MAX_ACL_DEPTH too small");

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

      M 1 Reply Last reply
      0
      • D David Crow

        Does v_assert() call execute_assert() or vice-versa?

        Member 12244972 wrote:

        v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

        Shouldn't this be:

        v_assert(s == MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

        or maybe

        v_assert((s == MAX_ACL_DEPTH), "MAX_ACL_DEPTH too small");

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        M Offline
        M Offline
        Member 12244972
        wrote on last edited by
        #3

        I was making the wrong function call.

        v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

        should have been

        execute_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

        Problem fixed. Thanks all.

        1 Reply Last reply
        0
        • M Member 12244972

          Hi, I need your help a bit in C++. I am coding a dll but my source code has 2 errors. Both issues stem from the same declaration in my header file.

          void execute_assert(bool expr, std::string str);

          When I do the function calls...

          v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

          and

          v_assert(s < 1, "Illegal acl size (" + deb + ")");

          I get the error message...

          Error: too many arguments to function ‘void execute_assert(bool, std::string)’

          On both counts, the parameter count is ok, so what's the problem? Please help.

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

          Where is the definition of v_assert, is is a macro?

          M 1 Reply Last reply
          0
          • L Lost User

            Where is the definition of v_assert, is is a macro?

            M Offline
            M Offline
            Member 12244972
            wrote on last edited by
            #5

            I was making the wrong function call.

            v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

            should have been

            execute_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

            Problem fixed. Thanks all.

            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