c function in c++

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mathudiv@gmail.com

    c function in c++

    error LNK2019: unresolved external symbol __imp__fwrite referenced in
    function "void __stdcall dg729(void)" (?dg729@@YGXXZ)

    error LNK2001: unresolved external symbol __imp__fwrite

    how to use .c function in c++ code
  • Ian Collins

    #2
    Re: c function in c++

    mathudiv@gmail. com wrote:
    error LNK2019: unresolved external symbol __imp__fwrite referenced in
    function "void __stdcall dg729(void)" (?dg729@@YGXXZ)
    >
    error LNK2001: unresolved external symbol __imp__fwrite
    >
    how to use .c function in c++ code
    Make sure it is declared extern "C".

    --
    Ian Collins.

    Comment

    • Jim Langston

      #3
      Re: c function in c++

      mathudiv@gmail. com wrote:
      error LNK2019: unresolved external symbol __imp__fwrite referenced in
      function "void __stdcall dg729(void)" (?dg729@@YGXXZ)
      >
      error LNK2001: unresolved external symbol __imp__fwrite
      >
      how to use .c function in c++ code
      extern "C"
      {
      void __stdcall dg729();
      }

      int main()
      {
      dg729();
      }

      --
      Jim Langston
      tazmaster@rocke tmail.com


      Comment

      • Eberhard Schefold

        #4
        Re: c function in c++

        mathudiv@gmail. com wrote:
        error LNK2019: unresolved external symbol __imp__fwrite referenced in
        function "void __stdcall dg729(void)" (?dg729@@YGXXZ)
        >
        error LNK2001: unresolved external symbol __imp__fwrite
        This is an error specific to your particular development system (MS VC),
        and therefore off-topic in this newsgroup.

        In a nutshell, you (or somebody else in case you're using a third-party
        lib) compiled code with an option (/MD) to use the C Runtime code of a
        shared DLL, but then you try to link with the static library version of
        that Runtime code.

        Consolidate your project settings (or, in case of a third-party lib, get
        the version that was appropriately compiled).

        If you have further questions, look for the appropriate newsgroup in the
        microsoft.* hierarchy.

        Comment

        Working...