Click to See Complete Forum and Search --> : quick stl vc.net question
diehardii
April 26th, 2004, 09:02 AM
Hi everyone,
I'm writing an dll using directshow in VS.NET 2003. Because of this, I have to use the nodefaultlibraries and add libraries in manually. This works well most of the time, however I now wish to add vectors to my project, and I'm getting linker errors. I get the same error if I use the nodefault libraries option in another (less picky) dshow dll. Does anyone know what libraries I need to include for stl to function? I tried googling and searching the forums, but nothing came up. Thanks for the help.
~Steve
Andy Tacker
April 26th, 2004, 10:22 AM
[moved]
Paul McKenzie
April 26th, 2004, 11:47 AM
Originally posted by diehardii
Does anyone know what libraries I need to include for stl to function? I tried googling and searching the forums, but nothing came up. Thanks for the help.
~Steve You don't need any libraries for the STL that is included in VC++ to work. STL is template based, and all the code is inline in the header files.
Your problems are elsewhere, so please show us the errors that you're getting.
Regards,
Paul McKenzie
diehardii
April 26th, 2004, 01:22 PM
Hi Paul,
Thanks for the help. I am getting the following errors.
Linking...
Creating library .\Release/YuvGray.lib and object .\Release/YuvGray.exp
NewMuxer.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(char const *)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z)
NewMuxer.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall std::basic_string,class std::allocator >::_Myptr(void)const " (__imp_?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ)
NewMuxer.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ)
NewMuxer.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ)
NewMuxer.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::basic_string,class std::allocator > const &)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z)
.\Release/NewMuxer.dll : fatal error LNK1120: 5 unresolved externals
If (in a simpler project) I remove the /NODEFAULTLIB it links. If I put that flag back, it fails with the exact same error messages as the more complicated project.
All I am including is
#include (vector)
and
std::vector(int) v;
(it doesn't seem as if the greater and less than symbols will show up in the code)
in another function. Thanks for the help.
~Steve
Paul McKenzie
April 27th, 2004, 05:52 AM
Originally posted by diehardii
Hi Paul,
Thanks for the help. I am getting the following errors.
Hmm... Maybe the new compilers have put the implementation code in seperate libraries (unlike VC 6.0)
Create a new, empty Win32 Console application (it must be a Windows Console app). Try the following (main.cpp):
#include < string >
#include < iostream >
using namespace std;
int main()
{
std::string s = "abc";
cout << s;
}
If this compiles and links, take a look at the settings used for the console application. I have written libraries using VC Net, and I see no problems with the STL.
Regards,
Paul McKenzie
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.