CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Aug 2009
    Posts
    23

    Unhappy [SOLVED] unresolved external symbol "int __cdecl _.." between C and Cpp file

    Hi all, I am receiving a

    "error LNK2019: unresolved external symbol "int __cdecl _function(...)" error while trying to compile the following files:

    main.cpp
    --------------------------------------------
    #include "function.h"


    int main()
    {

    function(0, 0);

    return 0;
    }

    ---------------------------------------------


    function.h
    --------------------------------------------

    #ifndef FNC_H
    #define FNC_H

    extern void function(int a, int b);

    #endif
    ---------------------------------------------


    function.c
    --------------------------------------------

    #include "function.h"

    void function(int a, int b);
    {
    // do something here
    }
    ---------------------------------------------



    Seems like the program cannot find the function's definition. Why is that?
    Am I missing something with the association .h -> .c ?

    Please give me suggestions
    Last edited by leKoxn; April 20th, 2010 at 02:20 PM. Reason: problem solved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured