GetProcedureAddress in linux versus windows lazarus / 67-Windows ---------------------------------------------------------------------- luis · 2017-07-25 17:07 Hi, I'm trying to build a program that works both in windows and linux. It uses an open source 3rd party C library that we compile using gcc in linux and Microsoft Visual Studio 2013 in windows (that's the way the developer recommends doing it). I load the library with LoadLibrary and get a non-null value for the handle in both cases. But when I try to load any entry point in windows it seems to want to use a different (decorated?) name. So under linux I would use: ptr := GetProcedureAddress(handle, 'flInitialise'); but under windows it seems to want for the same function: ptr := GetProcedureAddress(LibFPGALink, '_flInitialise@12'); If I really need to do that, I can use some ifdefs, but I want to know if that is intended or perhaps I'm doing something wrong. Thanks ---------------------------------------------------------------------- Phil · 2017-07-25 17:23 Quote from: luis on July 25, 2017, 07:07:46 pmIf I really need to do that, I can use some ifdefs, but I want to know if that is intended or perhaps I'm doing something wrong. Yes, that's correct. If it's a small number of entry points, I would just conditionally compile. Otherwise, you could compile 64-bits, since function names are not decorated there. Or you could compile 32-bits with clang or gcc on Windows. https://msdn.microsoft.com/en-us/library/x7kb4e2f.aspx ---------------------------------------------------------------------- luis · 2017-07-25 18:17 Awesome, Thanks. Nothing beats open source support