linker error for extern function
-
hai, I'm working in vc++ win32. I'm using two files..say file1.cpp and file2.cpp. In file1 I'm defining a function and want to call in file2. ie I'm doing as //file1.cpp// int myfunc(); . . . int myfunc() { .... } //file2.cpp// #include file1.h extern int myfunc(); .... int func2() { int xxx = myfunc(); } If I do like this it is giving LNK2019: unresolved external symbol_myfunc referenced in func2 fatal error LNK1120: 1 unresolved externals Where did I went wrong.. Thanks in advance..
-
hai, I'm working in vc++ win32. I'm using two files..say file1.cpp and file2.cpp. In file1 I'm defining a function and want to call in file2. ie I'm doing as //file1.cpp// int myfunc(); . . . int myfunc() { .... } //file2.cpp// #include file1.h extern int myfunc(); .... int func2() { int xxx = myfunc(); } If I do like this it is giving LNK2019: unresolved external symbol_myfunc referenced in func2 fatal error LNK1120: 1 unresolved externals Where did I went wrong.. Thanks in advance..
do you have the second cpp added to your project? bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
Publitor, making Pubmed easy. http://www.sohocode.com/publitorOur kids book :The Snot Goblin
-
do you have the second cpp added to your project? bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
Publitor, making Pubmed easy. http://www.sohocode.com/publitorOur kids book :The Snot Goblin
-
email it to me and i'll take a quick look (no promises) if you havnt got it sorted bryce --- To paraphrase Fred Dagg - the views expressed in this post are bloody good ones. --
Publitor, making Pubmed easy. http://www.sohocode.com/publitorOur kids book :The Snot Goblin
-
hai, I'm working in vc++ win32. I'm using two files..say file1.cpp and file2.cpp. In file1 I'm defining a function and want to call in file2. ie I'm doing as //file1.cpp// int myfunc(); . . . int myfunc() { .... } //file2.cpp// #include file1.h extern int myfunc(); .... int func2() { int xxx = myfunc(); } If I do like this it is giving LNK2019: unresolved external symbol_myfunc referenced in func2 fatal error LNK1120: 1 unresolved externals Where did I went wrong.. Thanks in advance..