WinFBE FreeBASIC Editor for Windows (Updated September 27, 2017)

User projects written in or related to FreeBASIC.
St_W
Posts: 1056
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: WinFBE FreeBASIC Editor for Windows (Updated August 23, 2017)

Postby St_W » Aug 25, 2017 12:09

PaulSquires wrote:That's true and I have tried that, however, if you wrap the application name in quotes then CreateProcess will fail. So using a unwrapped long filename with spaces as the separate argument DOES work (FBC is launched), when FBC retrieves the path and uses it during the Assembling stage, it outputs a NON-QUOTED path to the as.exe program (refer to my screenshot in the previous post). That's the problem.
But the path to as.exe or ld.exe isn't quoted (or at least it isn't displayed with quotes) neither in my example output above. And that worked nethertheless - despite the spaces and non-ASCII characters in the path.
Kuan Hsu
Posts: 255
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: WinFBE FreeBASIC Editor for Windows (Updated August 23, 2017)

Postby Kuan Hsu » Aug 25, 2017 12:12

PaulSquires wrote:
fxm wrote:On my PC, compilation fails with the version 1.4.7 (works with version 1.4.6.1)

I get:
Compiler results: compiling FAILED: Error Code 1
Compiler Log File: Invalid command-line option, "Outils"

I think this behavior is due to my compiler path that contains space characters:
D:\Users\T0003830\Documents\Mes Outils Personnels\fbc1.06.0.St_W\fbc.exe

IMHO, quotation marks surrounding the full compiler path are missing when now calling WinAPI:
"D:\Users\T0003830\Documents\Mes Outils Personnels\fbc1.06.0.St_W\fbc.exe" .....

By the way, all names of paths/files in the compiler command line may also contain space characters (works also with version 1.4.6.1 for the source file at least):
"D:\Users\T0003830\Documents\Mes Outils Personnels\fbc1.06.0.St_W\fbc.exe" "Untiled 1.bas" .....


Hi fxm,

I have been trying to fix this issue regarding spaces in the compiler path. I have it working so that the process gets created and the compiler gets invoked. Wrapping the path in double quotes fixed that. The problem now is that when the compiler calls the assembler it does so using a path without quotes thereby causing it to hang. Take a look at the screenshot below. Not sure how to fix this....yet :-)

In Windows, maybe use "GetShortPathName" API to skip space? I use this API to pass lib paths( include space ) to Digitalmars D linker~
PaulSquires
Posts: 586
Joined: Jul 14, 2005 23:41
Contact:

Re: WinFBE FreeBASIC Editor for Windows (Updated August 23, 2017)

Postby PaulSquires » Aug 25, 2017 12:17

Kuan Hsu wrote:In Windows, maybe use "GetShortPathName" API to skip space? I use this API to pass lib paths( include space ) to Digitalmars D linker~

That's a great idea... :-)
St_W
Posts: 1056
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: WinFBE FreeBASIC Editor for Windows (Updated August 23, 2017)

Postby St_W » Aug 25, 2017 12:19

Kuan Hsu wrote:In Windows, maybe use "GetShortPathName" API to skip space? I use this API to pass lib paths( include space ) to Digitalmars D linker~
I don't think that this is a good idea as the generation of short names might be disabled on modern systems on NTFS partitions due to performance reasons. In such a case the compilation will still fail.

btw, it may be worth noting that the non-standalone build of the FreeBasic compiler behaves differently than the (default) standalone build on Windows:

Code: Select all

   '' Always use exec() on Unix or for standalone because
   '' - Unix exec() already searches the PATH, so shell() isn't needed,
   '' - standalone doesn't use system-wide tools
   #if defined( __FB_UNIX__ ) or defined( ENABLE_STANDALONE )
      result = exec( path, ln )
   #else
      '' Found at bin/?
      if( relying_on_system = FALSE ) then
         result = exec( path, ln )
      else
         result = shell( path + " " + ln )
      end if
   #endif
PaulSquires
Posts: 586
Joined: Jul 14, 2005 23:41
Contact:

Re: WinFBE FreeBASIC Editor for Windows (Updated August 23, 2017)

Postby PaulSquires » Aug 25, 2017 12:49

Thanks for the info St_W, appreciate it. I can report that the use of GetShortPathName does indeed solve the problem and now everything is working okay for both short paths and long paths. Rather than use GetShortPathName in all cases, I am only invoking it in situations where the path to the compiler contains spaces. This means that in both cases I won't have to use any double quotes to wrap the compiler path and this makes CreateProcess happy. Of course, I am still continuing to enclose source and resource filenames in quotes.

... the generation of short names might be disabled on modern systems on NTFS partitions due to performance reasons. In such a case the compilation will still fail.

I think at this point that this is a risk I'm willing to take. :-)
PaulSquires
Posts: 586
Joined: Jul 14, 2005 23:41
Contact:

Re: WinFBE FreeBASIC Editor for Windows (Updated August 23, 2017)

Postby PaulSquires » Aug 25, 2017 12:51

