473,395 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Linking errors after conversion from VS2003 to VS2005

Hello All,

I had a solution composed of managed/unmanaged C++ , C# projects. It builds
with no problem in VS2003 but after converting the solution to VS2005 i get
many linking errors such as LNK2020 LNK2028. Below is a little bit of the
error report.

Error 34 error LNK2020: unresolved token (0A000029) "public: __thiscall
std::_Container_base::_Container_base(void)"
(??0_Container_base@std@@$$FQAE@XZ) UnmanagedResiprocateController.obj
Error 35 error LNK2028: unresolved token (0A000023) "public: __thiscall
std::_Container_base::_Container_base(void)"
(??0_Container_base@std@@$$FQAE@XZ) referenced in function "public:
__thiscall std::_Tset_traits<class resip::MergedRequestKey,struct
std::less<class resip::MergedRequestKey>,class std::allocator<class
resip::MergedRequestKey>,0>::_Tset_traits<class
resip::MergedRequestKey,struct std::less<class resip::MergedRequestKey>,class
std::allocator<class resip::MergedRequestKey>,0>(struct std::less<class
resip::MergedRequestKey>)"
(??0?$_Tset_traits@VMergedRequestKey@resip@@U?$les s@VMergedRequestKey@resip@@@std@@V?$allocator@VMer gedRequestKey@resip@@@4@$0A@@std@@$$FQAE@U?$less@V MergedRequestKey@resip@@@1@@Z) SipStackAccessor.obj
Error 36 error LNK2028: unresolved token (0A000029) "public: __thiscall
std::_Container_base::_Container_base(void)"
(??0_Container_base@std@@$$FQAE@XZ) referenced in function "protected:
__thiscall std::_Vector_val<class resip::NameAddr *,class
std::allocator<class resip::NameAddr *::_Vector_val<class resip::NameAddr
*,class std::allocator<class resip::NameAddr *(class std::allocator<class
resip::NameAddr *>)"
(??0?$_Vector_val@PAVNameAddr@resip@@V?$allocator@ PAVNameAddr@resip@@@std@@@std@@$$FIAE@V?$allocator @PAVNameAddr@resip@@@1@@Z) SIPDataProcessing.obj

Any idea whats the possible cause of this problem. I used many ideas I found
online but none worked.

Your help is really appreciate

Thanks in advance,

Tammam
Aug 14 '06 #1
2 5672
"Tammam" <Ta****@discussions.microsoft.comwrote
I had a solution composed of managed/unmanaged C++ , C# projects. It
builds
with no problem in VS2003 but after converting the solution to VS2005 i
get
many linking errors such as LNK2020 LNK2028. Below is a little bit of the
error report.
You should always rebuild everything with the correct headers and libraries.
Unless you did anything evil (patching headers, overriding default
directories
for libs & headers, switches like /Zl or /NODEFAULTLIB or incompatible
/M[D|T] /D_STATIC_CPPLIB switches etc.) you should be fine.
Error 34 error LNK2020: unresolved token (0A000029) "public: __thiscall
std::_Container_base::_Container_base(void)"
What does "Error 34" mean? Is that the 34th error you see? Why don't you
show use the first one?

It effectively means that the linker cannot resolve the MemberRef for
std::_Container_base default constructor.

The typical way to solve such a problem methodically is to
determine where it is used, and - if the use is correct -
where it is defined and why the definition is not lifted.

You can always use dumpbin /SYMBOLS or ildasm /out on your object files
to see where the reference comes from (and actually the linker should give
you an indication).

Looking at the headers many of the containers are derived from
_Container_base (surprise, surprise). That's probably where the
reference comes from. E.g.:

void foo() { std::vector<inti; do_something_with(i); }

here, the ctor for std::vector<intis instantiated, which in turn
instantiates the default ctor for std::_Vector_val<>, which in
turn references the default ctor of std::_Container_base.

Looking at the definition in xutility there are three possible
variants:
1) _HAS_ITERATOR_DEBUGGING (default for _DEBUG)
2) _DEBUG && !_HAS_ITERATOR_DEBUGGING
3) NDEBUG

For the former two the default ctor is defined inline but the
class is marked as _CRTIMP2_PURE. IIRC, that resolves
to __declspec(dllimport) depending on the C++ linkage
model (/MT v. /MD & _STATIC_CPPLIB macro) or
to nothing for /clr:pure.

That also means that the definition should be included in
the debug version of the native C++ DLL library (msvcrtd.lib)
but not in the release version (msvcrt.lib). Since /clr implies
/MD, you should link with either one of these.

All that being said, I have no idea what your problem is.
I suspect it's a bogus /Zl or /NODEFAULTLIB somewhere.

If you want anyone to help you, I'm afraid you need to give us
much more information (such as the command lines used for
your build - compiler and linker - and any linker warnings and
errors you see).

-hg

Aug 15 '06 #2
Could you also answer if VS2005 was installed after the installation of
VS2003 or the other way around?

If you installed VS2003 before VS2005, i would recommend uninstalling both
and then installing VS2003 before installing VS2005.
"Holger Grund" wrote:
"Tammam" <Ta****@discussions.microsoft.comwrote
I had a solution composed of managed/unmanaged C++ , C# projects. It
builds
with no problem in VS2003 but after converting the solution to VS2005 i
get
many linking errors such as LNK2020 LNK2028. Below is a little bit of the
error report.
You should always rebuild everything with the correct headers and libraries.
Unless you did anything evil (patching headers, overriding default
directories
for libs & headers, switches like /Zl or /NODEFAULTLIB or incompatible
/M[D|T] /D_STATIC_CPPLIB switches etc.) you should be fine.
Error 34 error LNK2020: unresolved token (0A000029) "public: __thiscall
std::_Container_base::_Container_base(void)"
What does "Error 34" mean? Is that the 34th error you see? Why don't you
show use the first one?

It effectively means that the linker cannot resolve the MemberRef for
std::_Container_base default constructor.

The typical way to solve such a problem methodically is to
determine where it is used, and - if the use is correct -
where it is defined and why the definition is not lifted.

You can always use dumpbin /SYMBOLS or ildasm /out on your object files
to see where the reference comes from (and actually the linker should give
you an indication).

Looking at the headers many of the containers are derived from
_Container_base (surprise, surprise). That's probably where the
reference comes from. E.g.:

void foo() { std::vector<inti; do_something_with(i); }

here, the ctor for std::vector<intis instantiated, which in turn
instantiates the default ctor for std::_Vector_val<>, which in
turn references the default ctor of std::_Container_base.

Looking at the definition in xutility there are three possible
variants:
1) _HAS_ITERATOR_DEBUGGING (default for _DEBUG)
2) _DEBUG && !_HAS_ITERATOR_DEBUGGING
3) NDEBUG

For the former two the default ctor is defined inline but the
class is marked as _CRTIMP2_PURE. IIRC, that resolves
to __declspec(dllimport) depending on the C++ linkage
model (/MT v. /MD & _STATIC_CPPLIB macro) or
to nothing for /clr:pure.

That also means that the definition should be included in
the debug version of the native C++ DLL library (msvcrtd.lib)
but not in the release version (msvcrt.lib). Since /clr implies
/MD, you should link with either one of these.

All that being said, I have no idea what your problem is.
I suspect it's a bogus /Zl or /NODEFAULTLIB somewhere.

If you want anyone to help you, I'm afraid you need to give us
much more information (such as the command lines used for
your build - compiler and linker - and any linker warnings and
errors you see).

-hg

Aug 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: EmmanuelE | last post by:
Just installed VS2003 and tried a hello world app. Getting 404 error even when I explictly specify the start page in the url. In IIS Mgr (v 5.1), App has .aspx mapped to...
3
by: Darrin | last post by:
Hello, I see that VS2005 and the new framework 2.0 is out to the public now. Wondering about some things. When you install the new framework 2.0 can a person still use visual studio 2003 or...
11
by: musosdev | last post by:
Hi guys I'm still working through my conversion to VS2005, I'm getting there, but there's a couple of errors I can't fix. My project uses a couple of external controls (not written by me),...
2
by: GW | last post by:
After the conversion and fixing some errs VS2005 threw, project ran OK. Opened xxx.vbproj file after the conversion to VS2005 from VS2003. Changed (usng wordpad) ../msbuild/2003 to 2005...
3
by: Charles Nicholson | last post by:
Hello all- I have some static C++ libraries that I wrote in VS2003 but which upgraded fine when i went to VS2005 Pro. In them i overload the global versions of operators new, new, delete, and...
0
by: Adam Clauss | last post by:
I have managed C++ library (is bridging between a Win32 .dll and a C# application). All was well when compiled under VS2003, but I am running into a series of linking errors when compiling...
1
by: Tammam | last post by:
Hello All, I had a solution composed of managed/unmanaged C++ , C# projects. It builds with no problem in VS2003 but after converting the solution to VS2005 i get many linking errors such as...
6
by: SenthilVel | last post by:
hi all i am opening an exiting 1.1 developed ASPX project in VS2005. i am getting more language editor problems : for example: for the below code : /// <summary>
2
by: John | last post by:
Hi I have a vs2003 database app that use non-bound infragistics controls and all the plumbing is done in code. This works fine in vs2005. After importing to vs2005 via the built-in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.