3

I'm trying to resolve the following problem: My code runs on Windows and on Linux. I need to know the path from where the currently running .dll (.so) was loaded, so that I can also find the path to some satellite files I need. On Windows I use:

char buffer[1024];
GetModuleFileName(GetModuleHandle("MyLibrary.dll"), buffer, MAX_PATH);

What would be the equivalent code on Linux?

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
Radoslav Hristov
  • 1,032
  • 1
  • 10
  • 22

0 Answers0