Antonio - dll2lib para MSVC

Antonio - dll2lib para MSVC

Postby Rossine » Mon Mar 09, 2009 3:19 pm

Olá Antonio,

Como converto uma .DLL em uma .LIB usando MSVC ?

Montei um fluxo como está abaixo. A .lib é gerada mas as funções não estão sendo inclusas na .lib.

Code: Select all  Expand view  RUN

@echo off

if NOT EXIST %1.dll GOTO :NOEXIST

lib /def:%1.dll /out:%1.lib
GOTO OK

:NOEXIST
ECHO Connot find %1.dll
GOTO EXIT

:OK
ECHO Build %1.LIB ok!

:EXIT
 
Obrigado, Regards, Saludos

Rossine.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Re: Antonio - dll2lib para MSVC

Postby Antonio Linares » Thu Mar 12, 2009 8:03 am

Rossine,

Code: Select all  Expand view  RUN

impdef.exe %1.def %1.dll
lib.exe /def:%1.def
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio - dll2lib para MSVC

Postby Rossine » Thu Mar 12, 2009 9:08 pm

Olá Antonio,

Ao tentar converter a grfinger.dll me é retornado estes erros:

Code: Select all  Expand view  RUN

grfing.obj : error LNK2019: unresolved external symbol __imp__GrInitialize@0 referenced in function _HB_FUN_GRINITIALIZE
grfing.obj : error LNK2019: unresolved external symbol __imp__GrFinalize@0 referenced in function _HB_FUN_GRFINALIZE
grfing.obj : error LNK2019: unresolved external symbol __imp__GrCapInitialize@4 referenced in function _HB_FUN_INITIALIZEGRCAP
grfing.obj : error LNK2019: unresolved external symbol __imp__GrCapStopCapture@4 referenced in function _StatusEventHandler@8
grfing.obj : error LNK2019: unresolved external symbol __imp__GrCapStartCapture@12 referenced in function _StatusEventHandler@8
grfing.obj : error LNK2019: unresolved external symbol __imp__GrExtract@28 referenced in function _ImageEventHandler@20
grfing.obj : error LNK2019: unresolved external symbol __imp__GrCapFinalize@0 referenced in function _HB_FUN_GRCAPFINALIZE
grfing.obj : error LNK2019: unresolved external symbol __imp__GrIdentifyPrepare@8 referenced in function _HB_FUN_GRIDENTIFYPREPARE
grfing.obj : error LNK2019: unresolved external symbol __imp__GrIdentify@12 referenced in function _HB_FUN_GRIDENTIFY
grfing.obj : error LNK2019: unresolved external symbol __imp__GrVerify@16 referenced in function _HB_FUN_GRVERIFY
grfing.obj : error LNK2019: unresolved external symbol __imp__GrCapSaveRawImageToFile@20 referenced in function _HB_FUN_GRCAPSAVERAWIMAGETOFILE
 


O que fazer ?
Obrigado, Regards, Saludos

Rossine.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Re: Antonio - dll2lib para MSVC

Postby Antonio Linares » Thu Mar 12, 2009 11:10 pm

Rossine,

Por favor muestra aqui el contenido de grfinger.def, gracias
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio - dll2lib para MSVC

Postby Rossine » Fri Mar 13, 2009 12:57 pm

Olá Antonio,

Segue o GRFINGER.DEF gerado:

Code: Select all  Expand view  RUN

LIBRARY     GRFINGER.DLL

EXPORTS
    GrBiometricDisplay            = _GrBiometricDisplay@32              
    GrCapAddPlugin                = _GrCapAddPlugin@4                  
    GrCapFinalize                 = _GrCapFinalize@0                    
    GrCapInitialize               = _GrCapInitialize@4                  
    GrCapLoadImageFromFile        = _GrCapLoadImageFromFile@8          
    GrCapRawImageToHandle         = _GrCapRawImageToHandle@20          
    GrCapSaveRawImageToFile       = _GrCapSaveRawImageToFile@20        
    GrCapStartCapture             = _GrCapStartCapture@12              
    GrCapStopCapture              = _GrCapStopCapture@4                
    GrCreateContext               = _GrCreateContext@4                  
    GrDestroyContext              = _GrDestroyContext@4                
    GrExtract                     = _GrExtract@28                      
    GrFinalize                    = _GrFinalize@0                      
    GrGetGrFingerVersion          = _GrGetGrFingerVersion@8            
    GrGetIdentifyParameters       = _GrGetIdentifyParameters@12        
    GrGetVerifyParameters         = _GrGetVerifyParameters@12          
    GrIdentify                    = _GrIdentify@12                      
    GrIdentifyPrepare             = _GrIdentifyPrepare@8                
    GrInitialize                  = _GrInitialize@0                    
    GrSetBiometricDisplayColors   = _GrSetBiometricDisplayColors@24      
    GrSetIdentifyParameters       = _GrSetIdentifyParameters@12        
    GrSetVerifyParameters         = _GrSetVerifyParameters@12          
    GrVerify                      = _GrVerify@16                        
 
Obrigado, Regards, Saludos

Rossine.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Re: Antonio - dll2lib para MSVC

Postby Antonio Linares » Sat Mar 14, 2009 12:42 am

Rossine,

"The __imp_ prefix is used for symbols declared __declspec(dllimport). This
method provides a slightly more efficient access mechanism. It sounds like
you're compiling to use some DLL but not linking with that DLL's .lib file."

http://www.tech-archive.net/Archive/VC/ ... /0135.html

Whats the contents of GRFINGER.h ?
How are you declaring those functions from your C code ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio - dll2lib para MSVC

Postby Rossine » Sat Mar 14, 2009 2:36 pm

Olá Antonio,

Este é o conteúdo de grfinger.h:

Code: Select all  Expand view  RUN

/******************************************************
 *                                                    *
 *                  GrFinger 4.2 SDK                  *
 *       GrFinger Biometric Fingerprint Library       *
 *                                                    *
 * GrFinger.h                                         *
 * C++ Header file for GrFinger Library               *
 *                                                    *
 * Copyright (c) 2004-2006 Griaule Tecnologia LTDA.   *
 *                                                    *
 * Last Modified: 2006-05-23 Revision: 3              *
 *                                                    *
 ******************************************************/


