Novice VC++ upgrade question.

L

Lee

Hi Everyone,

I have a question on an error I got from compiling some test C++ code
in VS2005 that I had originally written in C in VC++ 6.0

In the original C test code I have my source broken up into two .c
files. One file (main.c) contains an array of procedures and above
that the procedures' prototypes. The other file contains the actual
procedure. This compiles just fine.

In the new C++ code in VS2005, this produces an error:
-> Error 1 error LNK2005: _FileID already defined in Main.obj

If I remove the prototype then the array complains that the procedures
are not defined. I am at a loss on how to proceed. (I guess this is
what I get for comming from a Java/C# background ;-Þ)

Thanks in advance,

L. Lee Saunders
 
B

Bruno van Dooren

is your array of procedures an array of function pointers or something else?
could you post some code? your explanation is not entirely clear.

what you could always do is merge the 2 files. put all functions above the
declaration of the array, remove the function declarations and everything
should compile just fine.

kind regards,
Bruno.



Hi Everyone,

I have a question on an error I got from compiling some test C++ code
in VS2005 that I had originally written in C in VC++ 6.0

In the original C test code I have my source broken up into two .c
files. One file (main.c) contains an array of procedures and above
that the procedures' prototypes. The other file contains the actual
procedure. This compiles just fine.

In the new C++ code in VS2005, this produces an error:
-> Error 1 error LNK2005: _FileID already defined in Main.obj

If I remove the prototype then the array complains that the procedures
are not defined. I am at a loss on how to proceed. (I guess this is
what I get for comming from a Java/C# background ;-Þ)

Thanks in advance,

L. Lee Saunders
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top