[comp.windows.ms.programmer] Borland C++ and the SDK Generic application

dsampson@x102a.harris-atd.com (sampson david 58163) (02/22/91)

OK, so what am I doing wrong?   Thought I'd start with that part first.

I've installed Borland C++, copied the Generic application from the MS
SDK sources disk into a brand new subdirectory, and I can't get the
thing to link properly.  BTW I can compile the Borland demo program so
I suspect the problem is in the project file "environment" as I've set
it up.

Here's what I did:

1) Created a new PRJ file called generic.
2) Added Generic.c, Generic.h, Generic.rc and Generic.def to it.
3) Under Options/Application, I chose "Windows App"
4) Under Options/Compiler/Entry/Exit Code I have "Windows ALL
   functions xportable" set
5) Under Options/Environment/Editor, I set the default extension to C
6) I selected Compile/Make EXE file

I get 6 link errors, each of the following form:

"Linker Error: _hInst defined in module GENERIC.C is duplicated in
module GENERIC.C"

The same message is displayed about the _InitApplication,
_InitInstance, WinMain, MainWndProc, and About functions.


Since Borland C++ stores the information needed to compile a program
in the PRJ file, I suspect that I haven't set something properly.
I know they HAVE to be able to compile the simplist SDK program........

Anybody run across this problem yet?????

dfs
--

                                          A new world record
                                          in the javalin throw
                                                
    /                                          /
   /                                          I
-------------------------------------------------


David Sampson                                         Harris Corporation
dsampson@x102a.ess.harris.com                   Gov't Aerospace Systems Divison
uunet!x102a!dsampson                                  Melbourne, Florida

-------------------------------------------------------------------------------

wolf@netcom.COM (Phil Escobar) (02/24/91)

The only time I've ever hit this problem (getting "multiple definition"
errors in the linker) is under Turbo C++.  It happened when I specified
the same object file twice to the linker.  It seemed to think they were
two entirely different files that defined the same labels.  Something 
similar might be happening to you (somehow the GENERIC.OBJ is being linked
with itself). 

 - Phil @ Buckskin Technologies

iam@waikato.ac.nz (Ian McDonald) (02/25/91)

In article <DSAMPSON.91Feb22092909@x102a.harris-atd.com>, dsampson@x102a.harris-atd.com (sampson david 58163) writes:
> I get 6 link errors, each of the following form:
> 
> "Linker Error: _hInst defined in module GENERIC.C is duplicated in
> module GENERIC.C"
> 
I had the same prolem (in version 1.00) when I included the .C file in twice or
the .OBJ file in.
-- 
-------------------------------------------------------------------------
Ian McDonald  |                                           
52 Cook Street|                                             /  /\  /\
Hamilton      |   This space free for advertising !!       /  /  \/  \
New Zealand   |                                           /  /        \
+64-71-563438 |   I can receive mail but can't reply to it.  

dlb@hpsad.HP.COM (Dave Bringhurst) (02/26/91)

I had the same problem until I removed the .H file from the project.