Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2005

Tip: Looking for answers? Try searching our database.

Problem creating multiple .dlls that depend on each other

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael L - 15 Jul 2005 08:22 GMT
I am in VS2003, building C++ .dll libraries.

I want to create a single .dll that combines its own code with code from
other dlls. For example, I want to build B.dll, where B has its own source
code, and also refers to routines in A.dll. I have another app C.exe that
will link to B.dll (and/or A.dll).

Clearly there is a dependency: B depends on A.

I can build and link A.dll  just fine on its own. But when I try to build
B.dll, I get problems.

The first problem was that when I tried to build B.dll on its own, the
routines in A that B wants were not there, so I got a slew of LNK2001 and
LNK2019 (unresolved external symbol) errors, for all the routines in A that
are referred to in B.

My attempt to fix this was to set A.dll as input to the linker in B, in
Additional Dependencies. However, when I do this, it fails with LNK1136
(invalid or corrupt file), presumably because I am linking in a .dll, not a
.lib

There is no A.lib, and I don't know where else the linker for B can find the
routines in A that it needs.

What can I do to fix this?

Thanks
Martin Richter [MVP] - 15 Jul 2005 09:22 GMT
Hallo Michael L!

> I want to create a single .dll that combines its own code with code from
> other dlls. For example, I want to build B.dll, where B has its own source
[quoted text clipped - 20 lines]
>
> What can I do to fix this?

There must be a LIB file for A. Otherwies force creation of it. Include
this as an input file for B.
Usually if I have constructs like this I just create a great solution
hat include EXE and DLL's then I define dependiencies and usually this
is enough.

Signature

Martin Richter [MVP] WWJD
"In C we had to code our own bugs. In C++ we can inherit them."
FAQ : http://www.mpdvc.de
Samples: http://www.codeguru.com http://www.codeproject.com

Michael L - 15 Jul 2005 16:35 GMT
> There must be a LIB file for A. Otherwies force creation of it. Include
> this as an input file for B.
> Usually if I have constructs like this I just create a great solution
> hat include EXE and DLL's then I define dependiencies and usually this
> is enough.

Thanks, Martin. That starts to make sense.

Is there a way to tell it to build both a .lib and a .dll for A at the same
time, or do I have to choose only one that is built at a time?

Thanks, Michael
Martin Richter [MVP] - 16 Jul 2005 13:15 GMT
Hallo Michael L!

> Thanks, Martin. That starts to make sense.
>
> Is there a way to tell it to build both a .lib and a .dll for A at the same
> time, or do I have to choose only one that is built at a time?

Usually lib and dll are produced at the same time. The default project
settings ofthe linker are adjusted in tis way. Look into the linker
properties.

Signature

Martin Richter [MVP] WWJD
"In C we had to code our own bugs. In C++ we can inherit them."
FAQ : http://www.mpdvc.de
Samples: http://www.codeguru.com http://www.codeproject.com


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.