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. error C3861?

error C3861?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
5 Posts 5 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.
  • D Offline
    D Offline
    Divyang Mithaiwala
    wrote on last edited by
    #1

    Hello all, I am working in VC++ 2005. In this i want to make one dll. But for that i use one already exist ".c" file. Now when i include a header file for that & call one of function it will get me the error of ollowing type.

    error C3861: 'function_name' : identifier not found
    

    Is it possible that i use ".c" in ".cpp" file? When i edit in file the editor give me the complate definetion of that function. So why it will gove me the complie time error.


    Divyang Mithaiwala System Engineer & Software Developer

    C R T 3 Replies Last reply
    0
    • D Divyang Mithaiwala

      Hello all, I am working in VC++ 2005. In this i want to make one dll. But for that i use one already exist ".c" file. Now when i include a header file for that & call one of function it will get me the error of ollowing type.

      error C3861: 'function_name' : identifier not found
      

      Is it possible that i use ".c" in ".cpp" file? When i edit in file the editor give me the complate definetion of that function. So why it will gove me the complie time error.


      Divyang Mithaiwala System Engineer & Software Developer

      C Offline
      C Offline
      color Aljechin
      wrote on last edited by
      #2

      Divyang Mithaiwala wrote:

      Divyang Mithaiwala System Engineer & Software Developer

      Hmm... =A-L-J-E-C-H-I-N=

      T 1 Reply Last reply
      0
      • D Divyang Mithaiwala

        Hello all, I am working in VC++ 2005. In this i want to make one dll. But for that i use one already exist ".c" file. Now when i include a header file for that & call one of function it will get me the error of ollowing type.

        error C3861: 'function_name' : identifier not found
        

        Is it possible that i use ".c" in ".cpp" file? When i edit in file the editor give me the complate definetion of that function. So why it will gove me the complie time error.


        Divyang Mithaiwala System Engineer & Software Developer

        R Offline
        R Offline
        RichardS
        wrote on last edited by
        #3

        Hi Divyang, You can't just call C functions from C++ functions. It has something to do with the calling conventions. All you have to do is tell the C++ compiler that the functions are C functions not C++ functions. There are a few ways of doing this but the way I normally do it is:extern "C" { #include "myCPrototypes.h" }
        This way the compiler knows that the functions in the header are all C functions and will generate the calling code appropreately. regards, Rich "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning." -- Rich Cook

        1 Reply Last reply
        0
        • C color Aljechin

          Divyang Mithaiwala wrote:

          Divyang Mithaiwala System Engineer & Software Developer

          Hmm... =A-L-J-E-C-H-I-N=

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

          :laugh:

          1 Reply Last reply
          0
          • D Divyang Mithaiwala

            Hello all, I am working in VC++ 2005. In this i want to make one dll. But for that i use one already exist ".c" file. Now when i include a header file for that & call one of function it will get me the error of ollowing type.

            error C3861: 'function_name' : identifier not found
            

            Is it possible that i use ".c" in ".cpp" file? When i edit in file the editor give me the complate definetion of that function. So why it will gove me the complie time error.


            Divyang Mithaiwala System Engineer & Software Developer

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            try extern 'c' { /*put your C code in this */ } syntax

            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