about header file in c

can tell me how to insert a header file which is created by myself?

i created the header file, but when i compile my main.c , i facing this problem :
main.obj : error LNK2001: unresolved external symbol _snooptree
main.obj : error LNK2001: unresolved external symbol _sorting
Debug/main.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

please help me ~ thankx

Comments

  • [b][red]This message was edited by ploto at 2002-12-1 6:13:27[/red][/b][hr]
    Solve this problem by adding your c files to your project
    what is append that you include your header file and not
    the c file(s).
    The error is not from the compiler it's from the linker.
    This mean all syntax and headers are ok but when
    the linker search for all the source it didn't found the source code
    of all the functions so its return linker error

    if you are in Visual C add files to project like that
    Project->Add files -> (your C file) and it will solve your problem


    : can tell me how to insert a header file which is created by myself?
    :
    : i created the header file, but when i compile my main.c , i facing this problem :
    : main.obj : error LNK2001: unresolved external symbol _snooptree
    : main.obj : error LNK2001: unresolved external symbol _sorting
    : Debug/main.exe : fatal error LNK1120: 2 unresolved externals
    : Error executing link.exe.
    :
    : please help me ~ thankx
    :





  • thank you for reply, if i m using Visual C++, can u please tell me the steps to create a project. and do i need Workspace for it? and i want to execute those files, i just compile the main.c rite?

    : [b][red]This message was edited by ploto at 2002-12-1 6:13:27[/red][/b][hr]
    : Solve this problem by adding your c files to your project
    : what is append that you include your header file and not
    : the c file(s).
    : The error is not from the compiler it's from the linker.
    : This mean all syntax and headers are ok but when
    : the linker search for all the source it didn't found the source code
    : of all the functions so its return linker error
    :
    : if you are in Visual C add files to project like that
    : Project->Add files -> (your C file) and it will solve your problem
    :


  • The Steps for simple console application

    activate Visual C
    At the top menu Choose [italic] File->New [/italic]
    Then choose which project you'ld like .
    Fill your project name and choose where to create it.
    The Project will create all the envairoment for this project
    (workspace,project files , debug directory etc.)
    for example [italic] Win32 Console Application [/italic]
    now if you want simple c application choose [italic] empty project [/italic]

    then press on [italic] finish [/italic] then [italic] ok [/italic]

    now you have a project that is ready.
    it's empty project if you'ld like new files to add to you're
    project use [italic] Project->New[/italic] or if you already have files
    use [italic] Project->Files...[/italic]

    This is a simple project setting it's only for starting but you
    need to search the VC for more option (and there are a lot of them)
    If you will need more help in the future you can send me an e-mail
    and I will try to help -> eran_sw@hotmail.com
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories