PC Review


Reply
Thread Tools Rate Thread

Linker error

 
 
Jack
Guest
Posts: n/a
 
      25th Feb 2008
Hi there,

I downloaded a small sample solution (DLL) from PayPal and I'm getting the
following error when I compile it:

Error 2 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
(?.cctor@@$$FYMXXZ) ButtonEncryption.obj ButtonEncryptionLib

This occurs several twice in fact (for this file) and once for "stdafx.obj".
The code was upgraded by VS 2005 when I first loaded the solution (from
whatever earlier version it came from) but it should work AFAIK (same
problem occurs in VS 2008). The error indicates that some runtime support
library appears to be missing since it involves the constructor but there's
only one class in the file and its constructor is present. I'm an
experienced C++ developer but have no background in managed C++. Does anyone
recognize what library it may be looking for. Thanks.


 
Reply With Quote
 
 
 
 
Jack
Guest
Posts: n/a
 
      25th Feb 2008
> Error 2 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"

Sorry, the error should read:

error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
(?.cctor@@$$FYMXXZ) in ButtonEncryption.obj

> This occurs several twice in fact (for this file) and once for
> "stdafx.obj".


Kill "several"


 
Reply With Quote
 
 
 
 
Cholo Lennon
Guest
Posts: n/a
 
      26th Feb 2008
"Jack" <no_spam@_nospam.com> escribió en el mensaje
news:%23NkwiB%(E-Mail Removed)...
>> Error 2 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"

>
> Sorry, the error should read:
>
> error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
> (?.cctor@@$$FYMXXZ) in ButtonEncryption.obj
>
>> This occurs several twice in fact (for this file) and once for
>> "stdafx.obj".

>
> Kill "several"


Demangling name (using undname utility) you have the following:

"void __clrcall cctor(void)"

In MSIL cctor is a special name for static ctors (type initializer).
Something like that

ref class Test
{
public:
static int foo;

// cctor (check this name with ILDasm)
static Test()
{
foo = 17;
}
};

For classes with static data, type initializers are optional: If you don't
provide it, the compiler always generates one with default init values.
In your code: if a class provide a declaration for cctor, check the
existence of its definition.

Regards

--
Cholo Lennon
Bs.As.
ARG



 
Reply With Quote
 
Jack
Guest
Posts: n/a
 
      27th Feb 2008
> Demangling name (using undname utility) you have the following:
>
> "void __clrcall cctor(void)"
>
> In MSIL cctor is a special name for static ctors (type initializer).
> Something like that
>
> ref class Test
> {
> public:
> static int foo;
>
> // cctor (check this name with ILDasm)
> static Test()
> {
> foo = 17;
> }
> };
>
> For classes with static data, type initializers are optional: If you don't
> provide it, the compiler always generates one with default init values.
> In your code: if a class provide a declaration for cctor, check the
> existence of its definition.


Thanks for the feedback (sorry for the delay in responding). This is good to
know but it doesn't apply unfortunately since there are no static members at
all. Maybe it applies in some other esoteric way (or perhaps there's some
static member behind the scenes somewhere) but I gave up on the problem
after creating a new project and migrating the code to it. That fixed things
so I'm not going to bother tracking it down (it's PayPal's code so I'm not
going to worry about it now that it's working). Note BTW (FWIW) that it
still relies on "_gc". Anyway, thanks again for your help (appreciated).


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ Linker error with Dispose =?Utf-8?B?ZHVnYWxo?= Microsoft Dot NET Framework 1 8th Apr 2005 12:29 PM
Installing VC-7 gives stops working of VC-6 (gives linker error) R Tamilarasan Microsoft Dot NET 0 30th Jul 2004 01:55 PM
linker error with 'new' Ffelagund Microsoft Dot NET Framework 3 1st Mar 2004 08:32 PM
RE: Linker error when trying to use CryptApi Pavel Treskunov [MSFT] Microsoft Dot NET Compact Framework 0 10th Dec 2003 07:40 PM
msvcirtd.lib Linker Error Chris Microsoft Dot NET 2 7th Jul 2003 04:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:38 AM.