Strange MFC / VC ++ linker error (std :: list <CRect> already defined)

I have a really strange error message that only occurs when the following line is added to the project:

std::list<CRect> myVar;

It is worth noting that this should not be std :: list, it can be std :: vector or any other STL container that I assume.

Here is the error message:

Error 1 error LNK2005: "public: __thiscall std :: list

:: list> (void) "(?? 0? $ List @VCRect @@ V? $ Distributor @VCRect @@@@@@ standard stand @@ QAE @XZ) already defined in SomeLowLevelLibrary.lib

The low-level library referenced by the error message has no idea about the project I am creating, it has only basic low-level functions and is not related to the high-level MFC graphical interfaces.

, :

std::list<CRect*> myVar;

.

, , , .

- - ? Microsoft Visual Studio 2008 SP1 Vista Enterprise.

: std:: list < > , , _Nextnode clear .

: std::vector , std:: list. , , . MFC . 1 , std:: list.

: , CRect, STL.

+3
6

, (swap std:: list CArray). , std:: list, .

class LIB_EXPORT CRectList : public std::list<CRect>
{
};

, . CRectList, std:: list, , .

+1

, , . STL, . . ( ).

+2

, , " " "++: ". . ( , , , , , .)

0

Does SomeLowLevelLibrary.lib CRect? STL?

0

Is the file included in the header, which can be compiled into two separate code modules?

0
source

Another random opportunity appeared today in my head. Is it possible that your current DLL and low-level library reference two different versions of MFC? Long shot.

0
source

Source: https://habr.com/ru/post/1697661/


All Articles