Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DDK and Iostream problems 1

Status
Not open for further replies.

MarkinAustin

Programmer
Feb 21, 2002
8
US
I am playing with the NT/2K Device Driver Kit with Visual C++ 6.0. I am
trying to use some of the Zw- functions along with the C++ iostream and
string libraries and I am having problems. Has anyone else encountered
problems trying to do this? Here is a simple program and the link errors
that follow --

--- Begin test.cpp ---

#pragma comment(lib, "ntdll.lib")

#include
#include

#include

using namespace std;


int main(void) {
string s("hello");

return 0;
}

--- End test.cpp ---

Errors:

LIBC.lib(exsup.obj) : error LNK2005: __global_unwind2 already defined in
ntdll.lib(exsup.obj)
LIBC.lib(exsup.obj) : error LNK2005: __local_unwind2 already defined in
ntdll.lib(exsup.obj)
LIBC.lib(exsup.obj) : error LNK2005: __abnormal_termination already
defined in ntdll.lib(exsup.obj)
Release/test.exe : fatal error LNK1169: one or more multiply defined
symbols found


I have tried ordering the includes and pragmas differently. I also tried
different versions of ntdll.lib. Could this be an issue where I need to
dynamically bind to ntdll.dll (as in LoadLibrary("ntdll.dll");)?
 
This kind of problems have little to do with IOStream.

I am positive that you are using difference code-generation models for the run-time libraries and for the libraries you are compiling/using.

Check for ProjectSettings->C/C++->CodeGeneration-> use runtime library.

Most certanly, you are combining single and multi-threaded libaries.

HTH [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top