For Programmers: Free Programming Magazines  


Home > Archive > VC STL > March 2005 > Weird Linker Error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Weird Linker Error

2005-03-01, 4:03 pm

i'm using VS.Net 2003, compiling a DLL with /MDd (it links to external libs
compiled with the same flags)

the following is in the main header

#if _MSC_VER < 1300
#include <iostream.h>
#else
#include <iostream>
using namespace std;
#endif


the project compiles without error or warning, but while linking i get ...

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(955):
error C2491: 'std::flush' : definition of dllimport function not allowed
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(947):
error C2491: 'std::ends' : definition of dllimport function not allowed
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(930):
error C2491: 'std::endl' : definition of dllimport function not allowed


these are repeated once per include of the header...

these methods are prefixed with the _CRTIMP2 macro, which with /MDd set, is
expanded to __declspec(import).
This in turn which chokes the linker..

any clues on how to solve this ?


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com