DLL
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
This is the result:Antonio Linares wrote:Maurizio,
Try it this way:
c:\vce\bin\link /IMPLIB:rchglobe.dll /OUT:rchglobe.lib
EMGMicrosoft (R) Incremental Linker Version 6.24.3077
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : warning LNK4001: no object files specified; libraries used
LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
LINK : fatal error LNK1561: entry point must be defined
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Thank Antonio and Enrico
Now I have the LIB , and I cann link it without problem .
I try this function
#pragma BEGINDUMP
#include <hbapi.h>
HB_FUNC( RCHSENDDATA )
{
hb_retnl( RCHSendData( hb_parc( 1 ), hb_parc( 2 ) ) );
}
#pragma ENDDUMP
But I have this error :
RCH.obj : error LNK2019: unresolved external symbol "int __cdecl RCHOpen(void)" (?RCHOpen@@YAHXZ) referenced in function "void __cdecl HB_FUN_RCHOpen(void)" (?HB_FUN_RCHOpen@@YAXXZ)
RCH.exe : fatal error LNK1120: 1 unresolved externals
//---------------------------------------------------------------------------
I Try this function
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
int RCHOpen( void );
HB_FUNC( RCHOpen )
{
hb_retnl( RCHOpen() );
}
#pragma ENDDUMP
Creating library RCH.lib and object RCH.exp
RCH.obj : error LNK2019: unresolved external symbol "int __cdecl RCHOpen(void)" (?RCHOpen@@YAHXZ) referenced in function "void __cdecl HB_FUN_RCHOpen(void)" (?HB_FUN_RCHOpen@@YAXXZ)
RCH.exe : fatal error LNK1120: 1 unresolved externals
What is my error ?
Regards MAurizio
Now I have the LIB , and I cann link it without problem .
I try this function
#pragma BEGINDUMP
#include <hbapi.h>
HB_FUNC( RCHSENDDATA )
{
hb_retnl( RCHSendData( hb_parc( 1 ), hb_parc( 2 ) ) );
}
#pragma ENDDUMP
But I have this error :
RCH.obj : error LNK2019: unresolved external symbol "int __cdecl RCHOpen(void)" (?RCHOpen@@YAHXZ) referenced in function "void __cdecl HB_FUN_RCHOpen(void)" (?HB_FUN_RCHOpen@@YAXXZ)
RCH.exe : fatal error LNK1120: 1 unresolved externals
//---------------------------------------------------------------------------
I Try this function
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
int RCHOpen( void );
HB_FUNC( RCHOpen )
{
hb_retnl( RCHOpen() );
}
#pragma ENDDUMP
Creating library RCH.lib and object RCH.exp
RCH.obj : error LNK2019: unresolved external symbol "int __cdecl RCHOpen(void)" (?RCHOpen@@YAHXZ) referenced in function "void __cdecl HB_FUN_RCHOpen(void)" (?HB_FUN_RCHOpen@@YAXXZ)
RCH.exe : fatal error LNK1120: 1 unresolved externals
What is my error ?
Regards MAurizio
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Maurizio,
You have to include this in your code before your HB_FUNC()s:
You have to include this in your code before your HB_FUNC()s:
Code: Select all
extern "C" {
LONG RCHSendData( LPSTR, LPSTR );
LONG RCHOpen( void );
LONG RCHClose( void );
}
Thank Antonio
Now I have this error
RCH.prg(317) : error C2556: 'int __cdecl RCHOpen(void)' : overloaded function di
ffers only by return type from 'long __cdecl RCHOpen(void)'
RCH.prg(309) : see declaration of 'RCHOpen'
RCH.prg(317) : error C2371: 'RCHOpen' : redefinition; different basic types
RCH.prg(309) : see declaration of 'RCHOpen'
RCH.prg(324) : error C2556: 'int __cdecl RCHOpen(void)' : overloaded function di
ffers only by return type from 'long __cdecl RCHOpen(void)'
RCH.prg(309) : see declaration of 'RCHOpen'
NMAKE : fatal error U1077: 'c:\vce\bin\clarm' : return code '0x2'
---------------------------------------------------------------------------
This is the source
#pragma BEGINDUMP
#include <Windows.h>
#include <hbapi.h>
extern "C" {
LONG RCHSendData( LPSTR, LPSTR );
LONG RCHOpen( void );
LONG RCHClose( void );
}
HB_FUNC(RCHSENDDATA)
{
hb_retnl(RCHSendData(hb_parc(1),hb_parc(2)));
}
int RCHOpen( void );
HB_FUNC( RCHOpen )
{
hb_retnl( RCHOpen() );
}
int RCHOpen( void );
HB_FUNC( RCHOClose )
{
hb_retnl( RCHOpen() );
}
#pragma ENDDUMP
Now I have this error
RCH.prg(317) : error C2556: 'int __cdecl RCHOpen(void)' : overloaded function di
ffers only by return type from 'long __cdecl RCHOpen(void)'
RCH.prg(309) : see declaration of 'RCHOpen'
RCH.prg(317) : error C2371: 'RCHOpen' : redefinition; different basic types
RCH.prg(309) : see declaration of 'RCHOpen'
RCH.prg(324) : error C2556: 'int __cdecl RCHOpen(void)' : overloaded function di
ffers only by return type from 'long __cdecl RCHOpen(void)'
RCH.prg(309) : see declaration of 'RCHOpen'
NMAKE : fatal error U1077: 'c:\vce\bin\clarm' : return code '0x2'
---------------------------------------------------------------------------
This is the source
#pragma BEGINDUMP
#include <Windows.h>
#include <hbapi.h>
extern "C" {
LONG RCHSendData( LPSTR, LPSTR );
LONG RCHOpen( void );
LONG RCHClose( void );
}
HB_FUNC(RCHSENDDATA)
{
hb_retnl(RCHSendData(hb_parc(1),hb_parc(2)));
}
int RCHOpen( void );
HB_FUNC( RCHOpen )
{
hb_retnl( RCHOpen() );
}
int RCHOpen( void );
HB_FUNC( RCHOClose )
{
hb_retnl( RCHOpen() );
}
#pragma ENDDUMP
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Maurizio,
Remove these lines from your code:
Remove these lines from your code:
Code: Select all
// int RCHOpen( void ); this!
HB_FUNC( RCHOpen )
{
hb_retnl( RCHOpen() );
}
// int RCHOpen( void ); this!
HB_FUNC( RCHOClose )
{
hb_retnl( RCHOpen() );
}
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Wow !!
Finally, thanks to your help the link to the LIB works.
Many, many thanks to Antonio and Enrico for your assistance.
The strange thing is that when I linked the LIB and inserted the code to
call the functions in the LIB, the calls to the DLL now works.
This might explain the reason why the calls to the DLL did not work before?
Maurizio
Finally, thanks to your help the link to the LIB works.
Many, many thanks to Antonio and Enrico for your assistance.
The strange thing is that when I linked the LIB and inserted the code to
call the functions in the LIB, the calls to the DLL now works.
This might explain the reason why the calls to the DLL did not work before?
Maurizio