Board index » cppbuilder » Unresolved extern

Unresolved extern

Hi:

  Linker Error Message:

  Unresolved extern VerifyAddress(const SmallString<255>&, void)
__fastcall referenced from blah, blah, blah.

  The VerifyAddress function is in delphi:

function TEmail.VerifyAddress(const ARecipient: SString; CallingHandle :
HWND): Integer;

   and is called:

         RMail->VerifyAddress(TempEMail, Application->Handle);

Any ideas what I am dealing with here would be greatly appreciated.

                                                    Best regards

 

Re:Unresolved extern


Hi, Robert!

Note that the message, if copied correctly, says

    VerifyAddress(const SmallString<255>&, void) __fastcall referenced
from blah, blah, blah.

not

    TEMail::VerifyAddress(const SmallString<255>&, void) __fastcall
referenced from blah, blah, blah.

I'd suggest if this is the case that you have some non-class reference
to this function in some code somewhere.

------
Mark Cashman (TeamB - C++ Builder), creator of The Temp{*word*203}Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------

Re:Unresolved extern


Hi:

  Thanks.

  Sorry. That is exactly what it says, I just copied the part "I"
thought was relevant.

Quote
>     TEMail::VerifyAddress(const SmallString<255>&, void) __fastcall
> referenced from blah, blah, blah.

  So as for my original question, what does this mean?

                                                   Best regards

Re:Unresolved extern


Hi, Robert!

Just that it can't find a method with the described signature in the
described class.

Compile with detailed map file on, look in that file and see if it is
correct.

------
Mark Cashman (TeamB - C++ Builder), creator of The Temp{*word*203}Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------

Re:Unresolved extern


Hi:

  Tried what you suggested and something is really wrong with what I am
doing. I have done modifications to other components (copied
DBNavigator, renamed and incorporated a bunch of stuff to handle
transactions. Works fine with no problems )so I am little confused over
what I have done wrong here. Should be simple thing to pass handle.
Thanks for help.

This is from Map file (everything for Email). The function VerifyAddress
does not appear. I have rebuilt lib. I have deleted and reinstalled
Email. Still the same.

 0001:000BBCE0      Email::TEmail::
 0001:000BBDA0      @$xp$12Email@TEmail
 0001:000BC220      Email::TEmail::TEmail(Classes::TComponent*)
__fastcall
 0001:000BC2C4      Email::TEmail::~TEmail() __fastcall
 0001:000BC3B0      Email::TEmail::GetVersion() __fastcall
 0001:000BC3CC      Email::TEmail::GetMapiAvail() __fastcall
 0001:000BC3D4      Email::TEmail::DoBeforeLogon() __fastcall
 0001:000BC3F0      Email::TEmail::DoAfterLogon() __fastcall
 0001:000BC40C      Email::TEmail::DoBeforeLogoff() __fastcall
 0001:000BC428      Email::TEmail::DoAfterLogoff() __fastcall
 0001:000BC444      Email::TEmail::DoBeforeSaveMail() __fastcall
 0001:000BC460      Email::TEmail::DoAfterSaveMail() __fastcall
 0001:000BC47C      Email::TEmail::DoBeforeSendMail() __fastcall
 0001:000BC498      Email::TEmail::DoAfterSendMail() __fastcall
 0001:000BC4B4      Email::TEmail::DoMapiError(int) __fastcall
 0001:000BC4D4      Email::TEmail::CheckMapi() __fastcall
 0001:000BC52C      Email::TEmail::Logon() __fastcall
 0001:000BC890      Email::TEmail::Logoff() __fastcall
 0001:000BC8D4      Email::TEmail::TruncAttachmentFN(const
System::SmallString<255>&) __fastcall
 0001:000BC97C      Email::TEmail::SendMailEx(bool) __fastcall
 0001:000BD058      Email::TEmail::SendMail() __fastcall
 0001:000BD060      Email::TEmail::CheckAttachment(const
System::SmallString<255>&) __fastcall
 0001:000BD0C4      Email::TEmail::SetRecip(const Classes::TStrings*)
__fastcall
 0001:000BD0D0      Email::TEmail::SetCC(const Classes::TStrings*)
__fastcall
 0001:000BD0DC      Email::TEmail::SetBcc(const Classes::TStrings*)
__fastcall
 0001:000BD0E8      Email::TEmail::SetAttachment(const
Classes::TStrings*) __fastcall
 0001:000BD0F4      Email::TEmail::SetDownLoadFirst(bool) __fastcall
 0001:000BD11C      Email::TEmail::SetNewSession(bool) __fastcall
 0001:000BD144      Email::TEmail::Address() __fastcall
 0001:000BD434    
Email::TEmail::ListToRecipArray(Classes::TStrings*,Smapi::TMapiRecipDesc[89478485]*,int)
__fastcall

This is from EMail.hpp

        int __fastcall VerifyAddress(const System::ShortString &ARecipient,
HWND Handle);

This is code from Email.pas

  public
    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;
    function Address                                       : Integer;
    function VerifyAddress(const ARecipient: SString; Handle : HWND):
Integer;

And the function:

{Verify Address/AddressChange with Dialog}
function TEmail.VerifyAddress(const ARecipient: SString ; Handle :
HWND): Integer;

I am not currently using the Handle in testing as it won't link per
original post.

Re:Unresolved extern


Hi, Robert!

I'm not a Delphi guy, but my guess is that something needs to be done to
make the function visible outside the compilation unit. In C++ to make
the functions in a class visible you need the PACKAGE modifier in the
class header, and for standalone functions, you need it in the function
header.

I wish I could be of more help on that.

------
Mark Cashman (TeamB - C++ Builder), creator of The Temp{*word*203}Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------

Re:Unresolved extern


HI:

   I pushed F1 for help on the linker error and reread it. Then did a
search on THandle v HWND in Delphi dir & conclude that HWND isn't in
Delphi. Changed my function declaration from Handle : HWND to Handle :
THandle and it compiled and linked. Voila!!

   However, when I was using this before and passing 0 in the
MapiAddress, it opened up the address book with the correct name and
e-mail address. Now, passing handle it opens it with the Name and a
bunch of garbage?

   Let me explain what I am doing. In the table, when I enter an e-mail
address, I want to verify it and if not in address book, I will add it.
Also, if I modify existing address in table, it opens address book and
is supposed to highlight previous address for modification. And, if I
delete e-mail address from table, it opens address book to old address
for deletion.

   Using the Handle = 0 the functionality was all there but it never
opened address book with existing e-mail address highlighted. I am using
NS Communicator 4.51 and if I typed the name into the "Show names
containing" edit, it selected the correct one. I just "assumed" that
passing a name that was in the address book would cause it to be
selected. Maybe not. I am also having problems with opening multiple
instances of the address book which then prevent the mainform from
receiving focus so I have to test for it being already open. It seems
that LogOff does not actually close the Address book as if I open it
again, it still has the previous e-mail address showing then the
mainform becomes unresponsive and when I close the second instance of
the address book, it raised access violation.

Do you know of any examples of doing this kind of thing correctly?

Thanks.

                                                  Best regards

Re:Unresolved extern


 HI:

    I pushed F1 for help on the linker error and reread it. Then did a
 search on THandle v HWND in Delphi dir & conclude that HWND isn't in
 Delphi. Changed my function declaration from Handle : HWND to Handle :
 THandle and it compiled and linked. Voila!!

    Let me explain what I am doing. In the table, when I enter an e-mail
 address, I want to verify it and if not in address book, I will add it.
 Also, if I modify existing address in table, it opens address book and
 is supposed to highlight previous address for modification. And, if I
 delete e-mail address from table, it opens address book to old address
 for deletion.

    Using the Handle = 0 the functionality was all there but it never
 opened address book with existing e-mail address highlighted. I am
using
 NS Communicator 4.51 and if I typed the name into the "Show names
 containing" edit, it selected the correct one. I just "assumed" that
 passing a name that was in the address book would cause it to be
 selected. Maybe not. I am also having problems with opening multiple
 instances of the address book which then prevent the mainform from
 receiving focus so I have to test for it being already open. It seems
 that LogOff does not actually close netscape in some cases. If I open
it
 again, it still has the previous e-mail address showing and the new one
I verified.

 Do you know of any examples of doing this kind of thing correctly?

 Thanks.

                                                   Best regards

Other Threads