0

sorry I know it is repeated and it is similar to this question but there was only one answer which doesn't satisfy the objective :)

The compilation of uamqp library is pretty easy. I end up with 2 static libraries to be used when linking in my project in eclipse. During run time and if an error happens, the error message shows the path, where the static libraries are originally compiled. I get something like this:

Error: Time:Tue May 22 09:04:45 2018 File:/home/hostname/azure-uamqp-c/src/saslclientio.c Func:on_underlying_io_error Line:243 Error callback received in unexpected state

I have no problem with the error message. The issue is only when the error occurs, then it shows the path /home/hostname/azure-uamqp-c/saslclientio.c

Please how can I compile the uamqp library, so that no absolute paths are stored inside? is it a cmake command option that I do have to configure?

Thanks

halim
  • 386
  • 4
  • 14

1 Answers1

0

Message "Error callback received in unexpected state" is emitted by LogError() call, and LogError macro eventually uses preprocessor expression __FILE__ for refer to the path of source file.

According to that answer, expression __FILE__ is expanded to path, which is passed in compiler's command line.

Unfortunately, CMake always uses absolute paths for source files when pass them to the compiler. So there is no easy way for generate relative paths in logs.

You may write a wrapper around compiler, which transforms absolute paths to relative and calls compiler.

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
  • I actually created a symbolic link under / (root) in order not to show my /home/hostname, thanks for your clarification! – halim May 22 '18 at 12:36