Linker Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pravin Prabhu

    #1

    Linker Error

    Hi,
    I have a VC 6 project with a few C source code files,and one c++ source
    file. When I refer to any function in the c++ file from the C file, i get a
    Linker error saying that "error LNK2001: unresolved external symbol
    _AddPicture" ( AddPicture) is the name of the function that i am referring
    to. Function Protoypes and header files have been defined correctly.

    Thanks and Regards
  • Jeff Partch [MVP]

    #2
    Re: Linker Error

    "Pravin Prabhu" <prabhu.pravin@ gmail.com> wrote in message
    news:AB1A54B1-3DAB-4A5E-89CF-ABDE6E7C1293@mi crosoft.com...[color=blue]
    > Hi,
    > I have a VC 6 project with a few C source code files,and one c++[/color]
    source[color=blue]
    > file. When I refer to any function in the c++ file from the C file, i get[/color]
    a[color=blue]
    > Linker error saying that "error LNK2001: unresolved external symbol
    > _AddPicture" ( AddPicture) is the name of the function that i am[/color]
    referring[color=blue]
    > to. Function Protoypes and header files have been defined correctly.[/color]

    Do you use EXTERN_C ?
    --
    Jeff Partch [VC++ MVP]


    Comment

    • Pravin Prabhu

      #3
      Re: Linker Error

      No i am not using EXTERN_C, am i supposed to use it ? how...

      thanks

      "Jeff Partch [MVP]" wrote:
      [color=blue]
      > "Pravin Prabhu" <prabhu.pravin@ gmail.com> wrote in message
      > news:AB1A54B1-3DAB-4A5E-89CF-ABDE6E7C1293@mi crosoft.com...[color=green]
      > > Hi,
      > > I have a VC 6 project with a few C source code files,and one c++[/color]
      > source[color=green]
      > > file. When I refer to any function in the c++ file from the C file, i get[/color]
      > a[color=green]
      > > Linker error saying that "error LNK2001: unresolved external symbol
      > > _AddPicture" ( AddPicture) is the name of the function that i am[/color]
      > referring[color=green]
      > > to. Function Protoypes and header files have been defined correctly.[/color]
      >
      > Do you use EXTERN_C ?
      > --
      > Jeff Partch [VC++ MVP]
      >
      >
      >[/color]

      Comment

      • Jeff Partch [MVP]

        #4
        Re: Linker Error

        "Pravin Prabhu" <prabhu.pravin@ gmail.com> wrote in message
        news:DC9C5ADB-E41F-4911-8BD8-676E26630F92@mi crosoft.com...[color=blue]
        > No i am not using EXTERN_C, am i supposed to use it ? how...[/color]

        EXTERN_C VOID FuncForCppOrC(V OID);
        --
        Jeff Partch [VC++ MVP]


        Comment

        • Pravin Prabhu

          #5
          Re: Linker Error

          Yes...It works now..Thanks Jeff

          "Jeff Partch [MVP]" wrote:
          [color=blue]
          > "Pravin Prabhu" <prabhu.pravin@ gmail.com> wrote in message
          > news:DC9C5ADB-E41F-4911-8BD8-676E26630F92@mi crosoft.com...[color=green]
          > > No i am not using EXTERN_C, am i supposed to use it ? how...[/color]
          >
          > EXTERN_C VOID FuncForCppOrC(V OID);
          > --
          > Jeff Partch [VC++ MVP]
          >
          >
          >[/color]

          Comment

          Working...