#ifndef H_B1G0D9DJ4D
   #define H_B1G0D9DJ4D
   #include "windows.h"
   
   // Compilador >= XHB_09960 or HB_462
   //#define HB_NEW_PUSH_SYMBOL
   #define GR_LOG                                     -999
   
   //*****************************************************
   //RETURN CODES
   //*****************************************************
   //success
   #define GR_OK                                         0
   #define GR_BAD_QUALITY                                0
   #define GR_MEDIUM_QUALITY                             1
   #define GR_HIGH_QUALITY                               2
   #define GR_MATCH                                      1
   #define GR_NOT_MATCH                                  0
   #define GR_DEFAULT_USED                               3
   //initialization errors codes
   #define GR_ERROR_INITIALIZE_FAIL                     -1
   #define GR_ERROR_NOT_INITIALIZED                     -2
   #define GR_ERROR_FAIL_LICENSE_READ                   -3
   #define GR_ERROR_NO_VALID_LICENSE                    -4
   #define GR_ERROR_NULL_ARGUMENT                       -5
   #define GR_ERROR_FAIL                                -6
   #define GR_ERROR_ALLOC                               -7
   #define GR_ERROR_PARAMETERS                          -8
   //extract and match errors codes
   #define GR_ERROR_WRONG_USE                         -107
   #define GR_ERROR_EXTRACT                           -108
   #define GR_ERROR_SIZE_OFF_RANGE                    -109
   #define GR_ERROR_RES_OFF_RANGE                     -110
   #define GR_ERROR_CONTEXT_NOT_CREATED               -111
   #define GR_ERROR_INVALID_CONTEXT                   -112
   #define GR_ERROR_ERROR                             -113
   #define GR_ERROR_NOT_ENOUGH_SPACE                  -114
   //capture error codes
   #define GR_ERROR_CONNECT_SENSOR                    -201
   #define GR_ERROR_CAPTURING                         -202
   #define GR_ERROR_CANCEL_CAPTURING                  -203
   #define GR_ERROR_INVALID_ID_SENSOR                 -204
   #define GR_ERROR_SENSOR_NOT_CAPTURING              -205
   #define GR_ERROR_INVALID_EXT                       -206
   #define GR_ERROR_INVALID_FILENAME                  -207
   #define GR_ERROR_INVALID_FILETYPE                  -208
   #define GR_ERROR_SENSOR                            -209
   
   //*****************************************************
   //CONSTS
   //*****************************************************
   //file format codes
   #define GRCAP_IMAGE_FORMAT_BMP                      501
   //event values codes
   #define GR_PLUG                                      21
   #define GR_UNPLUG                                    20
   #define GR_FINGER_DOWN                               11
   #define GR_FINGER_UP                                 10
   #define GR_IMAGE                                     30
   //image consts
   #define GR_DEFAULT_RES                              500
   #define GR_DEFAULT_DIM                              500
   #define GR_MAX_SIZE_TEMPLATE                      10000
   #define GR_MAX_IMAGE_WIDTH                         1280
   #define GR_MAX_IMAGE_HEIGHT                        1280
   #define GR_MAX_RESOLUTION                          1000 /*DPI*/
   #define GR_MIN_IMAGE_WIDTH                           50
   #define GR_MIN_IMAGE_HEIGHT                          50
   #define GR_MIN_RESOLUTION                           125 /*DPI*/
   //match const
   #define GR_MAX_THRESHOLD                            200
   #define GR_MIN_THRESHOLD                             10
   #define GR_VERYLOW_FRR                               30 /*FAR 1 IN 1000*/
   #define GR_LOW_FRR                                   45 /*FAR 1 IN 10000*/
   #define GR_LOW_FAR                                   60 /*FAR 1 IN 30000*/
   #define GR_VERYLOW_FAR                               80 /*FAR 1 IN 300000*/
   #define GR_ROT_MIN                                    0
   #define GR_ROT_MAX                                  180
   //context const
   #define GR_DEFAULT_CONTEXT                            0
   #define GR_NO_CONTEXT                                -1
   //colors for BiometricDisplay
   #define GR_IMAGE_NO_COLOR                    0x1FFFFFFF
   //version constants
   #define GRFINGER_FULL                                 1
   #define GRFINGER_LIGHT                                2
   #define GRFINGER_FREE                                 3
   
   //*****************************************************
   //TYPE DEFINITIONS
   //*****************************************************
   #define DLLIMPORT __declspec(dllimport) int __stdcall
   #define CALLBACK __stdcall
   
   typedef int GRCAP_STATUS_EVENTS;
   typedef int GRCAP_FINGER_EVENTS;
   typedef int GRCAP_IMAGE_FORMAT;
   typedef long BITMAP_HANDLE;
   
   //CALLBACK functions
   typedef void CALLBACK GRCAP_STATUS_EVENT_PROC(char* idSensor, GRCAP_STATUS_EVENTS event);
   typedef void CALLBACK GRCAP_FINGER_EVENT_PROC(char* idSensor, GRCAP_FINGER_EVENTS event);
   typedef void CALLBACK GRCAP_IMAGE_EVENT_PROC(char* idSensor, unsigned int width, unsigned int height, unsigned char* rawImage, int res);
   
   //*****************************************************
   // Functions - CAPTURE
   //*****************************************************
   DLLIMPORT
   GrCapInitialize(GRCAP_STATUS_EVENT_PROC *StatusEventHandler);
   
   DLLIMPORT
   GrCapFinalize();
   
   DLLIMPORT
   GrCapStartCapture(char* idSensor, GRCAP_FINGER_EVENT_PROC *FingerEventHandler, GRCAP_IMAGE_EVENT_PROC *ImageEventHandler);
   
   DLLIMPORT
   GrCapStopCapture(char* idSensor);
   
   DLLIMPORT
   GrCapSaveRawImageToFile(unsigned char* rawImage, unsigned int width, unsigned int height, char* fileName, GRCAP_IMAGE_FORMAT imageFormat);
   
   DLLIMPORT
   GrCapLoadImageFromFile(char* fileName, int res);
   
