Re: VC Linker Problem

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Mar 4, 8:29 pm, "Carl Daniel [VC++ MVP]"
<cpdaniel_remove_this_and_nos...@xxxxxxxxxxxxxxx> wrote:
"NvrBst" <nvr...@xxxxxxxxx> wrote in message

news:489ce6da-f63b-4ef1-a051-29f152a6d724@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

But it manages to link them all together fine with the Static Library
(.lib) project? How can I get this to compile as a DLL if I wish to?
How do I tell Visual Studio to make the dll with linking to the other
files in the project like the lib does?

I think that you've hit on the head on the nail there: static libraries are
not linked, and there's no requirement that internal references be satisfied
within the library. A library is not significantly different from a ZIP
file containing a bunch of OBJ files. In contrast, a DLL is a linked image
and there cannot be any unsatisfied symbol references.

So, it sounds like you're missing a definition for _timer in your code -
something needs to supply that reference.

-cd

Hello;

the definition for the timer function is in a timer.cpp file in the
code. Which was included in the project... so I was confused.
But I ended up finding the problem, i was including bctimer.h from
another header file. And it had a:
#ifdef __cplusplus
extern "C" {
#endif
....
#include "bctimer.h"
....
#ifdef __cplusplus
}
#endif


This was what was causing the problem and making it not link the
bctimer stuff with the dll... however i was able to "compile" the
object files fine... so it was seeing the header information from
bctimer.h... just wsn't using it for linking.

Removing the #ifdef __cplusplus extern "C" { ... stuff made it
work. I can compile the .DLL and the .LIB files fine now! thanks for
all your help!
.



Relevant Pages

  • Re: Static Libraries and Assembly Language
    ... My experience with asm is from about 14 yrs ago, ... actual Processors and Assemblers. ... compile time or at .lib creation time. ... Every Zip API I've ever seen comes with a dll. ...
    (alt.lang.asm)
  • Re: unable to link .lib file to an eVc++4.0 project
    ... the source code and the .lib file are in VC++, ... the definations are in the .lib file which is not getting linked. ... the compilation of a DLL. ... Do just that, compile and run it. ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Dll doubt
    ... Suppose you have a DLL and corresponding LIB and H file wrote by thirdparty ... You can either link with a LIB ... If you are an author of this DLL you can compile it as a static LIB ... This is a dynamic link. ...
    (microsoft.public.win32.programmer.ui)
  • Re: Cloning FASLD
    ... If you clone it in your BSP and build an OS design with that BSP, ... The lib is linked to create a dll - this is done by using that new ... why fasld_lib is a LIBRARY and not a DLL? ... The originale FASLD driver generates a fasld_lib.lib file not a ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Forwarding DLL
    ... Note that I use the same header file in my lib/dll/app project as in the lib. ... in particular not the exports. ... lib when I make the dll. ... But, during compilation of the dll, the class should be exported because FORWARDDLL_API is not an empty macro anymore, is __declspec. ...
    (microsoft.public.vc.language)