Topic "Debugging WinSCP"

Author Message
Zhou

Guest


First of all, I want to say that WinScp is a great application and well-done job. That is why I am learning the source code as a good example of network application.

I plan to purchase Borland C++ builder so I can build and trace the execute flow. (Also get to know about Borland)

Can you tell me in advance that how to build debuggable version of WinScp? I never use Borland C++ builder befor. I am an UNIX Posix person and going to do something project on Windows.

Another question, WinSCP is running on Windows but built by Borland C++. How did you get away from using Windows stuff?

Thank you in advance. Smile
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Quote:
I plan to purchase Borland C++ builder so I can build and trace the execute flow. (Also get to know about Borland)

Please note that I use C++ Builder 6 for WinSCP. I doubt it compiles in newer versions. And I'm not sure if Borland sells version 6. It is quite old.

Zhou wrote:
Another question, WinSCP is running on Windows but built by Borland C++. How did you get away from using Windows stuff?

Just open each project file (.bpr) in C++Builder and go to project options. There is preset button "Debug". Then recompile.

Quote:
Another question, WinSCP is running on Windows but built by Borland C++. How did you get away from using Windows stuff?

C++ Builder is IDE for Windows, if that answers your question.
_________________
Martin Prikryl
Zhou

Guest


Prikryl, thank you for replying. You are fast. Smile

Is C++Builder 6 Personal what I need to compile and trace your source code?

I am reading your code and noticed that for back-end you are using putty and filezilla. From what I read in this Forum, you use Putty for SCP implementation. Do I understand correctly? What else for you are using Putty implementation? What is the reason that you choose to use FileZilla? Is this your own FiileZilla or the same filezilla as filezilla-project.org

The structure of Winscp, I understand, is

WinSCP GUI Code <->
FileZilla <->
Putty, your SFTP <->
System Call (via Borland Library)
. Am I right? Excuse me if I am totally wrong. Can you give out a simple picture of Winscp architecture.

Thank you.
Zhou

Guest


Hello!

I bought C++ builder 6 and download the 4.0 code. However,
I ran into the following compilation problems. Sad Any ideas why?

Thank you.


C:\winscp\400>make
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
cd packages
C:\PROGRA~1\Borland\CBUILD~1\Bin\..\bin\bpr2mak Moje_B5.bpk
BPR2MAK C++Builder Project file to Makefile converter. Version 5.0
Copyright (C) 2000, Borland Corporation

Loading project file
Loading template
Generating Makefile
......................................... C:\PROGRA~1\Borland\CBUILD~1\Bin
\..\bin\make.exe -l -o -fMoje_B5.mak
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
C:\PROGRA~1\Borland\CBUILD~1\bin\..\BIN\bcc32 -O2 -H=C:\PROGRA~1\Borland
\CBUILD~1\bin\..\lib\vcl60.csm -Hc -w -Vx -Ve -X- -a8 -b- -k- -vi -c -tWM -wuse
-w-par -I"my";C:\PROGRA~1\Borland\CBUILD~1\bin\..\include;C:\PROGRA~1\Borland\CB
UILD~1\bin\..\include\vcl -D;NO_STRICT;USEPACKAGES -n.\ .\Moje_B5.cpp
Borland C++ 5.6 for Win32 Copyright (c) 1993, 2002 Borland
.\Moje_B5.cpp:
Loaded pre-compiled headers.
C:\PROGRA~1\Borland\CBUILD~1\bin\..\BIN\dcc32 -$Y- -$L- -$D- -$C- -$A8 -
v -JPHNE -M -U"my";C:\PROGRA~1\Borland\CBUILD~1\bin\..\include;C:\PROGRA~1\Borla
nd\CBUILD~1\bin\..\include\vcl -D;NO_STRICT;USEPACKAGES -O"my";C:\PROGRA~1\Borla
nd\CBUILD~1\bin\..\include;C:\PROGRA~1\Borland\CBUILD~1\bin\..\include\vcl --BCB
my\HistoryComboBox.PAS
Borland Delphi Version 14.0
Copyright (c) 1983,2002 Borland Software Corporation
my\HistoryComboBox.pas(168)
169 lines, 0.06 seconds, 2010 bytes code, 4 bytes data.
C:\PROGRA~1\Borland\CBUILD~1\bin\..\BIN\dcc32 -$Y- -$L- -$D- -$C- -$A8 -
v -JPHNE -M -U"my";C:\PROGRA~1\Borland\CBUILD~1\bin\..\include;C:\PROGRA~1\Borla
nd\CBUILD~1\bin\..\include\vcl -D;NO_STRICT;USEPACKAGES -O"my";C:\PROGRA~1\Borla
nd\CBUILD~1\bin\..\include;C:\PROGRA~1\Borland\CBUILD~1\bin\..\include\vcl --BCB
my\ListViewColProperties.PAS my\MoreButton.PAS my\NortonLikeListView.PAS my\Pat
hLabel.PAS my\UpDownEdit.PAS my\ComboEdit.PAS my\PasswordEdit.PAS my\ResourceMod
ule.PAS my\CompThread.PAS my\DiscMon.PAS my\TcpIp.PAS my\GrayedCheckBox.PAS my\I
EListView.PAS my\LanguagesDEPfix.PAS
Borland Delphi Version 14.0
Copyright (c) 1983,2002 Borland Software Corporation
my\ListViewColProperties.pas(445)
my\MoreButton.pas(216)
my\NortonLikeListView.pas(606)
my\PathLabel.pas(463)
my\UpDownEdit.pas(606)
my\ComboEdit.pas(1311)
my\PasswordEdit.pas(114)
my\ResourceModule.pas(208)
my\CompThread.pas(350)
my\DiscMon.pas(893)
my\TcpIp.pas(933)
my\GrayedCheckBox.pas(39)
my\IEListView.pas(777)
my\LanguagesDEPfix.pas(140)
7115 lines, 0.34 seconds, 986 bytes code, 12 bytes data.
C:\PROGRA~1\Borland\CBUILD~1\bin\..\BIN\ilink32 @MAKE0000.@@@
Turbo Incremental Link 5.60 Copyright (c) 1997-2002 Borland
Error: Could not create ..\lib\Moje_B5.tds (error code 3)

** error 2 ** deleting ..\lib\Moje_B5.bpl

** error 1 ** deleting lib\Moje_B5.lib

C:\winscp\400> Sad
Zhou

Guest


OK.

I passed this above error by manually creating a "lib" directory.

However, I got the error saying "Can't find afx.h" when FileZilla is built.

I find out that the personal version Builder 6 doesn't have /include/mfs folder, where afx.h resides.

Any idea how to solve it?

Thank you.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Zhou wrote:
Is C++Builder 6 Personal what I need to compile and trace your source code?

You would be able to compile 3.8.2 with the Personal edition. 4.0 beta as it is now cannot be compiled with Personal edition, because of the FileZilla code. I'm planing to make FileZilla-free build scripts in the 4.0.1.

Quote:
I am reading your code and noticed that for back-end you are using putty and filezilla. From what I read in this Forum, you use Putty for SCP implementation. Do I understand correctly? What else for you are using Putty implementation?

I'm using PuTTY for SSH implementation. SCP implementation is mostly mine, it just partially inspired by PuTTY.

Quote:
What is the reason that you choose to use FileZilla? Is this your own FiileZilla or the same filezilla as filezilla-project.org

It is filezilla from filezilla.sourceforge.net. filezilla-project.org is for FZ3, which I'm not using.

Quote:
The structure of Winscp, I understand, is

WinSCP GUI Code <->
FileZilla <->
Putty, your SFTP <->
System Call (via Borland Library)
. Am I right? Excuse me if I am totally wrong. Can you give out a simple picture of Winscp architecture.


The layers are like:
1) WinSCP GUI
2) My SFTP/SCP code and wrapper for FileZilla FTP code
3) PuTTY (SSH) and FileZilla (FTP)
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Zhou wrote:
I passed this above error by manually creating a "lib" directory.

However, I got the error saying "Can't find afx.h" when FileZilla is built.

I find out that the personal version Builder 6 doesn't have /include/mfs folder, where afx.h resides.

Any idea how to solve it?

See my previous post 4.0 beta cannot be compiled with Personal edition of C++Builder because of absence of MFC library used by FileZilla.
_________________
Martin Prikryl
Zhou

Guest


Thank you for your reply.

I borrowed an Enterprise version from a friend.

I have no problem to build release version of winScp 4.0. However, when I tried to build the debug version, I got the following error
[Linker Error] Unresolved external '__fastcall DoAssert(char *, char *, int)' referenced from C:\WINSCP\400\WINDOWS\USERINTERFACE.OBJ

The steps that I build debug version are
1. Open each project (the .bpr file) and set the compiler option (under Project's option) to "Full Debug".

Any idea how to solve this error.

Thank you.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
OK, that's my mistake. In the released source code, there is no implementation for DoAssert. Please change the definition of macro assert in core/Common.h to no-op. And rebuild all projects.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License