Add dll export to the callback functions.#270
Add dll export to the callback functions.#270jeroen1602 wants to merge 1 commit intoklippa-app:mainfrom
Conversation
When using the cgo version for windows it complains about the callback functions already being defined and thus not being able to add the dll export attribute. This change adds this attribute to the first definition of the functions when targeting windows.
|
Did you try to compile go-pdfium with mingw64 for windows? |
|
I did not try mingw64. Either before or after this change. I did eventually not have to use because the See the code here: go-pdfium/internal/implementation_cgo/fpdfview_win32.go Lines 28 to 31 in c0fb871 |
|
tnx. Have you some manual for zig and your pullrequest? I tried without success |
|
I set the C and C++ compiler it should use using |
|
thx, go compiler does not say about wrong path to pkg-config ? |
|
That does sound familiar. I believe I searched for a windows port of pkg-config which may work. But decided that cross compiling using either WSL, Macos or a real Linux host was a lot easier. |
I was having issues tyring to build this project for windows. It was complaining that the callback functions have already been defined and can thus not add the
dllexportattribute.Here is an example error:
I go this problem when using the zig (cross) compiler and clang (running native on Windows).
So I made a change to add the
dllexportrequired to the first definitions of these methods when targeting windows.Using this I did get it to compile for Windows.