15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


OLE control build errors

Jeffrey J -- jjholt@ingr.com
Tuesday, August 20, 1996


Environment: NT3.51  VC++4.2

I'm seeing a strange build problem with an OLE control, I wonder if
anyone has any ideas.

I've got a small OLE control project, and twice the build process has
gone bad on me.
What I get is the following:


Linking...
mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined
in MSVCRTD.lib(dllmain.obj)
mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined
in MSVCRTD.lib(dllmain.obj); second definition ignored
   Creating library Debug/Jsrv.lib and object Debug/Jsrv.exp
Debug/Jsrv.ocx : fatal error LNK1169: one or more multiply defined
symbols found
Error executing link.exe.


It looks like it's linking with the static library, but the project
settings say to use the
dynamic library. The first time it happened I ended up creating a new
project with the same
name, and replacing the bad .mak/.mdp and then making all the project
changes
I had previousely made. This worked for a while, but now it has happened
again.

Another piece of info is that it built fine on my machine for small
changes, but went bad when
I did a complete rebuild. (ie I did a build that just compiled a couple
of .cpps which worked,
then I immediately hit complete rebuild, and it failed.)

One thing I did do this time (can't remember about last time) was that I
renamed the directory
the project was in. 

Thanks in advance for any help. This is really frustrating!

Jeff Holt
jjholt@ingr.com


----
Jeff Holt    Intergraph Corporation
jjholt@ingr.com   (205)730-7038




Bok Nan Lo -- lo@ia-us.com
Monday, August 26, 1996

On Tuesday, August 20, 1996 7:03 AM, Holt, Jeffrey J[SMTP:jjholt@ingr.com] 
wrote:
>
> Environment: NT3.51  VC++4.2
>
> I'm seeing a strange build problem with an OLE control, I wonder if
> anyone has any ideas.
>
> I've got a small OLE control project, and twice the build process has
> gone bad on me.
> What I get is the following:
>
>
> Linking...
> mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined
> in MSVCRTD.lib(dllmain.obj)
> mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined
> in MSVCRTD.lib(dllmain.obj); second definition ignored
>    Creating library Debug/Jsrv.lib and object Debug/Jsrv.exp
> Debug/Jsrv.ocx : fatal error LNK1169: one or more multiply defined
> symbols found
> Error executing link.exe.
>
>
> It looks like it's linking with the static library, but the project
> settings say to use the
> dynamic library. The first time it happened I ended up creating a new
> project with the same
> name, and replacing the bad .mak/.mdp and then making all the project
> changes
> I had previousely made. This worked for a while, but now it has happened
> again.
>
> Another piece of info is that it built fine on my machine for small
> changes, but went bad when
> I did a complete rebuild. (ie I did a build that just compiled a couple
> of .cpps which worked,
> then I immediately hit complete rebuild, and it failed.)
>
> One thing I did do this time (can't remember about last time) was that I
> renamed the directory
> the project was in.
>
> Thanks in advance for any help. This is really frustrating!
>
> Jeff Holt
> jjholt@ingr.com
>
>
> ----
> Jeff Holt    Intergraph Corporation
> jjholt@ingr.com   (205)730-7038
>
>

You're definitely statically linking your control with MFC libraries, 
causing the above-mentioned 2 kinds of failures. Check your makefile inside 
out for static linking. Another possibility is that people tend to select 
the option of Debug Multithreaded (D) and Multithreaded (R) while I 
strongly suggest you go for Debug Multithreaded DLL (D) and Multithreaded 
DLL (R), this will produce ocx with smaller filesize.

The easiest way out is to generate another makefile from Control Wizard, 
discard the source code generated and plug in your source code. It works, 
I've tried it before.

--
Bok Nan Lo
IA Corporation
Phone: 510-4506871 Fax: 510-4507099
E-Mail: lo@ia-us.com




| Вернуться в корень Архива |