WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V3.1.0 June 4, 2023)

User projects written in or related to FreeBASIC.
Post Reply
Josep Roca
Posts: 564
Joined: Sep 27, 2016 18:20
Location: Valencia, Spain

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.4 April 26, 2020)

Post by Josep Roca »

I found the source of the warning in WinFBX includes. The AfxWin.inc and CSafeArray.inc code both contain a call to strstr with an "ANY PTR" and a ZSTRING argument instead of the expected const char *.
The FB headers use ztring:

Code: Select all

#undef strstr
declare function strstr (byval as const zstring ptr, byval as const zstring ptr) as zstring ptr
The AfxFileScanW function also uses ANY PTR and a WSTRING argument instead of const wchar* and it doesn't complain.

Why does it complain if previous versions did not?

As I guess that the GCC guys won't give a rat's arse about casusing troubles to FreeBasic coders, I think that the solution will be to remove the inclusion of string.bi, include shlwapi.bi instead and change strstr to StrStrA and wccstr to StrStrW.
robert
Posts: 169
Joined: Aug 06, 2019 18:45

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.4 April 26, 2020)

Post by robert »

Josep Roca wrote:
I found the source of the warning in WinFBX includes. The AfxWin.inc and CSafeArray.inc code both contain a call to strstr with an "ANY PTR" and a ZSTRING argument instead of the expected const char *.
The FB headers use ztring:

Code: Select all

#undef strstr
declare function strstr (byval as const zstring ptr, byval as const zstring ptr) as zstring ptr
The AfxFileScanW function also uses ANY PTR and a WSTRING argument instead of const wchar* and it doesn't complain.

Why does it complain if previous versions did not?

As I guess that the GCC guys won't give a rat's arse about casusing troubles to FreeBasic coders, I think that the solution will be to remove the inclusion of string.bi, include shlwapi.bi instead and change strstr to StrStrA and wccstr to StrStrW.
Hi Josep:

The error was generated using a 64 bit fbc.exe that I compiled from Github FreeBASIC 1.0.8 source using the gcc-10-20200419-64 Equation compiler. The Equation compiler was also used to build the 64 bit ffilib and includes.

I really didn't mean for this warning to get to you, it was meant rather for Paul for consideration of the output in the Compiler Results window.

I am a total noob to the FreeBASIC backends, however I am wondering , if the code is being compiled as C, why is there any warning at all? If it is being compiled as C++, yes, the const char * rule rules.

Thank you for your response and thank you for WinFBX. It is fantastic.
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.4 April 26, 2020)

Post by xiaoyao »

PaulSquires wrote:Thanks I will post a message on my forum for Jose in case he doesn't see it here.
Hi, brother, it turns out that you are here, this is your great second work.
I wonder what language your original FireFly IDE was developed in? Why didn't it continue to develop, now this WinFbe update is so frequent.
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.4 April 26, 2020)

Post by xiaoyao »

Winfbe suggested that it would be too convenient if these functions can be achieved:
1. Form program, double-click the button to directly generate an event, automatically switch to the code view like VB6, and directly write the event code when the button is clicked.
2. I don't know how to make the code editor "smart prompt", I don't know how to write the first sentence of code.
The usage in VB6 is: vba.MsgBox ("333")
I just need to enter vba. After that, all methods and properties will be prompted intelligently.
In EXCEL, vb6 supports this usage, which is very convenient, if Winfbe can support: fbe. * This is also very convenient.
2.1 I checked the usage of some built-in functions of Freebasic, such as:
Declare Function MkDir (ByRef folder As Const String) As Long
In winfbe, you must enter mkdir completely, he will produce "smart prompt": mkdir (folder), and the parameter type, function return value type, there is no prompt.
The best way is to bring parameter types, and for different languages, generate different "function usage" prompt information (introduction remarks)
2.2, API smart prompt, only complete Messagebox (), will generate a smart prompt, there are parameter types.
If you can use API.M *, it will be more convenient to automatically display the API beginning with M.
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.5 May 8, 2020)

Post by PaulSquires »

Version 2.1.5 (May 8, 2020)
Editor:
- Changed: Running WinFBE for first time with no existing WinFBE.ini config file will automatically create entries for User Tools that exist in the Tools folder.
- Fixed: The 64 bit translation of the SCNotification type structure for Scintilla notifications was incorrect. This caused problems setting the flag for when code parsing should happen which in turn caused issues with Autocompete and displaying of Sub/Function names in the Explorer.
- Fixed: AutoInsert, AutoComplete, and CodeTips are disabled if current position is within a single or multiple line comment block.
- Fixed: Additional checks for ensuring subs/functions names correctly added to Explorer and popup F4 Function List when source code is modified. If AutoComplete is disabled, then Sub/Function will not appear until corresponding End Sub / End Function is typed.

Visual Designer:
- Fixed: Label hot coloring could sometimes not reset if the label immediately next to oroverlaps another control.
- Fixed: DateTimePicker control would not show correctly the FormatCustom visually at design time. Worked at run time only.
- Fixed: Changing DateTimePicker DateFormat property now destroys and recreates the window control in order to properly set the styles.
- Fixed: Form WindowState property not correctly setting Minimized/Maximized/Normal states.
- Fixed: Lassoing control(s) was not updating the Toolbox Property List with the correct active selected control.

Download from: https://github.com/PaulSquires/WinFBE/releases
deltarho[1859]
Posts: 4305
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.5 May 8, 2020)

Post by deltarho[1859] »

Re Version 2.1.5

SetCompilerSwitchesII.exe looks for SetCompilerSwitches.ini. The ini file is compatible with the original SetCompilerSwitches.exe so never got 'II' added. As is SetCompilerSwitchesII will not find SetCompilerSwitches.ini so you will get a message saying "I need more than one compiler switch." I have mentioned this several times in the past.

In the Tools folder rename SetCompilerSwitchesII.ini to SetCompilerSwitches.ini.

In the 'Tools>User Tools...' menu 'Action:' is set to 'Invoke only when selected by user'. This tool is best opened when WinFBE opens and left open for WinFBE's session. So, change 'Action:' to 'Invoke immediately after WinFBE starts'. I place mine at the far right of the code editing box and do not code that far.

The given ini file isn't much use, so I would suggest:

Code: Select all

"-gen gas"
"-gen gcc"
"-gen gcc -Wc -O1"
"-gen gcc -Wc -O2"
"-gen gcc -Wc -O3"
"-gen gcc -Wc -Os"
"-gen gcc -Wc -Ofast"
That may very well do most of you - you can always subtract or add later.
Dr_D
Posts: 2451
Joined: May 27, 2005 4:59
Contact:

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.5 May 8, 2020)

Post by Dr_D »

Hi. This looks like a great project. I was interested in using the visual designer, but trying to compile the example threw this error at me. I'm not exactly sure what's going on with the undefined reference and the failed linking. I just extracted the archive and tried to run it straight out of the box. Did I possibly fail to set something else up properly? Thanks.


EDIT: I re-extracted the archive, followed the directions in the post above mine, and everything seems to work as expected now.

Code: Select all

Failed Compile (Errors 1  Warnings 0  [2020-05-09  08:44:54])

Command Line: 
C:\FreeBASIC Stuff\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\fbc32.exe -m "C:\FreeBASIC Stuff\WinFBE_Suite\Examples\Visual_Designer_Projects\Notepad\WinFBE_VD_MAIN.bas" "C:\FreeBASIC Stuff\WinFBE_Suite\Examples\Visual_Designer_Projects\Notepad\TMP3F3D.rc" -v -s console  -x "C:\FreeBASIC Stuff\WinFBE_Suite\Examples\Visual_Designer_Projects\Notepad\Notepad.exe"

FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
standalone
target:       win32, 486, 32bit
compiling rc:               C:\FreeBASIC Stuff\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win32\GoRC.exe /ni /nw /o /fo "C:\FreeBASIC Stuff\WinFBE_Suite\Examples\Visual_Designer_Projects\Notepad\TMP3F3D.obj" "C:\FreeBASIC Stuff\WinFBE_Suite\Examples\Visual_Designer_Projects\Notepad\TMP3F3D.rc"
linking:      C:\FreeBASIC Stuff\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win32\ld.exe -m i386pe -o "C:\FreeBASIC Stuff\WinFBE_Suite\Examples\Visual_Designer_Projects\Notepad\Notepad.exe" -subsystem console "C:\FreeBASIC Stuff\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win32\fbextra.x" --stack 1048576,1048576 -s -L "C:\FreeBASIC Stuff\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win32" -L "." "C:\FreeBASIC Stuff\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win32\crt2.o" "C:\FreeBASIC Stuff\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win32\crtbegin.o" "C:\FreeBASIC Stuff\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win32\fbrt0.o" "C:\FreeBASIC Stuff\WinFBE_Suite\Examples\Visual_Designer_Projects\Notepad\TMP3F3D.obj" "-(" -lfb -lgcc -lmsvcrt -lkernel32 -luser32 -lmingw32 -lmingwex -lmoldname -lgcc_eh "-)" "C:\FreeBASIC Stuff\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win32\crtend.o" 
C:\FreeBASIC Stuff\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\lib\win32/libmingw32.a(lib32_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x39): undefined reference to `WinMain@16'
linking failed: 'C:\FreeBASIC Stuff\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\bin\win32\ld.exe' terminated with exit code 1
deltarho[1859]
Posts: 4305
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.5 May 8, 2020)

Post by deltarho[1859] »

@Paul

I have updated SetCompilerSwitchesII.exe to look for SetCompilerSwitchesII.ini and not SetCompilerSwitches.ini. This contradicts my last post but is better than asking a user to rename a file. SetCompilerSwitchesII.exe (V 1.03) needs to be used in your next update.

Considering WinFBE 'installing' User Tools the Help file has been updated.

See drWinFBE_Tools
deltarho[1859]
Posts: 4305
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.5 May 8, 2020)

Post by deltarho[1859] »

I have had another idea. I don't know why it has taken so long for the penny to drop.

Anyway, a first time user may have many questions to ask with regard User Tools. A long time user may want to add a toolchain or add some more switches and simply ask: "What do I do now?". Obviously, reading the User Tools Help should answer most, if not all, questions if, of course, they knew it existed and where it was.

I have just added a new tool entitled 'User Tools Help file' using '.\Tools\drWinFBE_Tools.chm' and 'Ctrl+7'.
deltarho[1859]
Posts: 4305
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.5 May 8, 2020)

Post by deltarho[1859] »

WinFBE 2.1.5 made the previous Help file nearly redundant. That introduced a new method for 'installing' User Tools. Well, we can use that method for 'installing' the Help itself as a User Tool.

In the Settings folder is WinFBE.ini. Go to the [UserTools] section and append to the list the following:

Code: Select all

USERTOOL_06=User Tools Help|-|.\Tools\drWinFBE_Tools.chm|-||-|7|-||-|1|-|0|-|0|-|0|-|0|-|0|-|1|-|0
In WinFBE's menu 'Tools>User Tools...' you will now find 'User Tools Help Ctrl+7'.

Image
Kuron
Posts: 34
Joined: Jul 26, 2005 3:22
Location: Nashville

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.5 May 8, 2020)

Post by Kuron »

Paul: I am really proud of you and Jose for all of the hard work you have done on this and thankful for the tremendous support you have given the community. You two have revitalized the community.
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.5 May 8, 2020)

Post by PaulSquires »

That's very kind of you to say - thanks. I wouldn't go as far as to say that we've revitalized the community because it has always been a strong community for as long as I can remember. :-)
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.6 May 17, 2020)

Post by PaulSquires »

Version 2.1.6 (May 17, 2020)
Editor:
- Fixed: Issue with subs/functions not displaying in Explorer treeview during project loading.
- Fixed: File/Open single source file (non-project related) would not display filename in Explorer treeview.
- Fixed: Leading chr(9) tab characters interfered with triggering Autocomplete for "this." or "this->".
- Fixed: Parser infinite loop when parsing DIM lines with { } variable initializers.
- Fixed: Compiling a visual designer Form file when a project was not active would fail if more than one file was open in the editor at the time of compiling.
- Fixed: A Utf8 to Unicode conversion error when outputting Form code.
- Fixed: Some elements from parsed code would not display in popup AutoComplete selection lists.
- Fixed: Run after Compile would fail if -x command line used specifying a relative path filename.

Visual Designer:
- Fixed: Form would flash on screen even if Visible = False.

Download from: https://github.com/PaulSquires/WinFBE/releases
deltarho[1859]
Posts: 4305
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.6 May 17, 2020)

Post by deltarho[1859] »

According to the deltarho research department there is very little interest in having available more than one toolchain. For the 5.2 diehards do yourself a favour and download FreeBASIC-1.07.1-gcc-8.4.rar. I have found that gcc 8.* to be the best upgrade to gcc 5.2. With that download you will also get access to SARG's 64-bit gas. With gas64 use the '-strip' command otherwise you will have symbols included and much larger binaries.

You have nothing to lose with gcc 8.4 because you can always switch to gcc 5.2 if needs be. It is possible that 5.2 will outperform 8.4 but the likelihood is against that; I have seen 8.3 outperform 5.2 by over 10% and with a smaller binary. 8.4 binaries tend to be larger than 8.3 binaries but, overall, still tend to be smaller than 5.2.

Go for it. Image
Post Reply