Maurizio,
Try it this way:
c:\vce\bin\link /IMPLIB:rchglobe.dll /OUT:rchglobe.lib
Maurizio,
Try it this way:
c:\vce\bin\link /IMPLIB:rchglobe.dll /OUT:rchglobe.lib
Antonio Linares wrote:Maurizio,
Try it this way:
c:\vce\bin\link /IMPLIB:rchglobe.dll /OUT:rchglobe.lib
Microsoft (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
The above was wrong. This should be the right way:
c:\vce\bin\lib /list:rchglobe.def rchglobe.dll
c:\vce\bin\lib /def:rchglobe.def /out:rchglobe.lib /machine:arm /subsystem:windowsce
To create the DEF file, better use Borland:
impdef.exe rchglobe.def rchglobe.dll
and then use Microsoft lib as explained
Antonio Linares wrote:To create the DEF file, better use Borland:
impdef.exe rchglobe.def rchglobe.dll
and then use Microsoft lib as explained
Enrico,
ops, I missed your command
Antonio Linares wrote:Enrico,
ops, I missed your command
Thank Antonio and Enrico
Now I have the LIB , and I cann link it without problem .
I try this function
HB_FUNC( RCHSENDDATA )
{
hb_retnl( RCHSendData( hb_parc( 1 ), hb_parc( 2 ) ) );
}
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
int RCHOpen( void );
HB_FUNC( RCHOpen )
{
hb_retnl( RCHOpen() );
}
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
It seems a name-mangling problem as if the lib was compiled in C++.
EMG
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
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() );
}
// int RCHOpen( void ); this!
HB_FUNC( RCHOpen )
{
hb_retnl( RCHOpen() );
}
// int RCHOpen( void ); this!
HB_FUNC( RCHOClose )
{
hb_retnl( RCHOpen() );
}BTW,
This is wrong:
HB_FUNC( RCHOClose )
{
hb_retnl( RCHOpen() );
}
it should be
HB_FUNC( RCHClose )
{
hb_retnl( RCHClose() );
}
Finally, please use uppercase for names HB_FUNC ( ...Uppercase!... )
i.e.:
HB_FUNC( RCHCLOSE )
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
![]()