//   DLLIMPORT
//   GrCapRawImageToHandle(unsigned char* rawImage, unsigned int width, unsigned int height, HDC hdc, HBITMAP &handle);
   
// DLLIMPORT
// GrBiometricDisplay(char* tptQuery, unsigned char* rawImage, int width, int height, int res, HDC hdc, HBITMAP &handle, int matchContext);

   //*****************************************************
   // Functions - EXTRACT
   //*****************************************************
   DLLIMPORT
   GrExtract(unsigned char *rawimage, int width, int height, int res, char *tpt, int *tptSize, int context);
   
   //*****************************************************
   // Functions - MATCH
   //*****************************************************
   DLLIMPORT
   GrInitialize();
   
   DLLIMPORT
   GrFinalize();
   
   DLLIMPORT
   GrCreateContext (int *contextId);
   
   DLLIMPORT
   GrDestroyContext (int contextId);
   
   DLLIMPORT
   GrVerify (char *queryTemplate, char *referenceTemplate, int *verifyScore, int context);
   
   DLLIMPORT
   GrIdentifyPrepare (char *templateQuery, int context);
   
   DLLIMPORT
   GrIdentify (char *templateReference, int *identifyScore, int context);
   
   //*****************************************************
   // Functions - CONFIG
   //*****************************************************
   DLLIMPORT
   GrSetIdentifyParameters (int identifyThreshold, int identifyRotationTolerance, int context);
   
   DLLIMPORT
   GrSetVerifyParameters (int verifyThreshold, int verifyRotationTolerance, int context);
   
//   DLLIMPORT
//   GrGetIdentifyParameters(int &identifyThreshold, int &identifyRotationTolerance, int context);
   
//   DLLIMPORT
//   GrGetVerifyParameters(int &verifyThreshold, int &verifyRotationTolerance, int context);
   
   DLLIMPORT
   GrSetBiometricDisplayColors(int minutiaeColor, int minutiaeMatchedColor, int segmentColor, int segmentMatchedColor, int directionColor, int directionMatchedColor);
   
   DLLIMPORT
   GrGetGrFingerVersion(unsigned char *majorRelease, unsigned char *minorRelease);
#endif
 
Obrigado, Regards, Saludos

Rossine.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Re: Antonio - dll2lib para MSVC

Postby Antonio Linares » Sat Mar 14, 2009 3:59 pm

Rossine,

Please replace in grfinger.h:

#define DLLIMPORT __declspec(dllimport) int __stdcall

with:

#define DLLIMPORT int __stdcall

and try it again, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio - dll2lib para MSVC

Postby Rossine » Sat Mar 14, 2009 7:15 pm

Olá Antonio,

Trocando:

#define DLLIMPORT __declspec(dllimport) int __stdcall

por:

#define DLLIMPORT int __stdcall

São gerados os seguintes erros:

Code: Select all  Expand view  RUN

grfing.obj : error LNK2019: unresolved external symbol _GrInitialize@0 referenced in function _HB_FUN_GRINITIALIZE
grfing.obj : error LNK2019: unresolved external symbol _GrFinalize@0 referenced in function _HB_FUN_GRFINALIZE
grfing.obj : error LNK2019: unresolved external symbol _GrCapInitialize@4 referenced in function _HB_FUN_INITIALIZEGRCAP
grfing.obj : error LNK2019: unresolved external symbol _GrCapStopCapture@4 referenced in function _StatusEventHandler@8
grfing.obj : error LNK2019: unresolved external symbol _GrCapStartCapture@12 referenced in function _StatusEventHandler@8
grfing.obj : error LNK2019: unresolved external symbol _GrExtract@28 referenced in function _ImageEventHandler@20
grfing.obj : error LNK2019: unresolved external symbol _GrCapFinalize@0 referenced in function _HB_FUN_GRCAPFINALIZE
grfing.obj : error LNK2019: unresolved external symbol _GrIdentifyPrepare@8 referenced in function _HB_FUN_GRIDENTIFYPREPARE
grfing.obj : error LNK2019: unresolved external symbol _GrIdentify@12 referenced in function _HB_FUN_GRIDENTIFY
grfing.obj : error LNK2019: unresolved external symbol _GrVerify@16 referenced in function _HB_FUN_GRVERIFY
grfing.obj : error LNK2019: unresolved external symbol _GrCapSaveRawImageToFile@20 referenced in function _HB_FUN_GRCAPSAVERAWIMAGETOFILE
 
Obrigado, Regards, Saludos

Rossine.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Re: Antonio - dll2lib para MSVC

Postby Antonio Linares » Sat Mar 14, 2009 9:18 pm

Rossine,

Estas compilando con MSVC ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio - dll2lib para MSVC

Postby Rossine » Sun Mar 15, 2009 2:55 pm

Olá Antonio,

Sim, estou usando harbour + msvc. Abaixo te mostro meu fluxo de compilação:

Code: Select all  Expand view  RUN

@ECHO OFF
CLS
ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ³ FiveWin for Harbour 9.01 (MSVC++) Jan. 2009      Harbour development power ³Ü
ECHO ³ (c) FiveTech, 1993-2009     for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7 ³Û
ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß

if exist *.exp del *.exp
if exist *.ppo del *.ppo
rem if exist *.c   del *.c  
if exist *.obj del *.obj

call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86

if "%CC_DIR%"  == "" set CC_DIR=%ProgramFiles%\Microsoft Visual Studio 9.0\VC
if "%SDK_DIR%" == "" set SDK_DIR=%ProgramFiles%\Microsoft SDKs\Windows\v6.0A
if "%HBDIR%"   == "" set HBDIR=c:\harbour

SET INCLUDE=C:\Arquivos de programas\Microsoft Visual Studio 9.0\VC\include;C:\Arquivos de programas\Microsoft SDKs\Windows\v6.0A\include;c:\harbour\include;C:\FWH\INCLUDE

ECHO Compiling...

if exist %HBDIR%\bin\harbour.exe    set hdir=%HBDIR%\bin
if exist %HBDIR%\bin\vc\harbour.exe set hdir=%HBDIR%\bin\vc

if exist %HBDIR%\lib\hbvm.lib       set hdirl=%HBDIR%\lib
if exist %HBDIR%\lib\vc\hbvm.lib    set hdirl=%HBDIR%\lib\vc

SET INCLUDE=C:\Arquivos de programas\Microsoft Visual Studio 9.0\VC\include;C:\Arquivos de programas\Microsoft SDKs\Windows\v6.0A\include;c:\harbour\include;C:\FWH\INCLUDE

cls

"%hdir%\harbour" teste /n /i..\include;%HBDIR%\include /w /p %2 %3 > comp.log
IF ERRORLEVEL 1 GOTO COMPILEERROR

"%CC_DIR%\bin\cl" -TC -W3 -c /GA teste.c > comp.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
rem pause
cls

:ENDCOMPILE

"%hdir%\harbour" GRFINGER /n /i..\include;%HBDIR%\include /w /p %2 %3 > comp.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
"%CC_DIR%\bin\cl" -TC -W3 -c /GA GRFINGER.c > comp.log
IF ERRORLEVEL 1 GOTO COMPILEERROR

cls
rem pause
"%CC_DIR%\bin\cl" -TC -W3 -c GRFING.C > comp.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
rem pause

echo "teste.obj"      > msvc.tmp
echo "grfinger.obj"    >> msvc.tmp
echo "grfing.obj"    >> msvc.tmp
echo "\fwh\lib\FiveHCM.lib"  >> msvc.tmp
echo "\fwh\lib\FiveHM.lib"  >> msvc.tmp
echo "%hdirl%\xhb.lib"  >> msvc.tmp
echo "%hdirl%\hbrtl.lib"  >> msvc.tmp
echo "%hdirl%\hbvm.lib"  >> msvc.tmp
echo "%hdirl%\gtgui.lib"  >> msvc.tmp
echo "%hdirl%\hblang.lib"  >> msvc.tmp
echo "%hdirl%\hbmacro.lib"  >> msvc.tmp
echo "%hdirl%\hbrdd.lib"  >> msvc.tmp
echo "%hdirl%\rddntx.lib"  >> msvc.tmp
echo "%hdirl%\rddcdx.lib"  >> msvc.tmp
echo "%hdirl%\rddfpt.lib"  >> msvc.tmp
echo "%hdirl%\hbsix.lib"  >> msvc.tmp
echo "%hdirl%\hbdebug.lib"  >> msvc.tmp
echo "%hdirl%\hbcommon.lib"  >> msvc.tmp
echo "%hdirl%\hbpp.lib"  >> msvc.tmp
echo "%hdirl%\hbcpage.lib"  >> msvc.tmp
echo "%hdirl%\hbwin.lib"  >> msvc.tmp
echo "%hdirl%\hbole.lib"  >> msvc.tmp
echo "%hdirl%\hbcplr.lib"  >> msvc.tmp
echo "grfinger.lib"  >> msvc.tmp

echo "%CC_DIR%\lib\libcmt.lib"     >> msvc.tmp
echo "%SDK_DIR%\lib\oledlg.lib"     >> msvc.tmp
echo "%SDK_DIR%\lib\ole32.lib"     >> msvc.tmp
echo "%SDK_DIR%\lib\oleaut32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\kernel32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\user32.lib"    >> msvc.tmp
echo "%SDK_DIR%\lib\gdi32.lib"     >> msvc.tmp
echo "%SDK_DIR%\lib\winspool.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\comctl32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\comdlg32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\advapi32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\shell32.lib"   >> msvc.tmp
echo "%SDK_DIR%\lib\ole32.lib"     >> msvc.tmp
echo "%SDK_DIR%\lib\oleaut32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\uuid.lib"      >> msvc.tmp
echo "%SDK_DIR%\lib\odbc32.lib"    >> msvc.tmp
echo "%SDK_DIR%\lib\odbccp32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\iphlpapi.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\mpr.lib"       >> msvc.tmp
echo "%SDK_DIR%\lib\version.lib"   >> msvc.tmp
echo "%SDK_DIR%\lib\wsock32.lib"   >> msvc.tmp
echo "%SDK_DIR%\lib\msimg32.lib"   >> msvc.tmp

"%CC_DIR%\bin\link" @msvc.tmp /NODEFAULTLIB:LIBC.LIB /nologo /subsystem:windows /force:multiple /NODEFAULTLIB:libcmt > LINKERR.LOG

IF ERRORLEVEL 1 GOTO LINKERROR

cls
ECHO *** teste.EXE criado com sucesso ***
rem pause
GOTO EXIT

ECHO

rem delete temporary files
@del teste.c
@del msvc.tmp

:COMPILEERROR
rem pause
CLS
@QED comp.log
ECHO * Compiling errors *
GOTO EXIT

:LINKERROR
ECHO * Linking errors *
QED LINKERR.LOG
GOTO EXIT

:SINTAX
ECHO    SYNTAX: Build [Program]     {-- No especifiques la extensi¢n PRG
ECHO                                {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO The specified PRG teste does not exist

:EXIT

@if exist *.exp del *.exp
@if exist *.ppo del *.ppo
rem @if exist *.c   del *.c  
@if exist *.obj del *.obj


...e meu fluxo (DLL2LIB.BAT) para converte DLL para LIB, neste caso a GRFINGER.LIB:

Code: Select all  Expand view  RUN

@echo off

if "%1" == "" goto help

if not exist %1.dll goto notfound

rem pexports.exe %1 > _temp_.def
impdef.exe %1.def %1.dll

if errorlevel 1 goto errodef

del %1.lib

lib /def:%1.def

if errorlevel 1 echo Error creating .LIB...

goto fim

:help
echo Usage: dll2lib input.dll [output.lib]
goto fim

:notfound
echo ERROR: File not found "%1"
goto fim

:errodef
echo Error extracting .DEF...
goto fim

:fim
 
Obrigado, Regards, Saludos

Rossine.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests