« | July 2025 | » | 日 | 一 | 二 | 三 | 四 | 五 | 六 | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | | | |
| 公告 |
戒除浮躁,读好书,交益友 |
Blog信息 |
blog名称:邢红瑞的blog 日志总数:523 评论数量:1142 留言数量:0 访问次数:9674789 建立时间:2004年12月20日 |

| |
[UTM]vc6 编译openvpn 2.1 原创空间, 文章收藏, 软件技术, 电脑与网络
邢红瑞 发表于 2009/8/12 17:45:18 |
编译前 使用最新下载的源码 openssl lzo和pkcs11-helper-1.05.tar.bz2,我使用mingw编译过的,发现很多头文件都有错误。
1 编译 OpenSSLcd C:\openssl-0.9.8gperl Configure VC-WIN32 --prefix=c:/opensslms\do_masmnmake -f ms\nt.mak && nmake -f ms\nt.mak test && nmake -f ms\nt.mak install
out32目录下有 libeay32.lib和ssleay32.lib
2 编译 LZO
cd C:\lzo-2.03b\win32\vc.bat 得到lzo2.lib
3 编译 pkcs11-helper
cd C:\pkcs11-helpercd libnmake -f Makefile.w32-vc OPENSSL=1 OPENSSL_HOME=C:\openssl-0.9.8k
生成pkcs11-helper.lib
4 编译OpenVPN
config-win32.h, 删除 #include "autodefs/defs.h"
vc 没有函数 使用
#ifdef CONFIG_WIN32 #define strcasecmp _stricmp#endif
nmake -f makefile.w32-vc
patch文件 openvpn-2_1_rc7-windows-compile.patch
diff -u8rp openvpn-2.1_rc7.orig/config-win32.h openvpn-2.1_rc7/config-win32.h--- openvpn-2.1_rc7.orig/config-win32.h Thu Jan 24 00:38:42 2008+++ openvpn-2.1_rc7/config-win32.h Mon May 5 01:21:31 2008@@ -28,19 +28,19 @@ * * config-win32.h is normally generated by copying * config-win32.h.in -> config-win32.h and replacing * [ampersand] VERSION [ampersand] * with the appropriate version #. This is normally * done automatically by configure.ac */
+#include <stdio.h> #include <windows.h> #include <winsock2.h>-#include "autodefs/defs.h"
#define sleep(x) Sleep((x)*1000)
#define random rand #define srandom srand
typedef unsigned long in_addr_t;
@@ -210,35 +210,35 @@ typedef unsigned long in_addr_t;
/* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1
/* Special Windows version of getpass() defined in io.c */ #define HAVE_GETPASS 1
/* Name of package */-#define PACKAGE PRODUCT_UNIX_NAME+#define PACKAGE "openvpn"
/* Define to the address where bug reports for this package should be sent. */ //#define PACKAGE_BUGREPORT "openvpn-users@lists.sourceforge.net"
/* Define to the full name of this package. */-#define PACKAGE_NAME PRODUCT_NAME+#define PACKAGE_NAME "OpenVPN"
/* Define to the one symbol short name of this package. */-#define PACKAGE_TARNAME PACKAGE+#define PACKAGE_TARNAME "openvpn"
/* Define to the version of this package. */-#define PACKAGE_VERSION PRODUCT_VERSION+#define PACKAGE_VERSION "2.1_rc7"
/* Define to the full name and version of this package. */ #ifdef DEBUG_LABEL-#define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION " " DEBUG_LABEL+#define PACKAGE_STRING "OpenVPN " PACKAGE_VERSION " " DEBUG_LABEL #else-#define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION+#define PACKAGE_STRING "OpenVPN " PACKAGE_VERSION #endif
/* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void
/* The size of a `unsigned int', as computed by sizeof. */ #define SIZEOF_UNSIGNED_INT 4
diff -u8rp openvpn-2.1_rc7.orig/tap-win32/common.h openvpn-2.1_rc7/tap-win32/common.h--- openvpn-2.1_rc7.orig/tap-win32/common.h Thu Jan 24 00:38:40 2008+++ openvpn-2.1_rc7/tap-win32/common.h Mon May 5 01:21:24 2008@@ -27,17 +27,17 @@ */
//=============================================== // This file is included both by OpenVPN and // the TAP-Win32 driver and contains definitions // common to both. //===============================================
-#include "../autodefs/defs.h"+#define PRODUCT_TAP_ID "tap0901" //============= // TAP IOCTLs //=============
#define TAP_CONTROL_CODE(request,method) \ CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS)
|
|
回复:vc6 编译openvpn 2.1 原创空间, 文章收藏, 软件技术, 电脑与网络
fugq0ff(游客)发表评论于2010/6/3 22:14:39 |
你好请问一下我编译好了后 在连接的时候出现了错误 请问怎么解决 是那里的问题 g 10.0.8.6 10.0.8.5' Wed Jun 02 19:56:31 2010 OPTIONS IMPORT: timers and/or timeouts modified Wed Jun 02 19:56:31 2010 OPTIONS IMPORT: --ifconfig/up options modified Wed Jun 02 19:56:31 2010 OPTIONS IMPORT: route options modified Wed Jun 02 19:56:31 2010 WARNING: Since you are using --dev tap, the second argu ment to --ifconfig must be a netmask, for example something like 255.255.255.0. (silence this warning with --ifconfig-nowarn) Wed Jun 02 19:56:31 2010 ROUTE default_gateway=192.168.0.1 Wed Jun 02 19:56:31 2010 OpenVPN ROUTE: OpenVPN needs a gateway parameter for a --route option and no default was specified by either --route-gateway or --ifcon fig options Wed Jun 02 19:56:31 2010 OpenVPN ROUTE: failed to parse/resolve route for host/n etwork: 0.0.0.0 Wed Jun 02 19:56:31 2010 OpenVPN ROUTE: OpenVPN needs a gateway parameter for a --route option and no default was specified by either --route-gateway or --ifcon fig options Wed Jun 02 19:56:31 2010 OpenVPN ROUTE: failed to parse/resolve route for host/n etwork: 10.0.8.1 Wed Jun 02 19:56:31 2010 Error opening registry key: SYSTEM\CurrentControlSet\Co ntrol\Class\{4D36E972-E325-11CE-BFC1-08002BE10318} Wed Jun 02 19:56:31 2010 Exiting |
|
回复:vc6 编译openvpn 2.1 原创空间, 文章收藏, 软件技术, 电脑与网络
aside(游客)发表评论于2010/3/20 11:57:47 |
请问你用什么版本的ddk编译的TAP-win32,具体修改了哪些文件?请指教qingl6@gmail.com |
|
» 1 »
|