You are here

GeanyPortable 1.24 will not compile FreeBASIC

16 posts / 0 new
Last post
DinoApps
Offline
Last seen: 9 years 7 months ago
Joined: 2014-08-27 10:14
GeanyPortable 1.24 will not compile FreeBASIC

Dell Latitude C600 laptop, 10G HDD, USB 1.1
Windows XP Pro SP3
Internet access 6 to 12 times per year

I function quite well in my portable life thanks to PortableApps when they work.

Would like to use GeanyPortable as a single IDE for many compilers, all on a single USB drive. Following is a description of my attempts to get GeanyPortable to compile and any help is appreciated. Will be without internet for about six months, starting in three weeks.

Downloaded these files:
GeanyPortable_1.24.paf.exe
FreeBASIC-0.90.1-win32.zip

FreeBASIC was extracted. GeanyPortable was installed, the GeanyPortable.ini file modified and copied into GeanyPortable.exe folder per the help.htm file. No other changes made. Contents of the applicable folders follow.

In the FreeBASIC-0.90.1-win32 folder:
E:\PortableApps\FreeBASIC-0.90.1-win32\readme.txt
E:\PortableApps\FreeBASIC-0.90.1-win32\changelog.txt
E:\PortableApps\FreeBASIC-0.90.1-win32\fbc.exe

In the GeanyPortable folder:
E:\PortableApps\GeanyPortable\help.htm
E:\PortableApps\GeanyPortable\GeanyPortable.ini
E:\PortableApps\GeanyPortable\GeanyPortable.exe

The contents of the GeanyPortable.ini file are:
[GeanyPortable]
AdditionalParameters=
DisableSplashScreen=false
ApplicationLanguage=
#specify from the root of the portable device. Use @Drive for the drive letter. Specify in the format @Drive\Perl\bin\, etc. Seperate with a semicolon [semicolon and close-brace, this forum put up a smiley in the preview]
PathAdditions=@Drive\PortableApps\FreeBASIC-0.90.1-win32\
AdditionalFonts=

where the separators are LF and not CR or CRLF (Line Feed and Carriage Return, respectively). The last line did not have a LF, and I left it as is.

The test file is here:
C:\Documents and Settings\DELL USER\Desktop\test.bas

and it's contents are:
print"hello world."
sleep
end

fbc.exe is the FreeBASIC compiler and runs correctly from the Command Prompt window, as well as from a FreeBASIC specific IDE on the USB drive (called FBide).

GeanyPortable opens test.bas and recognizes it as a FreeBASIC file, but it will not compile or execute (execute seems to be a pseudo-interpreter "run" command, as in FBide).

From Geany's status window when attempting to compile:
fbc -w all "test.bas" (in directory: C:\Documents and Settings\DELL USER\Desktop)
Compilation failed.

From the Command Prompt window entitled C:\WINDOWS\system32\cmd.exe when attempting to execute:
'"./test"' is not recognized as an internal or external command, operable program or batch file.
Press any key to continue . . .

I get the same errors with the following variants, with all combinations:
1) removing the last \ in the Path= statement in the GeanyPortable.ini file.
2) deleting the comment statement in the GeanyPortable.ini file.
3) changing LF to CRLF in the GeanyPortable.ini file.
4) changing @Drive to E: in the GeanyPortable.ini file.
5) removing the -w all parameter in GeanyPortable's run script.
6) changing FreeBASIC folder to just FreeBASIC.

I suspect the GeanyPortable.ini file is not being read or is being over-ruled by something else, and I'm stumped. Thanks in advance for help in getting this to work.

Dino

Ideas are OK. Correct solutions get you a popsicle.

John T. Haller
John T. Haller's picture
Offline
Last seen: 7 hours 54 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Try This Launcher

Try this debug launcher: GeanyPortable_DEBUG1.exe by placing it in your GeanyPortable directory and running it. It will tell you what it is setting the path to. This can help determine if it is working as expected.

Sometimes, the impossible can become possible, if you're awesome!

DinoApps
Offline
Last seen: 9 years 7 months ago
Joined: 2014-08-27 10:14
Success and Failure

SUCCESS

Didn't have access to the XP laptop that will be the GeanyPortable machine, but did have access to two Windows 7 desktops.

Downloaded GeanyPortable_DEBUG1.exe into:
E:\PortableApps\GeanyPortable\

then changed GeanyPortable.ini to:
[GeanyPortable]
AdditionalParameters=
DisableSplashScreen=false
ApplicationLanguage=
PathAdditions=E:\PortableApps\FreeBASIC-0.90.1-win32\
AdditionalFonts=

I just don't trust the comment line just above the PathAdditions line in the oem file, so I took it out. Drive E: is what the CPU assigned at this computer, so it's what I typed in. All line endings are LF except last line, which doesn't have any sort of eol command.

Ran GeanyPortable_DEBUG1.exe and it showed the correct FreeBASIC path in a pop-up window. I didn't think to write down the paths in the pop-up window before GeanyPortable started. GeanyPortable loaded the test file and compiled correctly (created the .exe). Wahoo!

Closed GeanyPortable and opened GeanyPortable.exe (without the debugger) from the GeanyPortable directory via Windows Explorer. Success again.

Changed GeanyPortable.ini to:
[GeanyPortable]
AdditionalParameters=
DisableSplashScreen=false
ApplicationLanguage=
PathAdditions=@Drive\PortableApps\FreeBASIC-0.90.1-win32\
AdditionalFonts=

and tried again. Success again.

Changed computers so the OS would change USB drive letter (to F:\ in this case) and tried again. Success again. All this done on desktops with Windows 7 operating systems, and not the XP laptop that will be the primary machine. But it's working the way I want...

FAILURE

Got back to the XP laptop, which will be the primary machine for GeanyPortable. Made no changes to the files. Had the same compile failures as documented in my first post. Ran GeanyPortable_DEBUG1.exe and the pop-up window entitled "Geany Portable (pipe) PortableApps.com" says:

Path:
F:\PortableApps\GeanyPortable\App\Geany\bin;F:\PortableApps\GeanyPortable\App\Geany\bin;F:\PortableApps\GeanyPortable\App\Geany\bin;F:\PortableApps\GeanyPortable\App\Geany\bin;F:\PortableApps\FreeBASIC-0.90.1-win32\;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\Wbem

F:\ is the drive letter XP assigned to the USB drive. The last drive assigned was F:\ on the second Windows 7 desktop, so I closed GeanyPortable and changed the LastDriveLetter from F: to M: in this file:

F:\PortableApps\GeanyPortable\Data\settings\GeanyPortableSettings.ini

Ran GeanyPortable.exe again. Failure again in compiling, but the LastDriveLetter did change back to F: when I closed GeanyPortable and checked the GeanyPortableSettings.ini file.

So my initial thought (GeanyPortable.ini wasn't being read) was incorrect. And now I'm really stumped. Is this version of GeanyPortable not ready for XP? Won't be back to the internet for about a week.

Dino

Good ideas are OK. The correct solution will get you a popsicle.

John T. Haller
John T. Haller's picture
Offline
Last seen: 7 hours 54 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Don't Change

Don't manually change things in GeanyPortableSettings.ini. That will mess things up internally.

Sometimes, the impossible can become possible, if you're awesome!

DinoApps
Offline
Last seen: 9 years 7 months ago
Joined: 2014-08-27 10:14
Success and Fail Again

Yep, did move back to the oem GeanyPortableSettings.ini file after 2nd failure on the XP machine. The only modified file at this point is the GeanyPortable.ini file and it is the last rendition in previous posting.

And I forgot to mention: tried on a 4th computer today - Windows 7 Pro SP1, with success, and on the oem GeanyPortableSettings.ini file.

Have about three hours then away from internet till next week - one day only.

Dino

Good ideas are OK. The correct solution will get you a popsicle.

John T. Haller
John T. Haller's picture
Offline
Last seen: 7 hours 54 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Fail On Xp

When it fails on XP, what does the DEBUG launcher say the path is set to?

Sometimes, the impossible can become possible, if you're awesome!

DinoApps
Offline
Last seen: 9 years 7 months ago
Joined: 2014-08-27 10:14
XP Failure Path

Documented in the FAILURE section of the "Success and Failure" post.

I will say it's not often a developer gives attention.

Dino

DinoApps
Offline
Last seen: 9 years 7 months ago
Joined: 2014-08-27 10:14
Any XP Solution?

MinGW is now also installed, and tested successfully in C on Windows 7. GeanyPortable will be nice if it will just work on Windows XP.

GeanyPortable.ini file now looks like this:

[GeanyPortable]
AdditionalParameters=
DisableSplashScreen=false
ApplicationLanguage=
PathAdditions=@Drive\PortableApps\FreeBASIC-0.90.1-win32\;@Drive\Progs\MinGW\bin\
AdditionalFonts=

All line endings are LF with the exception of the last line, which has no end-of-line command. All other GeanyPortable files are oem (that is, stock or as originally installed).

Also ran the GeanyPortable_DEBUG1.exe file on Windows 7 with the following results:

Path:
E:\PortableApps\GeanyPortable\App\Geany\bin;E:\PortableApps\GeanyPortable\App\Geany\bin;E:\PortableApps\GeanyPortable\App\Geany\bin;E:\PortableApps\GeanyPortable\App\Geany\bin;E:\PortableApps\FreeBASIC-0.90.1-win32\;E:\Progs\MinGW\bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\

Look at the entries after E:\Progs\MinGW\bin\;
Shouldn't the XP system look similar?

Will be without internet access for two weeks. Might, in the meantime, be able to test on a Windows Vista machine.

I am still stumped,
Dino

p.s. GeanyPortable help files (html and txt) are installed here by default:
\GeanyPortable\App\Geany\doc\

To get the local html help file to open you need to invoke "Edit Preferences Tools" then clear the browser field. Close the dialog box, then close and reopen GeanyPortable. Press F1 and the local Geany html help file opens in the computer's default web browser. This procedure should be stated on the GeanyPortable web page.

John T. Haller
John T. Haller's picture
Offline
Last seen: 7 hours 54 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Confused

I'm confused as above you messed about with stuff in GeanyPortableSettings.ini before posting about the failure on XP. Does it fail on XP if you don't mess with it regardless of what the last drive letter was? If so, please post the DEBUG output of when it is failing and hasn't been manually altered.

Sometimes, the impossible can become possible, if you're awesome!

3D1T0R
3D1T0R's picture
Offline
Last seen: 2 years 12 months ago
Developer
Joined: 2006-12-29 23:48
Use ParameterSpy to compare what command-line fbc.exe is getting

Perhaps Geany is calling fbc.exe differently when on the XP machine?

Try this:

  • Download Parameter Spy (see footnote) and run the EXE (you may have to extract it first)
  • When it asks you if you want to select an executable to replace with Parameter Spy choose "Yes"
  • Browse to your fbc.exe and choose it (it will rename fbc.exe to fbc.psbckp, then save itself as fbc.exe)
  • Try having Geany try to compile your test.bas again, in exactly the same way have before, and in both situations where you would expect it to work and situations where you would expect it not to (based on your previous experiences), and record what parameters it lists in both cases
  • Run Parameter Spy again and choose to replace fbc.exe again, this time it will inform you that there is a Parameter Spy Backup File (that's the psbckp file from earlier) present and you'll choose "Yes" to replace the Parameter Spy EXE with the original EXE again
  • Come back and report your findings here

* The Parameter Spy author's site is gone, but I verified that the EXE in the zip on http://parameter-spy.joydownload.co is identical to what I got from the official download when it was still up)

~3D1T0R

DinoApps
Offline
Last seen: 9 years 7 months ago
Joined: 2014-08-27 10:14
Working on XP, Vista and 7

Had my oh... moment, took notes and went back to bed. This was about a week and a half ago, and haven't had access to internet until now.

The "problem": FreeBASIC and MinGW look for Microsoft's C Runtime library, aka msvcrt.dll, or a numbered equivalent, such as msvcXX.dll where XX is a number. The workaround solution for now is to put a "generic" path into GeanyPortable.ini. For the 32 bit machines the likely paths are C:\WINDOWS\SYSTEM32 or C:\WINDOWS.

I don't have enough hours on Geany to tell if the real issue is Geany or GeanyPortable. I can say that both FreeBASIC and MinGW will find the library when a program is compiled from a Command Prompt window, and FreeBASIC will find the library when a program is compiled from a FreeBASIC dedicated IDE called FBIde. This on XP, Vista and 7. GeanyPortable worked for me only when the path to the library was specified, either through GeanyPortable.ini or by setting the Environment path through Windows, and this on XP, Vista and 7. Remember, GeanyPortable user may not have administrative priveledge at somebody else's computer, so a better solution is needed for the average user.

I will also say that it's a bit of insanity to have the GeanyPortable.ini file as a UNIX file when GeanyPortable is meant for Windows, per the GeanyPortable web page. I spun my wheels for a few hours until I figured that one out - my fault for assuming a well thought-out file. And if the comment line can't be properly formatted then get rid of it and redo the web page instructions.

The two above items are show stoppers for GeanyPortable. The idea is great - think of students... and their teachers. GeanyPortable makes it possible for some real learning. But don't assume average high
school teachers are saavy enough to find those problems and their solutions on their own. Been there on the simpler stuff with them. I'm not a teacher - but wrote my first programs on punchcards, a "few"
years before the wonderful Radio Shack and Commodore TV computers. Not old enough to have programmed on plug-boards. Volunteer with programming, electronics, etc.

Last item is a gentle reminder to let the user know that accessing Geany's local help files is possible without assuming the user is on a live internet connection, as I documented on September 9th.

Mr. Haller, you're confused because you didn't read my August 27th very carefully. Then re-read the FAILURE section of my August 29th post. You'll see the correct sequence of events, including the debug
paths before I "messed about" with GeanyPortableSettings.ini. "Messing about" only after I figured out the bad comment line and the foolish UNIX format in the GeanyPortable.ini file, and looking for why
simple programs refused to compile through GeanyPortable on XP. No harm done by changing GeanyPortableSettings.ini last drive line, by the way, since GeanyPortable's start sequence seems to change it if the file's drive letter doesn't match reality. But I won't tell anybody.

At this point the ONLY modified file is GeanyPortable.ini - I forgot how many times I deleted and reinstalled GeanyPortable on that USB drive.

Thanks for the other troubleshooting ideas, even though I didn't use them. They're pretty good ideas. GeanyPortable is not a "normal" program in that it calls another program (the compiler), and I simply
don't have enough internet access to play around with those ideas.

Thanks, and I'm off to a cold climate for their summer. And I'll be using GeanyPortable.

Dino

Good ideas are OK. The correct solution gets you a popsicle.

3D1T0R
3D1T0R's picture
Offline
Last seen: 2 years 12 months ago
Developer
Joined: 2006-12-29 23:48
Ah, I hadn't thought that a compiler would require MSVC runtime

I hadn't realised that someone would build a compiler that was dynamic linked to DLLs which might not be present without also bundling the necessary DLLs with it, though I suppose I shouldn't be all that surprised.

Anyway, the FreeBasic Compiler says on it's website that it requires the MSVC runtime, so one way to work around that is to add the needed DLL file(s) to the same directory as fbc.exe, or another way is to add the path where the local system has them to your PathAdditions, or you could add them to any one of the folders present in the %PATH% environment variable.

Edit: I just downloaded Geany Portable to see what I can see, did you ever try just adding the correct "Working directory" to the command in Geany's "Set Build Commands" window (Builds > Set Build Commands) instead of adding them to PathAdditions in the INI? you might find it to be easier. I guess the DLL thing will probably still be an issue even if you do this, but for that see the non-'Edit' section of this post.

~3D1T0R

John T. Haller
John T. Haller's picture
Offline
Last seen: 7 hours 54 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
PATH

The local system's path should already include WINDOWS and WINDOWS\system32. If it doesn't, it should be added as that will break lots of software.

PathAdditions simply adds to that existing path. If this specific Windows XP machine is missing the standard PATH details and adding it fixes it, we can consider this case closed.

Sometimes, the impossible can become possible, if you're awesome!

3D1T0R
3D1T0R's picture
Offline
Last seen: 2 years 12 months ago
Developer
Joined: 2006-12-29 23:48
After rereading the PATH mentioned above:

I just reread the PATH mentioned in the "FAILURE" section of one of the above posts, and it indeed is missing some of the standard windows PATH contents, but as DinoApps says that it works when run directly from a command-line I'm doubtful that the host machine's PATH variable is actually missing them.

@DinoApps: could you do 2 more things on the PC that's exhibiting the issue?

  1. Run echo %PATH% on the same command-line you said FreeBasic Compiler succesfully runs from
  2. Use Process Explorer to find out what PATH environment variable Geany.exe and GeanyPortable.exe themselves are using when the issue appears

Please post the results back here.

~3D1T0R

DinoApps
Offline
Last seen: 9 years 7 months ago
Joined: 2014-08-27 10:14
The Real Answer

Summarized as follows for other users:

GeanyPortable1.24 runs the host computer's cmd.exe when the user compiles a program, so a path to cmd.exe must be included somewhere. For portability, that path should be specified in the PathAdditions line of GeanyPortable.ini, which must be located in the same folder as GeanyPortable.exe.

A copy of GeanyPortable.ini is located in the GeanyPortable1.24\Other\Source folder. Best practice is to copy and paste GeanyPortable.ini to the folder where GeanyPortable.exe is located, then edit the pasted GeanyPortable.ini.

Delete the improperly formatted comment line, which begins with #.

Example of PathAdditions line for cmd.exe in the host computer's C:\WINDOWS\System32 folder, and FreeBASIC and MinGW compilers on the usb drive:

PathAdditions=C:\WINDOWS\System32\;@Drive\Progs\Compiler\FreeBASIC\FreeBASIC-1.00.0-win32\;@Drive\Progs\Compiler\MinGW\bin\

GeanyPortable.ini is a UNIX-type file, and it must be saved so that line endings are LF, and not Windows-type CRLF. You may have to use a non-Windows text editor to do this.

******

PortableApps GeanyPortable coders: you can do better. In addition to the above, your code creates multiple copies of modified files. For example, change the toolbar and exit GeanyPortable. Then search for ui_toolbar.xml which is the toolbar settings file. How many copies do you find? I count seven in my version of GeanyPortable1.24, as of this post. Remember, the PortableApps general idea is one user one usb drive, so at best all that is needed is an archive file and a user file.

It is unfortunate that most Windows training starts with just-double-click-it. Perhaps someday GeanyPortable will be usable for the novice and teacher/student user, as I have done with a FreeBASIC specific IDE called FBIde. Imagine for the schoolhouse: class time for learning and non-class time for coding and debugging. It is possible.

******

3D1TOR: thank you. While I was not able to use your ideas in a specific sense, they did get my brain engaged. Summarizing your ideas and questions, after a few hours of testing:

In Geany, putting a compiler path in the Set Build Commands section will not help at this point. Those settings are stored in filetype.language files, and GeanyPortable will create many copies of a particular filetype file, just as is does with ui_toolbar.xml. That is too confusing for the novice or teacher/student user.

Did not try ParameterSpy.

Microsoft's Process Explorer, and its PortableApps version, is phone-home software that needs a live internet connection, so it was of no use to the XP test machine that lives many miles from the internet. The original PATH mentioned in the "FAILURE" section was correct. Minimal paths is a safe computing practice, in my opinion, and GeanyPortable failed at that point on the XP machine because there was no path to cmd.exe, which GeanyPortable needs.

FreeBASIC and MinGW compilers do work as one expects. That is, self-contained and searches relative to the compiler executable for the program language. It is a user created executable (Windows version) that needs msvcrt.dll, provided the user created executable needs something in msvcrt.dll. The original test file did not, as it turned out.

Happy coding,
Dino

John T. Haller
John T. Haller's picture
Offline
Last seen: 7 hours 54 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Multiple Copies, Non-standard paths

Your issue with multiple copies of a file is due to Geany itself. If you'd like that handled, you need to contact the publisher.

If an end user has modified their PATH in non-standard ways, that's usually not something we're going to mess with in portable software. You'll generally only see that on specific personal computers owned by the actual end user. If it breaks things, especially on an outdated and unsupported XP box, that's really on them. Same thing as when an end user breaks Windows by stripping out many IE components. Sure, you can do it, but you definitely shouldn't.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments