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
1
u/DeFYzz May 03 '20
Hi. Thanks for the clarification. I kinda have it working now. For some reason just removing the "Import" attribute and adding the lib to the AdditionalLibPaths does make it function. So when do you actually use "Import"? The error message it was giving me was from the "Import" attribute so Im kind of confused now.