Error: unresolved external symbol _SE_connection_test_server@12

Error Message

When compiling and linking SDE C API code that uses the SE_connection_test_server function in Visual C++ 2005 or Visual C++ 2008 on a Windows 32-bit operating system (OS), one of the following error messages is returned:

"error LNK2001: unresolved external symbol _SE_connection_test_server@12"

"error LNK2019: unresolved external symbol _SE_connection_test_server@12"


In versions of Visual C++ and Microsoft C/C++ before Visual C++ 2005, time_t type was represented as a long int (32-bits). This meant that dates that were past 3:14:07 January 19, 2039 Coordinated Universal Time (UTC) could not be used. Since Visual C++ 2005, time_t has now been defined as _time64_t, by default. When compiling and linking code that uses this C API function, SE_connection_test_server emits a LNK error on a 32-bit Windows OS, because _time64_t is not defined in a 32-bit Windows OS.

Solution or Workaround

To compile and then link the C-API code successfully on a Windows 32-bit operating system, set the preprocessor definition '_USE_32BIT_TIME_T' in Visual C++ 2005 or Visual C++ 2008. Setting this preprocessor definition causes the linker to use the definition of _time32_t for time_t instead of the default _time64_t.

To set the preprocessor definition in Visual Studio, follow the steps below.

  1. Right-click the Project.
  2. Select Properties from the pop-up menu.
  3. In the Property Pages dialog box, expand C/C++ under Configuration Properties and select Preprocessor.
  4. Click on '...' in the Preprocessor Definitions and input '_USE_32BIT_TIME_T' in a new line.
  5. Click OK to save changes and close all open pages.
  6. Build the Project.

Related Information