Re: VC Linker Problem
- From: Cody <cody314@xxxxxxxxx>
- Date: Wed, 5 Mar 2008 14:11:54 -0800 (PST)
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!
.
- References:
- VC Linker Problem
- From: NvrBst
- Re: VC Linker Problem
- From: Carl Daniel [VC++ MVP]
- VC Linker Problem
- Prev by Date: Re: Bluetooth programming ?
- Next by Date: Compile .c extensions as a C98++ using Visual Studio
- Previous by thread: Re: VC Linker Problem
- Next by thread: Re: FSX will not reinstall
- Index(es):
Relevant Pages
|