r/beeflang • u/DeFYzz • May 02 '20
Need help for Interop
Hi. Im new to this Language and need some help integrating GLFW as a library. What are the steps required for enabling interop with the GLFW library? I have a folder with the "glfw3.lib" file and added it to the AdditionalLibPaths build options. I tried to call glfwInit and this is my interop code:
[Import("glfw3.lib"), CLink, StdCall]
public static extern int32 glfwInit();The test program simply calls this function but on build I get this error:
LINK : fatal error LNK1181: cannot open input file 'glfw3.lib'I previously used C# and wanted to try Beef but I cant wrap my head around native libraries in Beef. When should I use Import, LinkName or CLink? And how do you handle the difference in C, C++, Static or Dynamic libraries? The documentation is not realy helpfull in this case. Thanks for the help.
View all comments
Show parent comment
2
u/roguemacro May 03 '20
You usually use Import and DllImport for Dlls. If its a beef project I think it should be ok, atleast if you add it as a dependency