CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,867

    unresolved std::list - what should I be looking for?

    Using VC++8.0, I'm building an app that will ultimately use libsigc++2 (among others). For initial testing purposes I've built a small "HelloWorld" test app. When I build it I get the following unresolved external (sorry about the lengthy output !!):-

    HelloWorld.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: class std::list<class sigc::slot_base,class std::allocator<class sigc::slot_base> >::_Iterator<1> __thiscall sigc::signal_base::connect(class sigc::slot_base const &)" (__imp_?connect@signal_base@sigc@@IAE?AV?$_Iterator@$00@?$list@Vslot_base@sigc@@V?$allocator@Vslot_base@sigc@@@std@@@std@@ABVslot_base@2@@Z) referenced in function "public: struct sigc::slot_iterator<class sigc::slot<void,struct sigc::nil,struct sigc::nil,struct sigc::nil,struct sigc::nil,struct sigc::nil,struct sigc::nil,struct sigc::nil> > __thiscall sigc::signal0<void,struct sigc::nil>::connect(class sigc::slot<void,struct sigc::nil,struct sigc::nil,struct sigc::nil,struct sigc::nil,struct sigc::nil,struct sigc::nil,struct sigc::nil> const &)" (?connect@?$signal0@XUnil@sigc@@@sigc@@QAE?AU?$slot_iterator@V?$slot@XUnil@sigc@@U12@U12@U12@U12@U12@U12@@sigc@@@2@ABV?$slot@XUnil@sigc@@U12@U12@U12@U12@U12@U12@@2@@Z)
    Maybe I'm reading this wrong but it seems to suggest that it can't find std::list. But that can't be right because std::list is a template class so the linker shouldn't be trying to import it from anywhere. I think I must be misinterpreting the message. What does it mean? Is it in fact the function sigc::signal_base::connect that can't be found?
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  2. #2
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,867

    Re: unresolved std::list - what should I be looking for?

    Quote Originally Posted by John E View Post
    Is it in fact the function sigc::signal_base::connect that can't be found?
    I can build the app by commenting out all references to that function, so I'm guessing that it isn't getting found for some reason (admittedly it's in a DLL but I am linking to the relevant link library). My current theory is that it isn't being exported for some reason but I've used the library before without coming across this problem. I'll keep looking....
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  3. #3
    Join Date
    Nov 2003
    Posts
    1,902

    Re: unresolved std::list - what should I be looking for?

    Did you build the DLL with the same compiler/settings as the client?
    http://support.microsoft.com/kb/168958

    gg

  4. #4
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: unresolved std::list - what should I be looking for?

    try to copy the dll and the lib file to the directory where the .exe is present

  5. #5
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: unresolved std::list - what should I be looking for?

    My current theory is that it isn't being exported for some reason
    The reason might be very simple: some template class/function is instantiated (outside the library) with the typename the dll has no implementation for.
    Best regards,
    Igor

  6. #6
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,867

    Re: unresolved std::list - what should I be looking for?

    That's strange - I didn't get any notifications for these replies

    Frustratingly though, the problem mysteriously just disappeared. I'm beginning to have my doubts about VC++8.0 because I seem to be getting a lot of problems that just crop up occasionally and then disappear for no apparent reason. For example, when trying to run an app (particularly a Debug build) I'll often see messages saying that a particular DLL can't be found. A couple of hours later, the program will run just fine, even though I didn't change anything. I also get problems with certain projects being rebuilt all the time (as if they're out of date) when in fact, they're up to date. A couple of hours later, the problem will go away. Then the next day, it's back again. It all seems a bit flaky to me.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  7. #7
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: unresolved std::list - what should I be looking for?

    Hm, I don't have that experience at all with 2005, for me it's rock solid. I experience more that 2005 is the last (at the moment) good release of MSVC (2010 more or less untested). 2008 works ok but the help system very often fail to find things that 2005 do find, the parallell build is a build-boost when having a quad CPU but very often it also cause some pdb-lock that require a full rebuild or exit/restart to resolve.

    I still use XP though so that might have something to do with it.
    Last edited by S_M_A; December 27th, 2010 at 09:59 AM.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  8. #8
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: unresolved std::list - what should I be looking for?

    The problem with missing dll while running exe has nothing to do with VS, whatever version it is.
    Best regards,
    Igor

  9. #9
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,867

    Re: unresolved std::list - what should I be looking for?

    Quote Originally Posted by S_M_A View Post
    I still use XP though so that might have something to do with it.
    I think you might be right. Before I actually bought VS2005 (which I'm using with Win7) I'd previously been using the Express Edition with XP and the only problem I remember was that it would lock up (sometimes for several minutes) when creating an ncb file for the very first time (in fact, that's still a problem, even with the Professional Edition which I eventually bought). I never had any of the other problems though.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  10. #10
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,867

    Re: unresolved std::list - what should I be looking for?

    Quote Originally Posted by Igor Vartanov View Post
    The problem with missing dll while running exe has nothing to do with VS, whatever version it is.
    .... usually I'd be inclined to agree, except I'm pretty confident that this one definitely IS a VS issue. For example, one regular problem I see is when I press F5 to run an application in the debugger. Maybe 10-15 percent of the time I'll see a message box saying that MSVCR80D.dll can't be found. At first I tried all kinds of things to make this go away (with mixed success) but eventually, I hit on a reliable method.... rebuild the app's executable with the runtime library set to Multi-threaded Debug and run it. Now switch back to Multi-threaded Debug DLL and rebuild. So far, this has never failed to solve the problem!
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  11. #11
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: unresolved std::list - what should I be looking for?

    a message box saying that MSVCR80D.dll can't be found.
    You definitely need to investigate this somewhat deeper. I could suspect the situation when the said dll version specified in the manifest does not match to the one installed in your system. If this appeared to be true, I would investigate who does cripple the manifest (source version control system might do, if you use any )

    Actually this is only a theory, as I never met the effect, with 2005, 2008 and 2010 studios, neither in XP nor 7.
    Best regards,
    Igor

  12. #12
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,867

    Re: unresolved std::list - what should I be looking for?

    I must admit Igor, I never had this problem either when I was using the Express Edition and XP. It worries me that the above rigmarole always seems to fix it (i.e. first I need to link statically to the Debug runtime, then I re-build again to link dynamically). When I first mentioned this problem on another thread, another user replied to say that he also suffered from it and had tried reporting it to Microsoft. However, because VS2005 was considered an old product, they weren't interested.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  13. #13
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: unresolved std::list - what should I be looking for?

    As long as you did not react to my mention of source control system, I can conclude you do not have one in use.
    Best regards,
    Igor

  14. #14
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,867

    Re: unresolved std::list - what should I be looking for?

    Oops, I forgot about that.... No, I'm not using source control at the moment.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  15. #15
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: unresolved std::list - what should I be looking for?

    looks like installation of VS has not happened properly.. leading to missing of the dll.. or mislocated.. try to search for that dll and copy it to your debug/release folder and try rebuild..

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured