I'm not sure if I did understand everthing what's uttered in the thread but
- your "linker problem", which was the thread topoc, has been solved, and it wasn't actually a true linker problem, just the fact that the gnu linker doesn't understand specific MS extensions like /defaultlib?
It rather seems that the MasmBasic lib depends in part on Masm32.lib, which I didn't realise. No such problem with a DLL based only on MasmBasic lib, though, so that could be the preferred solution.
- the other issue was a crash in a second "Print" line and you blame the compiler/linker for not emitting a warning, calling this "Beginner unfriendly"? Well, I looked at this code and could also find no reason at all why the compiler should refuse this syntax.
The point here is (if I understood correctly) that the library returns in eax a pointer to a zstring. FreeBasic can handle that when assigning a string: MyString=calltolib(xyz), i.e. the friendly compiler converts the zstring to a bstring, correctly and without complaining about the wrong type. When trying to do the same with Print calltolib(xyz), it crashes.
> SendMessageA(hList, LB_ADDSTRING, 0, linect) ' NOT OK
It will also fail if you try to use it with PowerBasic, which has little type checking. Passing a string to a function that expects a pointer or an scalar is deemed to fail.
I pass strings all the time to Windows APIs, never had a problem. A string
is a pointer. You may argue that a BASIC string is more than a pointer, as it has also the length info, a DWORD before the start of the memory block that it points too. Fine, then the old string in MyNew$=MyOld$ can return the zstring ptr, and MyNew$ can get the length info knowing that it's in the DWORD before, while the Windows API doesn't have to know that there is additional info before the pointer.
Regarding the warnings, there is a compiler option (-w none) to suppress all of them. Use it.
Suppressing all warning does not sound like a good idea. Why would there be warnings if they are all useless? The problem here is that if you are flooded with 100 warnings, you will overlook the
one warning that will bite your customer, years later. The simple Windows template above spits out 7 warnings per 100 lines of code; applied to my RichMasm source, that would be over 1,500 warnings - madness. No thanks.
There have been too many toothless Basic compilers already, which have given a bad reputation to this language. If you make a language for beginners only, you won't attract skilled programmers.
Good point. However, PowerBasic is fast and far less complicated than FreeBasic. MasmBasic lacks some features, especially in math, but it's generally much faster than FreeBasic, and has a number of functions that FB does not offer. Check
profiling, for example.
IMHO FreeBasic is a thin wrapper for GCC & friends, and suffers from not being able to fulfill the promise of "
Beginners' All Purpose Symbolic Instruction Code". The few skilled programmers that it attracts come from C or C++, so what is their specific interest in BASIC...?