Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Susobh S. on June 23, 2020, 11:32:55 am



Title: Migrate C-Extension to FGL 3.10 for Windows
Post by: Susobh S. on June 23, 2020, 11:32:55 am
Hi All,

Just wanted to check if anyone has prior experience in migrating C-Extensions to the latest Genero 3.10 version for Windows Environment.
There are many de-supported functions, for which i need to link the Informix ESQL/C library.
Now my source code uses contain 4 of the de-supported functions as below
risnull()
rsetnull()
dectoasc()
deccvasc()

I have followed the documentation as per below given link and tried to build the DLL file using the Informix CSDK, but still i get error that the above 4 functions are not resolved.

Below is the full command + error that i get.


esql -target:dll -o userextension.dll  g2stubs.obj cfun4gl.obj c_tests.obj c_bits.obj c_command.obj c_csrname.obj c_direct.obj c_dlfcn.obj c_errno.obj c_getenv.obj c_getprg.obj c_getpsh.obj c_math.obj c_md5.obj c_memory.obj c_process.obj c_putenv.obj c_rawio.obj c_readfile.obj c_readin.obj c_regex.obj c_run.obj c_socket.obj c_statfile.obj c_stdio.obj c_string.obj c_time.obj c_vararg.obj c_writeout.obj j_getkey.obj j_is4js.obj w_errmsg.obj wh_gets.obj pcre_chartables.obj pcre_compile.obj pcre_config.obj pcre_dfa_exec.obj pcre_exec.obj pcre_fullinfo.obj pcre_get.obj pcre_globals.obj pcre_info.obj pcre_maketables.obj pcre_newline.obj pcre_ord2utf8.obj pcre_refcount.obj pcre_study.obj pcre_tables.obj pcre_try_flipped.obj pcre_ucd.obj pcre_valid_utf8.obj pcre_version.obj pcre_xclass.obj testcpp.obj fws2ext.obj C:\Censof\FourJs\fgl\3.10.20\lib\libfgl.lib
Microsoft (R) Incremental Linker Version 14.26.28806.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-DLL -OUT:userextension.dll -MAP -SUBSYSTEM:CONSOLE g2stubs.obj cfun4gl.obj
c_tests.obj c_bits.obj c_command.obj c_csrname.obj c_direct.obj c_dlfcn.obj
c_errno.obj c_getenv.obj c_getprg.obj c_getpsh.obj c_math.obj c_md5.obj
c_memory.obj c_process.obj c_putenv.obj c_rawio.obj c_readfile.obj
c_readin.obj c_regex.obj c_run.obj c_socket.obj c_statfile.obj c_stdio.obj
c_string.obj c_time.obj c_vararg.obj c_writeout.obj j_getkey.obj j_is4js.obj
w_errmsg.obj wh_gets.obj pcre_chartables.obj pcre_compile.obj pcre_config.obj
pcre_dfa_exec.obj pcre_exec.obj pcre_fullinfo.obj pcre_get.obj
pcre_globals.obj pcre_info.obj pcre_maketables.obj pcre_newline.obj
pcre_ord2utf8.obj pcre_refcount.obj pcre_study.obj pcre_tables.obj
pcre_try_flipped.obj pcre_ucd.obj pcre_valid_utf8.obj pcre_version.obj
pcre_xclass.obj testcpp.obj fws2ext.obj
C:\Censof\FourJs\fgl\3.10.20\lib\libfgl.lib
"C:\Program Files (x86)\Informix Client-SDK\\lib\isqlt09a.lib"
"C:\Program Files (x86)\Informix Client-SDK\\lib\igl4n304.lib"
"C:\Program Files (x86)\Informix Client-SDK\\lib\iglxn304.lib"
"C:\Program Files (x86)\Informix Client-SDK\\lib\igo4n304.lib" netapi32.lib
wsock32.lib user32.lib winmm.lib advapi32.lib
   Creating library userextension.lib and object userextension.exp
c_math.obj : error LNK2019: unresolved external symbol risnull referenced in function c_srand
c_memory.obj : error LNK2001: unresolved external symbol risnull
c_socket.obj : error LNK2001: unresolved external symbol risnull
c_stdio.obj : error LNK2001: unresolved external symbol risnull
c_memory.obj : error LNK2019: unresolved external symbol deccvasc referenced in function decFromLong
c_memory.obj : error LNK2019: unresolved external symbol rsetnull referenced in function decFromPtr
c_stdio.obj : error LNK2001: unresolved external symbol rsetnull
c_memory.obj : error LNK2019: unresolved external symbol dectoasc referenced in function longFromDec



Currently it seem the esql uses only 4 of the libraries for linking, but seem like the de-supported functions are not found in any of these.
"C:\Program Files (x86)\Informix Client-SDK\\lib\isqlt09a.lib"
"C:\Program Files (x86)\Informix Client-SDK\\lib\igl4n304.lib"
"C:\Program Files (x86)\Informix Client-SDK\\lib\iglxn304.lib"
"C:\Program Files (x86)\Informix Client-SDK\\lib\igo4n304.lib"

Anyone has prior experience with this kind of issue?

Any help is highly appreciated,.


Thanks And Regards
Susobh Sugathan


Title: Re: Migrate C-Extension to FGL 3.10 for Windows
Post by: Susobh S. on June 23, 2020, 11:37:48 am
Hi,

Just to add to my previous comment.
Currently I see some warnings as well, regarding the 64bit vs 32Bit Difference.
My Sysadmin has installed 32 bit Informix CSDK now.

Will that be in any way case the issue that the functions cant be resolved?
Or since it is just a warning can i ignore those?


C:\Program Files (x86)\Informix Client-SDK\\lib\isqlt09a.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
C:\Program Files (x86)\Informix Client-SDK\\lib\igl4n304.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
C:\Program Files (x86)\Informix Client-SDK\\lib\iglxn304.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
C:\Program Files (x86)\Informix Client-SDK\\lib\igo4n304.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'


Thanks

Susobh Sugathan


Title: Re: Migrate C-Extension to FGL 3.10 for Windows
Post by: Reuben B. on June 24, 2020, 10:53:53 am

For SXB personnel: There is already a support case raised by the customer on this.

I'll repeat something from the support-case, you can not mix 32 and 64 bit libraries.  There is plenty of discussion on StackOverflow on this in years gone bye.

Reuben


Title: Re: Migrate C-Extension to FGL 3.10 for Windows
Post by: Susobh S. on June 25, 2020, 06:44:10 am
Hi Reuben,

Thanks for the Reply.


For SXB personnel: There is already a support case raised by the customer on this.

I'll repeat something from the support-case, you can not mix 32 and 64 bit libraries.  There is plenty of discussion on StackOverflow on this in years gone bye.

Reuben
Yes it was 32 bit Informix ESQL/C library causing the DLL build to fail.
Once i tried using the 64 bit Informix CSDK, the issue has been fixed. DLL is successfully generated, and program works fine too.


Thanks And Regards
Susobh Sugathan