Installing FreeBASIC and FBIde

New to FreeBASIC? Post your questions here.
Post Reply
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Installing FreeBASIC and FBIde

Post by BasicCoder2 »

Have just bought a new laptop Window8 touch screen and am facing the nightmare of trying to download and install FreeBasic with the FBIde again. I am useless at setting paths etc nothing ever seems to work right so used the installer option at

http://fbide.freebasic.net/download

chose,

FBIde + FreeBASIC installer

Wrote and ran a test program with this result?

Command executed:
"C:\FreeBasic\fbc.exe" "C:\Program Files (x86)\FreeBASIC\hello.bas"

Compiler output:
C:\FreeBasic\bin\win32\ld.exe: cannot open output file C:\Program Files (x86)\FreeBASIC\hello.exe: Permission denied

Results:
Compilation failed

System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 0.23.0 (08-14-2011) for win32 (target:win32)
OS: Windows NT 6.2 (build 9200)
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Installing FreeBASIC and FBIde

Post by dodicat »

Hi Basic Coder2.
Just download the zip files and expand then into a desktop folder.
Just keep fbide inside the freebasic folder in a little folder called Ide or something.
No need whatsoever for paths, as soon as you start fbide I'll ask for the location of fbc.exe, just direct it to it the file with the mouse.
Stick the .chm file somewhere also after you have expanded it.
Then direct fbide to the help file.
If you want to directly get fbc by console, get a hold of start_shell.exe, or even make you own start_shell.exe with
shell("cmd").
Put this .exe beside fbc.exe.
Luckily fbide doesn't need things on path like ScITE and various other editors.

I have two desktop folders, one with fbc from this site, and the other, the Full Monty with gcc from the German site.
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Re: Installing FreeBASIC and FBIde

Post by anonymous1337 »

Compiler output:
C:\FreeBasic\bin\win32\ld.exe: cannot open output file C:\Program Files (x86)\FreeBASIC\hello.exe: Permission denied
Sounds like security settings are an issue.

I don't know if the Windows 8 interface changes file/folder permissions at all, but FreeBASIC isn't being given access to create that exe in the destination folder.

Try right-clicking the folder, Properties | Security | Advanced (Or Edit)

Make sure that the permissions are set appropriately so that FreeBASIC can write those files.

An alternative is that something has a file lock on hello.exe. I'm not sure that's very likely, however.
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Re: Installing FreeBASIC and FBIde

Post by sir_mud »

Windows Vista and up restrict writing to certain system folders like Program Files to help deflect some simple security issues. Simple resolution is copy any files you want to compile to a directory you can write to like C:\projects or your My Documents folder.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Installing FreeBASIC and FBIde

Post by BasicCoder2 »

Thank you for all your replies. I am going to have to spend time learning this Windows8 stuff which may take some time then I will come back to trying to install freeBasic and the fbIde. The problem is being told to do X is not much use if not also being told exactly (step by step) how to do X.
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Re: Installing FreeBASIC and FBIde

Post by anonymous1337 »

BasicCoder2:

This isn't so much a Windows 8 issue as it is a general computer security problem.

From your post, it looks as though you are putting your FreeBASIC programs in the C:\Program Files (x86)\FreeBASIC directory.

Move your development environment (FBIde, Compiler, .bas files, etc.) into another folder, such as C:\Dev\FreeBASIC.

You shouldn't have any problems creating executables in folders you have created. The Program Files folder is protected by default, which is why the compiler isn't able to create hello.exe.

Let me know if you need additional (ex: more detailed) instructions...
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Installing FreeBASIC and FBIde

Post by BasicCoder2 »

@anonymous1337
I ran the FBIde0.4.6r4-FreeBASIC0.23 installer program and installed it in C:/FreeBasic folder and it seems to work ok except it starts with a warning pop up window asking if I want FBIde.exe to make changes to this computer. I don't know what changes it would make to the computer itself.
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Re: Installing FreeBASIC and FBIde

Post by anonymous1337 »

BasicCoder2:

Thank you for being patient. I think you can learn more about your computer in the process of solving this kind of problem. Roles/permissions and file securities are actually really important, at least in professional development environments.

I understand that you have installed FBIde in the specified location of "C:\FreeBASIC", but it appears that your code is in a different folder. When FBC compiles your code, it will try and compile "C:\Program Files (x86)\FreeBASIC\hello.bas" into "C:\Program Files (x86)\FreeBASIC\hello.exe". Chances are, it doesn't have permissions to write files in that directory.

Can you do me a favor and check to make sure that "hello.bas" isn't stored in the "C:\Program Files (x86)\FreeBASIC" directory?

FBIde is really just a fancy text editor. FBC.exe is what turns code files into executable programs. Windows has a problem with FBC trying to create executable files in one of its privileged folders - program files.
it seems to work ok except it starts with a warning pop up window asking if I want FBIde.exe to make changes to this computer. I don't know what changes it would make to the computer itself.
That's just a standard message that appears when programs require administrative privileges to run. I'm not sure exactly if FBIde needs to make many changes to your system in order to install, but Windows has no way of telling that.

All it knows is that FBIde wants admin privileges, so it asks whether or not that's okay. Just standard Windows warnings :)
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Installing FreeBASIC and FBIde

Post by BasicCoder2 »

anonymous1337 wrote:BasicCoder2:
Thank you for being patient.
Thank you for responding to the problem.

Since your first post I have reinstalled FBIde in the folder C:\FreeBasic instead of in the folder "C:\Program Files (x86)\FreeBASIC and it now compiles source code and runs the compiled code from any folder (or usb RAM stick) without any problems which was the problem I started this thread about. This is another problem when I start up FBIde itself.

What happens is when I start FBIde from the File Explorer or its shortcut Desktop icon or its tile in the Start screen it pops up a request for permission to run FBIde claiming FBIde wants to modify the computer.

Clicking on the text "Change when these notifications appear" it pops up another window titled,

"User Account Control Settings" where you can choose under what conditions you want to be notified about changes to your computer.

The current setting is the default "Notify me only when apps try to make changes to my computer". I don't see why FBIde would be making any changes to the computer whenever it starts up. I figure it must be a windows8 issue for I don't remember it happening with the older Windows. All the other apps that came with Windows do not trigger the request to continue. The programs compiled from FBIde start up and run ok.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Installing FreeBASIC and FBIde

Post by dodicat »

I had this problem with the PC utilities firewall in Win 2000.
I cured it by changing the firewall settings, but every now and then it would revert back to default, just to keep me on my toes I suspect.
I use XP now, I don't know anything about Win 8 unfortunately, but could it be the Windows firewall?
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Installing FreeBASIC and FBIde

Post by BasicCoder2 »

@dodicat
Yes it seems like it could be a Windows8 firewall or even Norton. As mentioned above you can change the settings but I assume it would change for every application taking away protection from any new app that might be dangerous. Maybe when I learn more about Windows8 I will find the answer. Learning a different way of doing something you can already do the old way requires some effort but I guess it keeps the brain in good working condition :) An ideal operating system would accept questions and give answers or even fix the problem all by itself using feedback from the user like, "nope I didn't mean that" or "yes it works now".
Last edited by BasicCoder2 on Apr 21, 2013 21:50, edited 1 time in total.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Installing FreeBASIC and FBIde

Post by marcov »

Afaik Windows Defender (the Microsoft antivirus) is default enabled on Win8.

First test if turning it off (completely) solves anything, and then you can try reenabling it with some directories excluded.

But that doesn't solve UAC issues, stay away from "Program Files/" and "Program Files(x86)/"
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Re: Installing FreeBASIC and FBIde

Post by anonymous1337 »

Protip: You can often tell the more experienced developer as being the one who (appropriately) uses the more specific accronym/tech jargon for the given situation.
anonymous1337 wrote:Windows roles/permissions
marcov wrote:UAC (User Account Control)
I'm afraid of calling this law anything out of fear that rookie programmers will begin terminology debates, the consequences of which are as-of-yet unforeseen :)
Post Reply