Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: 64bit linker problem; where to put this to get a response; link template


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Oct 23, 2014 4:26 AM Last Post By: Valence Crearer
Valence Crearer

Posts: 64
Registered: 11/27/99
64bit linker problem; where to put this to get a response; link template  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 22, 2014 9:22 AM
What forum is most likely to answer this question?

I get the following from ilink64

[ilink64 Error] Error: Unresolved external 'void TCommandProcessor::VCL<void (* __closure)(int), int>(void (* __closure)(int), int)' referenced from H:\TE\CENTRON\DCSIMAIL\DOBJ64\DCSIMAILFRM.O

The code is like:
void __fastcall VCL(T fc, T1 parameter1) {
class TMetaClosure {
public:
union {
T closure;
struct {
_NativeUInt function;
_NativeUInt instance;
};
};
T1 p1;
static void CALLBACK MyFunc(_NativeUInt d) {
TMetaClosure* a = reinterpret_cast<TMetaClosure*>(d);
a->closure(a->p1);
delete a;
}
TMetaClosure(T1 _p1):p1(_p1) {}
};
TMetaClosure* a = new TMetaClosure(parameter1);
a->closure = fc;
if(!PostMsg(reinterpret_cast<_NativeUInt>(&a->MyFunc),reinterpret_cast<_NativeUInt>(a))) delete a;
}

The other functions are linking, but this one is not! it has a static function, and works in Builder 2010, and XE7 32bit. The compiler likes it, but I can't tell if its properly treating the static function.

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: 64bit linker problem; where to put this to get a response; linktemplate  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 22, 2014 9:53 AM   in response to: Valence Crearer in response to: Valence Crearer
Valence wrote:

What forum is most likely to answer this question?

The C++ Language forum would be the best choice.

https://forums.embarcadero.com/forum.jspa?forumID=30

I get the following from ilink64

[ilink64 Error] Error: Unresolved external 'void TCommandProcessor::VCL<void
(* __closure)(int), int>(void (* __closure)(int), int)' referenced from H:\TE\CENTRON\DCSIMAIL\DOBJ64\DCSIMAILFRM.O

You did not show how TCommandProcessor is declared. I am assuming that VCL()
is being implemented inlined inside of the TCommandProcessor declaration
itself, is that right?

On a side note, the union in the TMetaClosure is unnecessary, as you are
not using the 'function' and 'instance' fields for anything. But if you
did need access to the indivudual components of a closure, you can use the
RTL's own TMethod struct for that purpose instead of defining your own fields:

union {
    T closure;
    TMethod method;
}


--
Remy Lebeau (TeamB)
Valence Crearer

Posts: 64
Registered: 11/27/99
Re: 64bit linker problem; where to put this to get a response; linktemplate  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2014 4:26 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Valence wrote:

What forum is most likely to answer this question?

The C++ Language forum would be the best choice.

Thanks very much! I had not used that, since the Compiler seemed to be working fine. The 64bit linker was my focus, but I'll give C++ a try.


https://forums.embarcadero.com/forum.jspa?forumID=30

I get the following from ilink64

[ilink64 Error] Error: Unresolved external 'void TCommandProcessor::VCL<void
(* __closure)(int), int>(void (* __closure)(int), int)' referenced from H:\TE\CENTRON\DCSIMAIL\DOBJ64\DCSIMAILFRM.O

You did not show how TCommandProcessor is declared. I am assuming that VCL()
is being implemented inlined inside of the TCommandProcessor declaration
itself, is that right?

class PACKAGE_TYPE TCommandProcessor : public TCustomControl {...


On a side note, the union in the TMetaClosure is unnecessary, as you are
not using the 'function' and 'instance' fields for anything. But if you
did need access to the indivudual components of a closure, you can use the
RTL's own TMethod struct for that purpose instead of defining your own fields:

union {
    T closure;
    TMethod method;
}


--
Remy Lebeau (TeamB)

Simple enough, thanks for that. This will be better in case of changes in the long term.

How do I move this thread to C++ Compiler? (Just duplicate?)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02