Roland Posted October 29, 2010 Share Posted October 29, 2010 It would be nice if the header file(s) for LE3 would be free from all weird macros. The format should be in normal format like extern "C" { int somefunction( int arg1, const std::string& arg2 ) ; ... ... } and not some strange typedefs' Why then? The reason is that if you have standard notation, the header files can be brought into PInvoke-Toolkit and converted to C# files just with a click. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Canardia Posted October 29, 2010 Share Posted October 29, 2010 There's basically 2 ways to use DLL, so, DyLib: implicit or explicit linking. In LE 2 we had to use explicit linking (typedefs, LoadLibrary), because it was created with BlitzMax. In LE 3 we can also use implicit linking (drag and drop lib file, DLL loads automatically), but we still need also an explicit linked DLL for other languages which don't support this. At least C, C++ and C# supports this, perhaps also Delphi. http://msdn.microsoft.com/en-us/library/9yd93633.aspx Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Roland Posted October 29, 2010 Author Share Posted October 29, 2010 There's basically 2 ways to use DLL, so, DyLib: implicit or explicit linking. In LE 2 we had to use explicit linking (typedefs, LoadLibrary), because it was created with BlitzMax. In LE 3 we can also use implicit linking (drag and drop lib file, DLL loads automatically), but we still need also an explicit linked DLL for other languages which don't support this. At least C, C++ and C# supports this, perhaps also Delphi. http://msdn.microsoft.com/en-us/library/9yd93633.aspx Yes Lumooja. I know the reason why the engine.h looks like it does in LE2.x. It could not have been done another way, just reminding that it would be nice to have clean headers in LE3 Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Canardia Posted October 29, 2010 Share Posted October 29, 2010 I think the LE 3 implicit headers could also be OOP, since it seems only OOP languages support them anyway. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Josh Posted October 29, 2010 Share Posted October 29, 2010 I am not sure how the header files for linking a static lib work. Do we even need a separate header file to do that? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Roland Posted October 29, 2010 Author Share Posted October 29, 2010 I am not sure how the header files for linking a static lib work. Do we even need a separate header file to do that? Header files are needed in both cases. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Mumbles Posted October 29, 2010 Share Posted October 29, 2010 Basically, you add the lib to your library dependancies, and then at build time, all the functions and variables in the lib are built into your exe. But like a standard cpp source file, if those functions have not been declared, then nothing can use them. Whilst users could declare the functions for themselves, it's not ideal. Including a header file with the lib is the best way because otherwise anyone who uses the lib has to declare the functions themselves, which first means that they must know the name of each function, its parameter list and return type. Without access to the source code, most people are not going to know this information. Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
Josh Posted October 29, 2010 Share Posted October 29, 2010 In that case, I can just copy and paste the class header files into one big file. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Roland Posted October 29, 2010 Author Share Posted October 29, 2010 In that case, I can just copy and paste the class header files into one big file. Not needed. You can keep them as different files. Normally one .h file/class Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.