I am receiving a "Symbol eliminated by Linker" error when my app calls into a dll. It just recently showed up in a mature codebase.
The dll contains a function that takes three parameters and returns a boolean and is declared in the cbuilder 4 code as:
BOOL __stdcall __DLLTYPE__ AdjustVoucherDifference(HWND hOwner, char *receipt_id, bool commit);
The application's delphi declaration is in externs.pas as:
function AdjustVoucherDifference(hOwner :HWnd; Receipt_ID :PChar; bCommit: Boolean): boolean; stdcall; external 'FBCoupon.dll' name 'AdjustVoucherDifference';
So, we're talking apples to apples and the delphi application calls the function as:
AdjustVoucherDifference(Application.Handle, PChar(Receipt_ID), true);
Now the interesting part. When debugging the application with a breakpoint on the function, you can see the values of the parameters being passed as (1002334, "RC000123001", True);
When you run to a second breakpoint on the declaration in externs.pas, the tooltip value says the linker has eliminated the symbol and blank/null values are passed to the dll. The dll fails to execute properly and throws an exception (in this case an esqlerror exception) because the receiptID was unavailable in the sql where clause.
Any thoughts would sure be appreciated,