Author: JW de Kort
Date: 14:32:12 06/11/00
Go up one level in this thread
On June 11, 2000 at 17:04:24, James Swafford wrote:
>On June 11, 2000 at 08:58:31, JW de Kort wrote:
>
>>Dear friends
>>
>>I have started working with microsoft 4.1 recently and i have ran
>>into a problem i cannot solve. It is very basic and it should
>>be very easy to answer for some of you.
>>
>>My project consists of two files.
>>In one file i try to call a function defined in the other file.
>>This is not possibel because of two errors i get in the linking
>>fase: lnk1120 and lnk2001. Of course i checked the documentation
>>but without any succes.
>>I'am using header files -of course-. I do not use MFC.
>>This code used to compile perfectly under turbo c 3.1 (for Dos).
>>
>>This is about what causes the problem:
>>
>>fil1.cpp
>>
>>#include file2.h
>>void function (void)
>>{
>>
>> funct2 (); //call function in the oterh file
>>}
>>
>>file2.h
>>
>>extern void funct2(void);
>>
>>
>>file 2
>>
>>void funct2(void)
>>{
>>
>>}
>>
>>
>>Please. help me out. You have helped me before, please don't let me down this
>>time. This must be a trivial problem that is easy to solve.
>>
>>Thanks in advance!
>>
>>Jan WIllem
>
>Hi Jan,
>
>In file2.h, lose the "extern" before the function prototype.
>Use extern for variables, not functions. After that,
>you should be ok. :-)
>
>--
>James
Thank James for your reply.
I have already tried this and it did not work. (Of course i will try again).
Can you tell me if it is possible to compile ordinairy c sources with Visual
c++? I have tried to understand MFC but this was far to complicated for me.
No i want to try windows programming the way it is discribed in the book by
Petzold, maybe you heared about this book, but i start to wonder if it is
possible.
Can it be that there is some compiling option that is not put the proper value?
Thanks again..
Jan Willem
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.