Menu

Problem including function

odrys
2008-06-07
2012-09-26
  • odrys

    odrys - 2008-06-07

    Hi.
    I create a C project which contains a "A.c" file with main() function, a "B.c" file that contains a function I want to call from main(),and a header file B.h (which I create through new_source_file->...->..save_as_header..)that contains the prototype of the function.All three files and project are in the same folder.
    In the A.c file I include the header file as : #include "B.h".
    When compiling I get the message:"B.h:No such file or directory".
    The same happens when, without including the header file, I declare the function above main(as: extern (type) function() ).
    Both shouldn't working fine?
    I must doing something wrong but I can't see it :).
    Thanks in advance.

     
    • cpns

      cpns - 2008-06-09

      If you mean you placed your header file in c:\dev-cpp\bin, then your solution is probably ill advised - how are you going to resonably manage a project of any signofocant size that way!?

      It should have worked the way you described in the first place, so you obviously have something wrong. We could have determined what was going on and probably what was wrong had you posted the full compile log as requested in the "PLEASE READ BEFORE POSTING A QUESTION" thread.

      Clifford

       
    • odrys

      odrys - 2008-06-07

      Ok and sorry.I placed the header file where the path indicates and works fine.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.