St_W wrote:
PaulSquires wrote:That's true and I have tried that, however, if you wrap the application name in quotes then CreateProcess will fail. So using a unwrapped long filename with spaces as the separate argument DOES work (FBC is launched), when FBC retrieves the path and uses it during the Assembling stage, it outputs a NON-QUOTED path to the as.exe program (refer to my screenshot in the previous post). That's the problem.
But the path to as.exe or ld.exe isn't quoted (or at least it isn't displayed with quotes) neither in my example output above. And that worked nethertheless - despite the spaces and non-ASCII characters in the path.

I think that in your case the rules for quotes/noquotes are a little different when invoking the compiler through the command shell rather than using CreateProcess. At least that's the gist I get from articles that I read last night.
dodicat
Posts: 4336
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: WinFBE FreeBASIC Editor for Windows (Updated August 23, 2017)

Postby dodicat » Aug 25, 2017 14:32

deleted post
Last edited by dodicat on Aug 26, 2017 9:14, edited 1 time in total.
PaulSquires
Posts: 586
Joined: Jul 14, 2005 23:41
Contact:

Re: WinFBE FreeBASIC Editor for Windows (Updated August 23, 2017)

Postby PaulSquires » Aug 25, 2017 21:38

Version 1.4.8 (August 25, 2017)
- Changed: Failed results when compiling individual module files to object files are now displayed.
- Changed: Corrected captions on save dialogbox for "Save As", "Save Declares File", "Save Project As".
- Fixed: Compiling failed in situations where spaces in file path to compiler (CreateProcess and/or FBC assembling would fail).

https://github.com/PaulSquires/WinFBE/releases
fxm
Posts: 7270
Joined: Apr 22, 2009 12:46
Location: Paris suburb, FRANCE

Re: WinFBE FreeBASIC Editor for Windows (Updated August 25, 2017)

Postby fxm » Aug 26, 2017 5:16

Perfect thank you.
ur_naz
Posts: 29
Joined: Mar 02, 2016 12:44

Re: WinFBE FreeBASIC Editor for Windows (Updated August 25, 2017)

Postby ur_naz » Aug 26, 2017 19:07

I just can't get your logic...

1) why do you hide extensions from user?
2) why don't you allow user to save separately bas and bi files.
3) If Save 'Declares File' must save *.bi files only so why it saves *.bas files also?

It seems like you use same extension pattern (e.g. *.bas;*.bi") for all of 'Open', 'Save As' and 'Save Declares File' operations. So it causes unspecified behavior. And it is incorrect by all means.

It should be as below:
Open command:
All FB files (*.bas;*.bi) <--Default
FB Source files (*.bas)
FB Include files (*.bi)
All files (*.*)

Save As command:
FB Source files (*.bas)<--Default
FB Include files (*.bi)
All files (*.*)

If 'Save Declares File command' --> 'Save Copy As':
FB Source files (*.bas)<--Default
FB Include files (*.bi)
All files (*.*)

if not then
'Save Declares File' command:
FB Include files (*.bi)<--Default
All files (*.*)
Josep Roca
Posts: 158
Joined: Sep 27, 2016 18:20
Location: Valencia, Spain

Re: WinFBE FreeBASIC Editor for Windows (Updated August 25, 2017)

Postby Josep Roca » Aug 26, 2017 19:36

Just because you only use bas and bi files don't believe that everybody does the same.
ur_naz
Posts: 29
Joined: Mar 02, 2016 12:44

Re: WinFBE FreeBASIC Editor for Windows (Updated August 25, 2017)

Postby ur_naz » Aug 26, 2017 20:32

Josep Roca wrote:Just because you only use bas and bi files don't believe that everybody does the same.

I know there is no difference for compiler what extension you use. But there are two big differences (as use to said in Odessa) for user.
I said not about compiler but right files filtering. When I open directory and see 100 bi files and 100 bas files I see 200 files in all and can't find file I was going to open or save. If I use right filter, I can filter out a half or more files and quickly find that I need.
Josep Roca
Posts: 158
Joined: Sep 27, 2016 18:20
Location: Valencia, Spain

Re: WinFBE FreeBASIC Editor for Windows (Updated August 25, 2017)

Postby Josep Roca » Aug 26, 2017 20:42

Agreed. But don't reduce the filters to bas and bi. I will use:

FB Source files (*.bas)
FB Include files (*.bi;*.inc)
Resource files (*.rc)
All files (*.*)

Some of us use .inc and .rc files quite often.
PaulSquires
Posts: 586
Joined: Jul 14, 2005 23:41
Contact:

Re: WinFBE FreeBASIC Editor for Windows (Updated August 25, 2017)

Postby PaulSquires » Aug 26, 2017 20:57

I have no problem changing the filters and will do so for the next update.
:-)
ur_naz
Posts: 29
Joined: Mar 02, 2016 12:44

Re: WinFBE FreeBASIC Editor for Windows (Updated August 25, 2017)

Postby ur_naz » Aug 26, 2017 21:21

And the same problem is then select compiler. I joined x86 and x64 compilers into one directory, so I couldn't give both the same name. Thus I named x64 compiler as fbc_x64.exe. And it would be great if you allow to select any *.exe instead fbc.exe

Return to “Projects”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests