Linking C++/CLI OCCI Windows Form application fails with LNK2028 referencing __clrcall (Doc ID 1438431.1)

Last updated on JULY 05, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.2 and later
Microsoft Windows (32-bit)
Microsoft Windows x64 (64-bit)

Symptoms


Linking C++ Windows Form application which uses the Oracle C++ Call Interface (OCCI) fails with LNK-2028

An example linker error is as follows:

Error 1 error LNK2028: unresolved token (0A000012) "public: static void __clrcall oracle::occi::Environment::terminateEnvironment(class oracle::occi::Environment *)" (?terminateEnvironment@Environment@occi@oracle@@$$FSMXPAV123@@Z) referenced in function "private: void __clrcall occiwinformapp2::Form1::Form1_Load(class System::Object ^,class System::EventArgs ^)" (?Form1_Load@Form1@occiwinformapp2@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) C:\testcases\occiwinformapp2\occiwinformapp2\occiwinformapp2.obj occiwinformapp2



Compiling a Win32 console application compiles fine however.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms