1

I need to have a latest feature of IniFile, so compiled my XE .lib project in RAD Studio 10.2. Compilation is successful, but while using it in my XE project, I get an "unable to open SChore.obj" linker error. How to resolve this error?

This "Schore.dll is present in "C:\Program Files (x86)\Embarcadero\Studio\19.0\lib\win32\release". I tried adding this path to the includes path of both .lib, as well as the XE project, it the error still exists.

Any suggestion on resolving this error?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
viji
  • 11
  • 1

1 Answers1

1

You can't share a .lib file across different versions of the compiler. You need separate versions of the .lib that have been compiled specifically for each compiler.

Which means you can't use a 10.2 .lib in XE. What you can do instead is compile your lib code in 10.2 into a DLL, and then you use that DLL in your XE project.

If you want to statically link to a DLL's functions at compile-time, you can use XE's version of C++Builder's IMPLIB tool to create a new import .lib from the DLL, and then add that to your XE project. Otherwise, you can use the Win32 LoadLibrary() and GetProcAddress() functions to access the DLL's functions dynamically at runtime.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • What is a import lib and how to create it and use it with exe? Do we have any document on it ? – viji May 03 '21 at 10:46