Hi
For a project Iím working on I needed the PCRE library. I looked on the official site and quickly found out that there is no updated static library around to download. After spending some hours with VS9 I noticed that VS6 was a much better choice because of header dependencies. Finally I got a compiled static library that works fine with masm.

Biterider
Attachments:
Posted on 2010-10-15 09:50:59 by Biterider
After spending some hours with VS9 I noticed that VS6 was a much better choice because of header dependencies.
Hm? Haven't built a PCRE with VC16 (aka VS2010 release) yet, but for VS2003/2005/2008 it didn't take long to set up solutions for spitting out static libraries?
Posted on 2010-10-24 11:23:54 by f0dder
"Finally I got a compiled static library that works fine with masm." Yes ,I love it.haha..... Thanks!!:P
;************************************************************
;*--==--* Simple asm program to call pcre 8.1 lib.
;*--==--* By G-Spider 2010.11.28
;*--==--* Web:http://blog.csdn.net/G_Spider
;*--==--* ---------------------------------------------------
;*--==--* ml  /c /coff asmpcre.asm 
;*--==--* link /subsystem:console asmpcre.obj
;************************************************************

.386
.model flat,stdcall
option casemap:none

include windows.inc
include user32.inc
include kernel32.inc
include msvcrt.inc
include PCRE81S.inc    ;<-------

includelib user32.lib
includelib kernel32.lib
includelib msvcrt.lib
includelib PCRE81S.lib ;<-------       

OVECCOUNT      equ    30 ;/* should be a multiple of 3 */
EBUFLEN        equ    128
BUFLEN          equ    1024
;***********************************************************;
.data
       
        szSrc          db      ' href=http://blog.csdn.net/G_Spider+c%2B%2B+',0
        szPattern      db      'http://(.*)(..Spider)',0
       
        szovector      db      'szovector[]= ',0dh,0ah,0
       
        fmt1            db      'String : %s',0dh,0ah,0
        fmt2            db      'Pattern: %s',0dh,0ah,0dh,0ah,0
        fmt3            db      '%d ',0
        fmt4            db      'Return pattern string:',0dh,0ah,0
        fmt5            db      '%s',0dh,0ah,0
        szPause        db      'Pause',0
     

.data?
        _error          dd      ?
        erroffset      dd      ?
        ovector        dd      OVECCOUNT  dup(?)
        rc              dd      ?
        result          dd      ?           


;***********************************************************
.code
;-----------------------------------------------------------
start:
        invoke  crt_printf,offset fmt1,offset szSrc
        invoke  crt_printf,offset fmt2,offset szPattern
        invoke  pcre_compile,offset szPattern,0,offset _error,offset erroffset,0
        .if    eax==NULL
                invoke MessageBox,NULL,0,0,0
                ret
        .endif
        invoke  pcre_exec,eax,0,offset szSrc,sizeof szSrc,0,0,offset ovector,OVECCOUNT
        ;????????????????-1
        mov    rc,eax
        mov    edx,eax
        and    edx,80000000h
        .if    edx!=0
                invoke  crt_printf,offset fmt3,eax
                invoke  MessageBox,NULL,0,0,0
                invoke ExitProcess,0
        .endif
       
        invoke  crt_printf,offset fmt4
        xor    eax,eax ;eax=1?             
        .while  eax<rc             
                push    eax
                invoke  pcre_get_substring,offset szSrc,offset ovector,rc,eax,offset result
                invoke  crt_printf,offset fmt5,result
                pop    eax
                inc    eax

        .endw       
                ;int pcre_get_substring(const char *subject, int *ovector,
                ;int stringcount, int stringnumber,
                ;const char **stringptr)
               
        invoke  crt_printf,offset szovector
        xor    eax,eax
        .while  eax<OVECCOUNT
                push    eax
                invoke  crt_printf,offset fmt3,ovector[4*eax]
                pop    eax
                inc    eax
        .endw
             
        invoke  pcre_free,rc
        invoke  crt_system,offset szPause
invoke ExitProcess,0
end start






















Posted on 2010-11-28 06:15:55 by G-Spider