Console app EXE - No runtime packages/libraries - Linker err

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
benkedon
Posts: 28
Joined: Tue 15 May 2007 12:27

Console app EXE - No runtime packages/libraries - Linker err

Post by benkedon » Fri 05 Sep 2008 14:04

Thanks, Dimon :

Great ! Putting the event handlers into the class took care of that issue...

Now, I want to deploy WITHOUT runtime libraries and runtime packages, i.e. as a single EXE file.

I UN-checked the relevant "Project Options", i.e. "Dynamic RTL" and "Build with runtime packages".

However, now I get the following Linker errors:

[ILINK32 Error] Fatal: Unable to open file "SCBRIDGE.OBJ"
[ILINK32 Error] Fatal: Unable to open file "SCSSHCHANNEL.OBJ"
[ILINK32 Error] Fatal: Unable to open file "SCSSHCLIENT.OBJ"

I have the standard version, and have ".DCU" files for those modules, but
NO ".OBJ" files.

I tried compiling the ".DCU" files, to no avail..

What should I do now ?

Thanks.

Current code is :

//---------------------------------------------------------------------------

#include
#include
#pragma hdrstop
#include "ScBridge.hpp"
#include "ScSSHChannel.hpp"
#include "ScSSHClient.hpp"

#pragma package(smart_init)
#pragma link "ScBridge"
#pragma link "ScSSHChannel"
#pragma link "ScSSHClient"

class TSSHEvents
{
public:
void __fastcall ScSSHClient1ServerKeyValidate(TObject *Sender,TScKey *NewServerKey, bool &Accept);
void __fastcall ScRegStorage1CheckUserKey(TObject *Sender,TScSSHClientInfo *ClientInfo, TScKey *Key, bool &Accept);
void __fastcall ScRegStorage1CheckUserPass(TObject *Sender,TScSSHClientInfo *ClientInfo, const AnsiString Password, bool &Accept);
void __fastcall ScSSHShell1AsyncReceive(TObject *Sender);
};

TScRegStorage* ScRegStorage1;
TScSSHClient* ScSSHClient1;
TScSSHShell* ScSSHShell1;
TSSHEvents* SSHEvents;

bool command_sent = false;
AnsiString server_receipt_str = "",
cum_server_receipt_str = "",
prompt_str = "==>";
//---------------------------------------------------------------------------

#pragma argsused
int main(int argc, char* argv[])
{
AnsiString command_str,
param_str_i;
int i;
TReplaceFlags rf;

SSHEvents = new TSSHEvents;
ScRegStorage1 = new TScRegStorage(NULL);
ScSSHClient1 = new TScSSHClient(NULL);
ScSSHShell1 = new TScSSHShell(NULL);

ScRegStorage1->OnCheckUserPass = SSHEvents->ScRegStorage1CheckUserPass;
ScRegStorage1->OnCheckUserKey = SSHEvents->ScRegStorage1CheckUserKey;

ScSSHClient1->KeyStorage = ScRegStorage1;
ScSSHClient1->OnServerKeyValidate = SSHEvents->ScSSHClient1ServerKeyValidate;
ScSSHClient1->HostName = "mtolx195.dc.mars";
ScSSHClient1->User = "oracle";
ScSSHClient1->Password = "dudley";
ScSSHClient1->Connected = true;

ScSSHShell1->Client = ScSSHClient1;
ScSSHShell1->OnAsyncReceive = SSHEvents->ScSSHShell1AsyncReceive;
ScSSHShell1->NonBlocking = true;
ScSSHShell1->Connected = true;

rf = rf " prompt
Application->ProcessMessages();
};
cum_server_receipt_str = "";
command_sent = true;
ScSSHShell1->WriteString(command_str + "\n");
while (
(ScSSHShell1->OutCount > 0) ||
(0 == cum_server_receipt_str.Pos(prompt_str))
) {
Application->ProcessMessages();
};

ScSSHShell1->Connected = false;
ScSSHClient1->Connected = false;

delete ScSSHShell1;
delete ScSSHClient1;
delete ScRegStorage1;
delete SSHEvents;

return 0;
}
//---------------------------------------------------------------------------

void __fastcall TSSHEvents::ScSSHShell1AsyncReceive(TObject *Sender)
{
server_receipt_str = ScSSHShell1->ReadString();
if (command_sent) {
puts(server_receipt_str.c_str());
};
cum_server_receipt_str = cum_server_receipt_str + server_receipt_str;
}
//---------------------------------------------------------------------------

void __fastcall TSSHEvents::ScSSHClient1ServerKeyValidate(TObject *Sender,
TScKey *NewServerKey, bool &Accept)
{
Accept = true;
}
//---------------------------------------------------------------------------

void __fastcall TSSHEvents::ScRegStorage1CheckUserKey(TObject *Sender,
TScSSHClientInfo *ClientInfo, TScKey *Key, bool &Accept)
{
Accept = true;
}
//---------------------------------------------------------------------------

void __fastcall TSSHEvents::ScRegStorage1CheckUserPass(TObject *Sender,
TScSSHClientInfo *ClientInfo, const AnsiString Password, bool &Accept)
{
Accept = true;
}
//---------------------------------------------------------------------------

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 08 Sep 2008 13:24

Please do not duplicate topics. We have answered you in other thread.

Post Reply