Linking example OFX GainPlugin

Get answers to your questions about color grading, editing and finishing with DaVinci Resolve.
  • Author
  • Message
Offline
User avatar

Cary Knoop

  • Posts: 1466
  • Joined: Sun Mar 12, 2017 6:35 pm
  • Location: Newark, CA USA

Linking example OFX GainPlugin

PostThu Jan 18, 2018 9:53 pm

In VS2017 using CUDA 9.1 I was able to compile the plugin however linking it gave the following error:

Code: Select all
error LNK2019: unresolved external symbol "void __cdecl RunMetalKernel(int,int,float *,float const *,float *)" (?RunMetalKernel@@YAXHHPEAMPEBM0@Z) referenced in function "public: virtual void __cdecl ImageScaler::processImagesMetal(void)" (?processImagesMetal@ImageScaler@@UEAAXXZ)


Is there anyone who can tell me what steps I must have been missing?
Offline

Hendrik Proosa

  • Posts: 3055
  • Joined: Wed Aug 22, 2012 6:53 am
  • Location: Estonia

Re: Linking example OFX GainPlugin

PostFri Jan 19, 2018 9:27 am

Linker errors usually mean that you have not pointed to some source or library file that is needed. In this case it is the function RunMetalKernel which is not found in any linked file. Find out which library is supposed to contain this function and check if it is properly referenced in project settings, see the linker additional dependencies section.
I do stuff
Offline

Hendrik Proosa

  • Posts: 3055
  • Joined: Wed Aug 22, 2012 6:53 am
  • Location: Estonia

Re: Linking example OFX GainPlugin

PostFri Jan 19, 2018 1:10 pm

Can you point to the source of the example code you are trying to build? There is no RunMetalKernel nor processImagesMetal in ofx git repo, so you are probaby trying to build someones handiwork. What build system does your example source use, VS or cmake etc?
I do stuff
Offline
User avatar

Cary Knoop

  • Posts: 1466
  • Joined: Sun Mar 12, 2017 6:35 pm
  • Location: Newark, CA USA

Re: Linking example OFX GainPlugin

PostSat Jan 20, 2018 7:29 pm

Thanks Hendrik!

I used the example plugin provided by Blackmagic that you can find in the developer folder.

I suppose the example is an integrated CUDA, Open CL and Metal version. I could not find any target file that defined what you wanted to compile or link so instead I made a dummy RunMetalKernel() function since I do not use that. It satisfied the linker and the plugin now works in VS2017 and CUDA 9.1.
Offline

Hendrik Proosa

  • Posts: 3055
  • Joined: Wed Aug 22, 2012 6:53 am
  • Location: Estonia

Re: Linking example OFX GainPlugin

PostSun Jan 21, 2018 3:42 pm

Good that you got it working.

I believe all the source files that are added to VS project are compiled and then linker builds the final binary file from the used object files starting from the object file that contains the executable or library main entry point. Here your problem was that linker didn't find the function in any of compiled object, then it looks in the additional dependencies list which instructs to link against other pre-built libraries, but didn't find the function there either. For example, if you have an external DLL file, which contains some function you want to use, you include the header of that file to get the function definition and in linker additional dependencies point to the accompanyng .lib file, which describes what functions the DLL library file contains and what are the memory addresses of their entry points. Linker will use this information to add necessary information to your binary file so that on runtime the function is correctly found from the dll it is contained in.
I do stuff
Offline
User avatar

Jean Claude

  • Posts: 2973
  • Joined: Sun Jun 28, 2015 4:41 pm
  • Location: France

Re: Linking example OFX GainPlugin

PostSun Jan 21, 2018 4:24 pm

Hi Cary,

Are you on MAC ?
"Saying it is good, but doing it is better! "
Win10-1809 | Resolve Studio V16.1 | Fusion Studio V16.1 | Decklink 4K Extreme 6G | RTX 2080Ti 431.86 NSD driver! |
Offline
User avatar

Cary Knoop

  • Posts: 1466
  • Joined: Sun Mar 12, 2017 6:35 pm
  • Location: Newark, CA USA

Re: Linking example OFX GainPlugin

PostSun Jan 21, 2018 5:16 pm

Jean Claude wrote:Hi Cary,

Are you on MAC ?

No, I use a PC.
Offline
User avatar

Jean Claude

  • Posts: 2973
  • Joined: Sun Jun 28, 2015 4:41 pm
  • Location: France

Re: Linking example OFX GainPlugin

PostSun Jan 21, 2018 5:34 pm

Cary Knoop wrote:
Jean Claude wrote:Hi Cary,

Are you on MAC ?

No, I use a PC.


OK : I think Metal is available only on Apple.
"Saying it is good, but doing it is better! "
Win10-1809 | Resolve Studio V16.1 | Fusion Studio V16.1 | Decklink 4K Extreme 6G | RTX 2080Ti 431.86 NSD driver! |
Offline
User avatar

Cary Knoop

  • Posts: 1466
  • Joined: Sun Mar 12, 2017 6:35 pm
  • Location: Newark, CA USA

Re: Linking example OFX GainPlugin

PostSun Jan 21, 2018 5:37 pm

Anyone know of a good forum for OFX development?

Return to DaVinci Resolve

Who is online

Users browsing this forum: AntonioM, Daniel Batinic, Google [Bot], junklont, panos_mts, tcorbett and 296 guests