MSVC 2017 Try

Re: MSVC 2017 Try

Postby Verhoven » Sun Apr 16, 2017 4:20 pm

Estos son los errores:

wintpv.obj : error LNK2019: símbolo externo "struct _iobuf * __cdecl hb_fopen(char const *,char const *)" (?hb_fopen@@YAPEAU_iobuf@@PEBD0@Z) sin resolver al que se hace referencia en la función HB_FUN_FTP_DIR2DIRFTP

FiveHC64.lib(FWPNG.obj) : error LNK2019: símbolo externo png_init_io sin resolver al que se hace referencia en la función save_png_to_file

wintpv_64.EXE : fatal error LNK1120: 2 externos sin resolver
* Linking errors *


La instrucción para compilar es con el flag para C++, es decir, -TP:

cl -TP -W3 -O2 -c -I%hdir%\include %1.c
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: MSVC 2017 Try

Postby Antonio Linares » Sun Apr 16, 2017 7:10 pm

Copia aqui el código de la función FTP_DIR2DIRFTP()
regards, saludos

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

Re: MSVC 2017 Try

Postby Verhoven » Sun Apr 16, 2017 7:53 pm

Este es el código C de esa función:

Code: Select all  Expand view
/* Imprime en un fichero un listado con solo los nombres de archivos en un servidor FTP.
   Además devuelve el último nombre del listado obtenido.
   Salida a DIRFTP.DAT: Lista simple, solo con el nombre de los ficheros presentes en
     el directorio FTP.*/

HB_FUNC( FTP_DIR2DIRFTP )  
{   
    WIN32_FIND_DATA ultdir;
    WIN32_FIND_DATA dirtemp;
    HINTERNET FtpHandle;
   
    FILE *fichero = hb_fopen( "DIRFTP.DAT", "w" );  //FILE *fichero= fopen( "DIRFTP.DAT", "w" );

    FtpHandle = FtpFindFirstFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), &dirtemp, hb_parnl( 3 ), hb_parnl( 4 ) ) ;
   
    if ( FtpHandle ) {
           ultdir = dirtemp;
           
           if( fichero ) {
            //fprintf( fichero, "%s\t%X\t%X\n", ultdir.cFileName, ultdir.ftLastWriteTime.dwHighDateTime, ultdir.ftLastWriteTime.dwLowDateTime );
            fprintf( fichero, "%s\n", ultdir.cFileName );
           }
           
           // Sigue buscando por el directorio FTP
           while ( InternetFindNextFile( FtpHandle, &dirtemp ) ) {
            ultdir = dirtemp;
            if( fichero ) {
               //fprintf( fichero, "%s\t%X\t%X\n", dirtemp.cFileName, dirtemp.ftLastWriteTime.dwHighDateTime, dirtemp.ftLastWriteTime.dwLowDateTime );
               fprintf( fichero, "%s\n", ultdir.cFileName );
            }
           }
           
           // Devuelve al PRG el nombre del último fichero creado/modificado en el directorio FTP.
           hb_retc( ultdir.cFileName );
         }
      else
         //MessageBox( GetActiveWindow(), "No ha encontrado ningún fichero", "Cero Ficheros", 0x40 );
         hb_retc( "" );
         
    InternetCloseHandle( FtpHandle );
    if( fichero ) {
     fclose(fichero);
    }
}
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: MSVC 2017 Try

Postby Antonio Linares » Sun Apr 16, 2017 9:31 pm

Añade estas líneas antes de HB_FUNC( FTP_DIR2DIRFTP )

extern "C" {
struct _iobuf * hb_fopen( char const *, char const * );
}
regards, saludos

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

Re: MSVC 2017 Try

Postby Verhoven » Mon Apr 17, 2017 8:52 am

El compilador sigue sin estar de acuerdo, estos son los errores:
La línea 526 de internet.prg es lo nuevo que me has indicado que ponga, esto es, struct _iobuf * hb_fopen(char const *, char const *);

internet.prg(526): note: vea la declaraci¢n de 'hb_fopen'
internet.prg(538): warning C4312: 'conversi¢n de tipo': conversi¢n de 'long' a 'HINTERNET' de mayor tama¤o
internet.prg(597): warning C4312: 'conversi¢n de tipo': conversi¢n de 'long' a 'HINTERNET' de mayor tama¤o
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Copyright (C) Microsoft Corporation. All rights reserved.

wintpv.obj : error LNK2019: símbolo externo "struct _iobuf * __cdecl hb_fopen(char const *,char const *)" (?hb_fopen@@YAPEAU_iobuf@@PEBD0@Z) sin resolver al que se hace referencia en la función HB_FUN_FTP_DIR2DIRFTP
FiveHC64.lib(FWPNG.obj) : error LNK2019: símbolo externo png_init_io sin resolver al que se hace referencia en la función save_png_to_file
wintpv_64.EXE : fatal error LNK1120: 2 externos sin resolver
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: MSVC 2017 Try

Postby Antonio Linares » Mon Apr 17, 2017 9:24 am

Has copiado exactamente estas líneas ?

extern "C" {
struct _iobuf * hb_fopen( char const *, char const * );
}

antes de la declaración de la función ?

Por favor, copia aqui el código
regards, saludos

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

Re: MSVC 2017 Try

Postby Antonio Linares » Mon Apr 17, 2017 9:26 am

Que ficheros de cabecera usas para el código en C ?
regards, saludos

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

Re: MSVC 2017 Try

Postby Verhoven » Mon Apr 17, 2017 2:18 pm

Son los siguientes:

Code: Select all  Expand view
// Para compilar con Borland BCC582, BCC63 y para VSC2013.
#include "warningsVSC2013.h"

#include "ws2tcpip.h"  //For WinSock 2 library: ws2_32.lib

#include "wininet.h"
#include "windows.h"

#include "hbapi.h"
#include "stdio.h"
#include "WinBase.h"
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 102 guests