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
MSVC 2017 Try
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: MSVC 2017 Try
Copia aqui el código de la función FTP_DIR2DIRFTP()
Re: MSVC 2017 Try
Este es el código C de esa función:
Code: Select all
/* 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);
}
}
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: MSVC 2017 Try
Añade estas líneas antes de HB_FUNC( FTP_DIR2DIRFTP )
extern "C" {
struct _iobuf * hb_fopen( char const *, char const * );
}
extern "C" {
struct _iobuf * hb_fopen( char const *, char const * );
}
Re: MSVC 2017 Try
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
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: MSVC 2017 Try
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
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: MSVC 2017 Try
Que ficheros de cabecera usas para el código en C ?
Re: MSVC 2017 Try
Son los siguientes:
Code: Select all
// 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"