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. why Function Name in DLL so strange ?

why Function Name in DLL so strange ?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
8 Posts 7 Posters 1 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.
  • J Offline
    J Offline
    jinzhecheng
    wrote on last edited by
    #1

    I got a DLL, in its function declare their is a function: EXPORT int func1(); But when I display it in Dependency Walker, the actual name is something like: _func1@0 This DLL is compiled in visual c++ 6.0, I am wondering if there is an option cause this problem. Thanks

    D T C J B 5 Replies Last reply
    0
    • J jinzhecheng

      I got a DLL, in its function declare their is a function: EXPORT int func1(); But when I display it in Dependency Walker, the actual name is something like: _func1@0 This DLL is compiled in visual c++ 6.0, I am wondering if there is an option cause this problem. Thanks

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

      jinzhecheng wrote:

      ...I am wondering if there is an option cause this problem.

      What problem? C functions are decorated with a leading underscore. Check whether you are using __cdecl or __stdcall.


      "Take only what you need and leave the land as you found it." - Native American Proverb

      1 Reply Last reply
      0
      • J jinzhecheng

        I got a DLL, in its function declare their is a function: EXPORT int func1(); But when I display it in Dependency Walker, the actual name is something like: _func1@0 This DLL is compiled in visual c++ 6.0, I am wondering if there is an option cause this problem. Thanks

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        did you ever look a what the compiler generates ? this is called decorated names, exactly such as your func1()...


        TOXCCT >>> GEII power
        [toxcct][VisualCalc 2.20][VisualCalc 3.0]

        V 1 Reply Last reply
        0
        • J jinzhecheng

          I got a DLL, in its function declare their is a function: EXPORT int func1(); But when I display it in Dependency Walker, the actual name is something like: _func1@0 This DLL is compiled in visual c++ 6.0, I am wondering if there is an option cause this problem. Thanks

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #4

          if you want undecorated names, you'll need to use a .DEF file Cleek | Image Toolkits | Thumbnail maker

          1 Reply Last reply
          0
          • J jinzhecheng

            I got a DLL, in its function declare their is a function: EXPORT int func1(); But when I display it in Dependency Walker, the actual name is something like: _func1@0 This DLL is compiled in visual c++ 6.0, I am wondering if there is an option cause this problem. Thanks

            J Offline
            J Offline
            jinzhecheng
            wrote on last edited by
            #5

            Thanks , I have created a def file, and its gone!

            1 Reply Last reply
            0
            • J jinzhecheng

              I got a DLL, in its function declare their is a function: EXPORT int func1(); But when I display it in Dependency Walker, the actual name is something like: _func1@0 This DLL is compiled in visual c++ 6.0, I am wondering if there is an option cause this problem. Thanks

              B Offline
              B Offline
              Bob Stanneveld
              wrote on last edited by
              #6

              Hello, This is what the C++ compiler does to your function names. The process is called name mangling[^]. You can use extern C to say to the compiler that you only wish to add an underscore to the function name. This disables any overloading..

              extern "C"
              {
              void func1();
              // more functions here
              }

              Hope this helps. :) Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

              1 Reply Last reply
              0
              • T toxcct

                did you ever look a what the compiler generates ? this is called decorated names, exactly such as your func1()...


                TOXCCT >>> GEII power
                [toxcct][VisualCalc 2.20][VisualCalc 3.0]

                V Offline
                V Offline
                vikas amin
                wrote on last edited by
                #7

                this is called decorated names, exactly such as your func1()... I hope u mean Name Mangling by saying decorated names, Vikas Amin Embin Technology Bombay vikas.amin@embin.com

                E 1 Reply Last reply
                0
                • V vikas amin

                  this is called decorated names, exactly such as your func1()... I hope u mean Name Mangling by saying decorated names, Vikas Amin Embin Technology Bombay vikas.amin@embin.com

                  E Offline
                  E Offline
                  Eytukan
                  wrote on last edited by
                  #8

                  "decorated names" are more commonly used.


                  "But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho

                  --[V]--

                  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