LNK2019: unresolved ... _sqlcxt referenced in ... _C4CONNECT
search cancel

LNK2019: unresolved ... _sqlcxt referenced in ... _C4CONNECT

book

Article ID: 246842

calendar_today

Updated On:

Products

Gen Gen - Workstation Toolset Gen - Run Time Distributed Gen - Host Encyclopedia

Issue/Introduction

Build of Gen 8.5/Gen 8.6 sample model application with Oracle 64-bit client and Build Token OPT.BITS=64 fails to build with "error LNK2019: unresolved external symbol _sqlcxt referenced in function _C4CONNECT" in the .out file i.e.

8.5 with Oracle 12c 64-bit client:
...Linking Load Module stub GUIMENU
 link /NOLOGO /SUBSYSTEM:WINDOWS -entry:WinMainCRTStartup -out:"C:\Users\Administrator\Documents\CA\Gen 8.5\Models\samp85.ief\c\GUIMENU.EXE" "C:\Users\Administrator\Documents\CA\Gen 8.5\Models\samp85.ief\c\OBJC\STUB.OBJ" "C:\Users\Administrator\Documents\CA\Gen 8.5\Models\samp85.ief\c\OBJC\STUBMAIN.OBJ" "C:\Users\Administrator\Documents\CA\Gen 8.5\Models\samp85.ief\c\STUB.RES" @"C:\Users\Administrator\Documents\CA\Gen 8.5\Models\samp85.ief\c\STUB.LNK"
STUB.OBJ : error LNK2019: unresolved external symbol _sqlcxt referenced in function _C4CONNECT
C:\Users\Administrator\Documents\CA\Gen 8.5\Models\samp85.ief\c\GUIMENU.EXE : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\link.EXE"' : return code '0x460'
Stop.

8.6 with Oracle 19c 64-bit client:
...Linking Load Module stub GUIMENU
 link /NOLOGO /SUBSYSTEM:WINDOWS -entry:WinMainCRTStartup -out:"C:\Users\Administrator\Documents\CA\Gen 8.6\Models\samp86.ief\c\GUIMENU.EXE" "C:\Users\Administrator\Documents\CA\Gen 8.6\Models\samp86.ief\c\OBJC\STUB.OBJ" "C:\Users\Administrator\Documents\CA\Gen 8.6\Models\samp86.ief\c\OBJC\STUBMAIN.OBJ" "C:\Users\Administrator\Documents\CA\Gen 8.6\Models\samp86.ief\c\STUB.RES" @"C:\Users\Administrator\Documents\CA\Gen 8.6\Models\samp86.ief\c\STUB.LNK"
STUB.OBJ : error LNK2019: unresolved external symbol _sqlcxt referenced in function _C4CONNECT
C:\Oracle\19.3\db_home\PRECOMP\LIB\ORASQL19.LIB : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
C:\Users\Administrator\Documents\CA\Gen 8.6\Models\samp86.ief\c\GUIMENU.EXE : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\bin\HostX86\x86\link.EXE"' : return code '0x460'
Stop.

Environment

Release: 8.5, 8.6
Component: Gen Build Tool

Cause

The nature of the link parameters indicate a Gen GUI application is being built (in this case it is also more obvious because "GUIMENU" is the Windows packaged Window Manager load module from the Sample model).
Also C4CONNECT is the Windows GUI database connection user exit: Gen™ 8.6 > Reference > User Exits > Windows C User Exits > Windows GUI Client User Exits > C4CONNECT - Database Connection Exit (Windows)

Even if set token OPT.BITS=64, that value is ignored for GUI applications which can only be 32-bit. The .out file will also contain these messages:
***WARNING*** Attempting to build GUI Application with 64bit compiler.
***WARNING*** OPT.BITS changed to 32 for GUI Application build.

The additional warning from the 8.6 build  "warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'" indicates the bitness mismatch between the 32-bit GUI application and the 64-bit Oracle client.
 

Resolution

Build Gen GUI applications with a 32-bit Oracle client.

If wanting to build a Gen Windows 64-bit application with a 64-bit Oracle client then a Cooperative Packaged Server Manager load module can be built by setting set the "TP Monitor" generation option to IEFAE. Then have a 32-bit GUI client ("TP Monitor" set to Windows and no database access) to connect to that 64-bit server e.g. in the Gen Sample model "Generation > Cooperative Code", Server Manager P900 and Windows Manager W900.

Additional Information

Gen EDGE Community Question: CA Gen Application Error LNK2019