views:

148

answers:

1

i All,

I am trying to get TIdTCPClient to run in my non-visual component. I add the following to my .h file:

#include "IdBaseComponent.hpp"
#include "IdComponent.hpp"
#include "IdTCPClient.hpp"
#include "IdTCPConnection.hpp"
...
private:
   TIdTCPClient *mTCPClient;

It all compiles fine, but of course Indy is not included in the build yet.

So I do this in my .cpp file:

#pragma link "IdBaseComponent"
#pragma link "IdComponent"
#pragma link "IdTCPClient"
#pragma link "IdTCPConnection"
...
mTCPClient = new TIdTCPClient( NULL );

during compile I get:

[ILINK32 Error] Fatal: Unable to open file 'IDBASECOMPONENT.OBJ'

This all works if I just drop the component onto a form, the same lines are added as I manually add in my component (except the new) and it all compiles fine. I can't figure it out.

Thanks

+1  A: 

Have you tried adding the Indy package to your Requires section, just add the required .bpi files from the lib folder in the CodeGear installation path.

You can do this by the Project menu:

Project > Add to Project... (Shift+F11) > Requires > Browse...

Find the Indy*.bpi files in either lib\Debug or lib\Release and add the required ones to your project.

TommyA
I ended up adding #pragma link "IndyCore.bpi" into the .cpp and that worked. Seems to get the same lib for release and debug builds from $(BDS)\lib. This of course get the release build, so your way is better.
gbrandt

related questions