sorry, I made a type mistake on path slash char.
I repeat my question.
I defined a header file to extern declare this function.
After that, I include this header file.
The function is stored in C:\\temp\\myfun.c
int func(){
return 1;
}
The header file is stored in C:\\temp\\myheader.h
extern int func(void);
in my main program, I got a problem if I include this header file
(myheader.h).
#include <stdio.h>
#include "C:\\temp\\myheader.h"
void main(){
func();
}
The main program , say "main.c" is stored in another location.
But if I copy the myfunc.c & myheader.h to the same path of "main.c",
it works fine.
My question is why my main.c program cannot locate "myfunc.c" & "myheader.h" file ??
Can anybody help me?
Pls help!!
Thank you very much.
Randy Howard <randy.howard@FOOmegapathdslBAR.net> wrote in message news:<MPG.19ae37b5a0b59459989853@news.megapathdsl. net>...[color=blue]
> In article <7bd5ab13.0308201955.277cee37@posting.google.com >,
>
cheung_yuklun@i-cable.com says...[color=green]
> > in my main program, I got a problem if I include this header file
> > (myheader.h).
> > #include <stdio.h>
> > #include "C:\temp\myheader.h"[/color]
>
> This is all off-topic for CLC, which only talks about the standard
> C language, not compiler-specific build environments and their
> problems. One of the microsoft newsgroups is probably your best
> bet.
>
> However... Using VC, without an external make file, the usual way of
> doing this is to add the directory to your include path in the
> project itself, then simply use
> #include "myhdeader.h"
>[color=green]
> >
> > void main(){
> > func();
> > }
> >
> > This main program is not in c:\temp\ folder.
> > The error message is {
> > --------------------Configuration: pureC_test - Win32
> > Debug--------------------
> > Compiling...
> > main.c
> > Linking...[/color]
>
> Notice, it never compiled myfun.c. That's because the source file also
> must be added to the project. The unresolved external is due to there
> not being an object file containing func(). Add the source file, do
> a build all, and you should be good to go.[/color]