C++ libsvn-svn_客户端_checkout()

C++ libsvn-svn_客户端_checkout(),c++,svn,visual-c++,C++,Svn,Visual C++,我试着做一个简单的检查。我有我认为可以工作的代码,我可以编译它 #include "stdafx.h" #include "svn_pools.h" #include "svn_client.h" int _tmain(int argc, _TCHAR* argv[]) { svn_error_t *err; apr_pool_t *pool; svn_client_ctx_t *ctx; apr_initialize(); pool = svn_p

我试着做一个简单的检查。我有我认为可以工作的代码,我可以编译它

#include "stdafx.h"
#include "svn_pools.h"
#include "svn_client.h"


int _tmain(int argc, _TCHAR* argv[])
{
    svn_error_t *err;
    apr_pool_t *pool;
    svn_client_ctx_t *ctx;

    apr_initialize();
    pool = svn_pool_create( NULL );

    if ( err = svn_client_create_context( &ctx, pool ) )
    {
        svn_pool_destroy( pool );
            return 0;
    }

    err = svn_client_checkout( NULL, "http://tortoisesvn.googlecode.com/svn/trunk/src/ResText", "C:\\sve", NULL, true, ctx, pool );
    svn_pool_destroy( pool );
    return 0;
}

但在运行时,函数svn_client_checkout出现错误。读取0x00000000时发生访问冲突。我想我忘记初始化我的一个变量了。但是什么和在哪里?

似乎第四个参数const svn_opt_revision_t*peg_revision不是可选的,因此空值不起作用

初始化它,例如,这样应该可以工作:

svn_opt_revision_t rev = {svn_opt_revision_head, 0};
svn_client_checkout(..., "C:\\sve", &rev, true, ...);

有关如何设置和使用它的详细信息,请参阅。

。。。我在另一个程序中试过,也犯了同样的错误。但是现在在这个简单的测试中,这段代码可以工作了!!!具有以下功能:revision.kind=svn\u opt\u revision\u head//svn_opt_revision_t rev={svn_opt_revision_unspecified,0};err=svn\u client\u checkout NULL,C:\\sve,&revision,true,ctx,pool;沉没!但我真正的程序仍然不起作用。С继续交易…好的,我将编辑svn_opt_revision_head in,未指定显然是不好的。-但它现在怎么不起作用呢?仍然因为0x00000000的访问冲突而崩溃?我似乎发现了我的错误。svn_client_create_context我在别处执行,然后保存ctx并传递给一个函数,该函数为svn_client_checkout提供服务。然后在0x00000000发生访问冲突我想是的。。。现在检查=确定。如果ctx出现配置文件错误。没有it程序工作求救!