On 8/17/06, Martin Piecyk <email@example.com> wrote:
> I am a developer who wants to build a client application using
> Subversion's C client API. Running on Windows XP, I downloaded
> and http://subversion.tigris.org/files/documents/15/32473/svn-win32-1.3.2.zip
> to gain access to the header files and pre-compiled static libraries.
> I read the entire Subversion book located in the Windows .exe
> installation (since it was newer than
> http://svnbook.red-bean.com/en/1.1/index.html), including the chapter
> for developers. I understand Subversion's use of APR's memory pools
> and reasons for doing so and the modularized layered library design,
> such as the libraries for the Repository Access and Repository layers.
> Additionally, I looked read through Subversion's documentation in
> http://svn.collab.net/svn-doxygen/, looking mostly at the client
> functions and data types, and the APR documentation in
> http://apr.apache.org/docs/apr/, http://apr.apache.org/docs/apr-util/,
> and http://apr.apache.org/docs/apr-iconv/. I read through
> http://subversion.tigris.org/hacking.html and a tutorial using the
> client API at http://www.linuxdevcenter.com/pub/a/linux/2003/04/24/libsvn1.html
> (but this uses an older version of Subversion).
> However, after reading all of these documents, I still do not know how
> to make a simple console application in C that does something with
> Subversion such as checkout a repository into a particular directory
> using a particular user name and password. I believe that in all of
> the aforementioned papers I read through, none had a complete working
> example written in the C or C++ language with a "main" function. I was
> hoping that maybe someone knew of a tutorial that can help someone
> such as myself get off to a good start with developing with the
> Subversion API. Looking through the actual source code of the command
> line client, svn.exe, confused me since I was not sure which lines of
> code I would need for performing a simple checkout and what the
> purpose of each line was.
> Eventually, I found
> http://svn.collab.net/repos/svn/trunk/tools/examples/, but I could not
> get any of the C files to compile with Microsoft Visual C++ 6.0.
> Additionally, they seemed a bit complicated to me since there were
> several lines of code I wasn't sure of but no tutorial that goes
> through them line by line.
> Here is my error output of headrev.c, which is in the examples
> directory. All of the other C files in the examples directory I
> compiled had similar errors.
> --------------------Configuration: subversionheadnumber - Win32
> E:\subversionheadnumber\headrev.c(132) : warning C4013:
> 'svn_io_open_unique_file2' undefined; assuming extern returning int
> E:\subversionheadnumber\headrev.c(132) : error C2065:
> 'svn_io_file_del_on_close' : undeclared identifier
> E:\subversionheadnumber\headrev.c(132) : warning C4047: 'initializing'
> : 'struct svn_error_t *' differs in levels of indirection from 'int '
> Error executing cl.exe.
> subversionheadnumber.exe - 1 error(s), 2 warning(s)
> Does anyone know of any tutorials on using the C client API of
> Subversion 1.3 or other example programs? Also, does anyone know what
> my problems are with compiling the source code? I used the development
> files in svn-win32-1.3.2_dev.zip to attempt to compile the source. Any
> help or links would be greatly appreciated.
I imagine you're getting those errors because you're not including all
the necessary header files. That particular error seems to result
from not including svn_io.h (not sure why headrev.c would have that
problem, but it's certainly possible).
The best example program is probably minimal_client.c, although I
don't know of an up to date tutorial to go along with it.
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Thu Aug 17 22:21:58 2006