0

I am trying to catch an exception and get the line and source file where the error occurred. I was using __throwLineNumber and __throwFileName and it compiles, but I am receiving linker errors:

[ilink32 Error] Error: '__ThrowFileName()' unresolved
[ilink32 Error] Error: '__ThrowLineNumber()' unresolved
4
  • Are you doing what the documentation says? "To get the line number for a thrown exception with __throwLineNumber, you must compile the module with the -xp compiler option." Also, C++Builder has several different C++ compilers, which one are you actually using? The __throwFileName documentation says: "Note: This function is only available for classic Win32 compiler." Commented Jul 5 at 21:02
  • I am using C++ Builder 12. Yes I was using -xp compiler option and set it to build a Win32 executable. What should be used for 64 bit executable ? Commented Jul 5 at 23:33
  • C++Builder 12 has 7 C++ compilers, which one(s) are you targeting (ie what platform(s) are you compiling for)? You should edit your question to include your project's configuration. I don't think these macros are available for 64bit, but I would have to try it. Commented Jul 6 at 4:09
  • I had to select use classic borland compiler and activate locations in exception settings. I was using bcc32c. Commented Jul 6 at 14:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.