BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TIdTCPClient Base Class

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket)
View previous topic :: View next topic  
Author Message
Curt
Guest





PostPosted: Fri Sep 09, 2005 2:25 am    Post subject: TIdTCPClient Base Class Reply with quote




I am trying to derive a very simple class from TIdTCPClient but I get the
error

Unresolved external '__fastcall IdTcpclient::TIdTCPClient::SetPortA(const
int)' referenced from c:...unit2.obj.

Does anyone have any idea why I get this error ?

Here are the steps I take:
1) New Application
2) New Unit
3) The following code in the new unit (.H and .C)


.H
//--------------------------------------------------------------------------
-
#ifndef Unit2H
#define Unit2H
//--------------------------------------------------------------------------
-
#include <winsock2> // just to cover for multiple fd_set error
#include <IdBaseComponent.hpp>
#include <IdComponent.hpp>
#include <IdTCPClient.hpp>
#include <IdTCPConnection.hpp>

class TTest : public Idtcpclient::TIdTCPClient
{
public:
__fastcall virtual TTest(Classes::TComponent* AOwner);
};
#endif


.C
//--------------------------------------------------------------------------
-
#pragma hdrstop
#include "Unit2.h"
//--------------------------------------------------------------------------
-
#pragma package(smart_init)
__fastcall TTest::TTest(Classes::TComponent* AOwner) : TIdTCPClient(AOwner)
{
};



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Sep 09, 2005 3:40 am    Post subject: Re: TIdTCPClient Base Class Reply with quote




"Curt" <noemailaddress> wrote


Quote:
Unresolved external '__fastcall IdTcpclient::TIdTCPClient::SetPortA(const
int)' referenced from c:...unit2.obj.

Known problem. It is a Win32 API "bug", not an Indy bug. winspool.h
declares a #define statement that maps SetPort() to SetPortA() or SetPortW()
depending on whether UNICODE is declared. #define statements are global,
effecting the entire application.

If you go to http://search.borland.com and http://www.deja.com and search
for "SetPortA", you will see that this issue has been discussed many times
before.


Gambit



Back to top
Curt
Guest





PostPosted: Fri Sep 09, 2005 3:54 am    Post subject: Re: TIdTCPClient Base Class Reply with quote



Thank you.

"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote

Quote:

"Curt" <noemailaddress> wrote in message
news:4320f1c9$1 (AT) newsgroups (DOT) borland.com...

Unresolved external '__fastcall
IdTcpclient::TIdTCPClient::SetPortA(const
int)' referenced from c:...unit2.obj.

Known problem. It is a Win32 API "bug", not an Indy bug. winspool.h
declares a #define statement that maps SetPort() to SetPortA() or
SetPortW()
depending on whether UNICODE is declared. #define statements are global,
effecting the entire application.

If you go to http://search.borland.com and http://www.deja.com and search
for "SetPortA", you will see that this issue has been discussed many times
before.


Gambit





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.