Recent

Author Topic: Unable to compile on Ubuntu 14.04  (Read 18591 times)

Paolo_R

  • New Member
  • *
  • Posts: 34
Re: Unable to compile on Ubuntu 14.04
« Reply #15 on: November 01, 2015, 11:47:16 pm »

That's strange. The compiler message windows (F12) that should appear during compilation should at least give you an indication of what is wrong exactly.

FWIW:
If you select menu->options->compiler... and select the verbose tab, you can 'tick' several options.

If you 'checkmark' the All option then when you compile a file/project Free Pascal will show you all the files it is trying to locate, show all warnings, hints etc. -> that is the best way to locate Free Pascal and/or toolchain related errors.

I only get a small dialog box with messages "Failed to compile... Line number 0...Total errors 2"

Do you think it's worthwhile uninstalling and reinstalling again?





Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1290
Re: Unable to compile on Ubuntu 14.04
« Reply #16 on: November 01, 2015, 11:56:12 pm »
hello,
Paolo_R what is your version of Ubuntu ?
oops  :-[  Ubuntu 14.04 ,  it's my version of Ubuntu and i have version 2.6.4 in synaptic. Maybe you must update your fp packages.

package fpc and fpc-src :
« Last Edit: November 02, 2015, 12:14:22 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Paolo_R

  • New Member
  • *
  • Posts: 34
Re: Unable to compile on Ubuntu 14.04
« Reply #17 on: November 02, 2015, 12:14:08 am »
I made a mistake in my last post re location of fp.cfg. I do have a copy in my home directory but there is also a copy in my working pascal directory (which contains the testapp.pas).

This fp.cfg in the working pascal directory contains:

-Fl/usr/lib/fpc/2.6.2/units/i386-linux/
-Fl/usr/lib/fpc/2.6.2/units/i386-linux/rtl
-Fl/usr/lib/fpc/2.6.2/

Should I delete the fp.cfg in my home directory?

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Unable to compile on Ubuntu 14.04
« Reply #18 on: November 02, 2015, 12:21:39 am »
I only get a small dialog box with messages "Failed to compile... Line number 0...Total errors 2"
Of course (because i don't have same OS installed as you) i can't speak for how things should work, but under windows it is possible to use the mouse and double-click the top border in order to size the window to larger proportions.

Also when compilation finished you can use the up-down keys to scroll inside the message Window.

You can 'cycle' through windows using F6 and shift-F6 keys instead of using the mouse, and use F5 for 'zooming' the window.

If you'd checkmarked the all options as explained then you should see on one of the first lines at the top of the message window which exact fp.cfg file was being used (location on your disk).

Quote
Do you think it's worthwhile uninstalling and reinstalling again?
If everything else fails then yes.

Right now i believe you have to get yourself a little more familiar with FP-IDE and compilation with Free Pascal as a whole.

It might perhaps be a steep learning curve, but if you hang in there during the 'dark' period you'll be up and running in no time and laugh about these encountered issues (alas always in hindsight of course :-) )

Sorry to butt into your quotes to JP
Quote
Are there different versions of fp.cfg?
That's always possible (and might work confusing). As explained the Show all errors option will tell you exactly which fp.cfg is being used (at top of compiler message window, scroll waaaay up o see if you got all errors option set).

Quote
I have a version in my home directory. Under #IFDEF NORMAL of those options you show only
i believe something might have gone lost during conversation.

The suggestion made by JP entails that you fill in the paths in FP-IDE (or alternatively, copy paste them into fp.cfg, then fire up FP-IDE again to see what changed inside the compiler options inside FP-IDE).

the entries JP showed that starts with:
1) -Fu should be located inside FP-IDE directory options, tab UNITS
2) -Fi should be located inside FP-IDE directory options, tab INCLUDE FILES
3) -Fl should be located inside FP-IDE directory options, tab LIBRARIES

If you do it inside fp.cfg then you can copy paste, in case you do it from within FP-IDE then you need to remove the -Fx parts and only fill in the paths. Each entry goes on a separate line.

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1290
Re: Unable to compile on Ubuntu 14.04
« Reply #19 on: November 02, 2015, 12:28:20 am »
configuration file is in the home directory :
Quote
jurassic@jurassic-VN433:~$ fp
* Free Pascal IDE Version 1.0.12 [2014/04/20]
* Compiler Version 2.6.4
* Using configuration files from: /home/jurassic/
Running "/home/jurassic/free pascal/projects/test fv/testapp "
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Unable to compile on Ubuntu 14.04
« Reply #20 on: November 02, 2015, 12:33:44 am »
@Jurrasic Pork:
Quote
-Fl/usr/lib/fpc/2.6.2/units/i386-linux/
-Fl/usr/lib/fpc/2.6.2/units/i386-linux/rtl
-Fl/usr/lib/fpc/2.6.2/
Shouldn't that read -Fu ? Or does linux installation do this differently ?

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1290
Re: Unable to compile on Ubuntu 14.04
« Reply #21 on: November 02, 2015, 12:45:03 am »
this is what i have in my fpc.cfg file for release mode :
Quote
#IFDEF RELEASE
 -TLinux
 -Mfpc
 -Sg
 -CpATHLON64
 -OpATHLON64
 -Fu/usr/lib/fpc/$fpcversion\units\$fpctarget
 -Fu/usr/lib/fpc/$fpcversion\units\$fpctarget\*
 -Fu/usr/lib/fpc/$fpcversion\units\$fpctarget\rtl
 -Fi/usr/share/fpcsrc/$fpcversion/packages/fv/src
 -Fl/usr/lib/gcc/x86_64-linux-gnu/4.8/32
 -Fl/usr/lib/gcc/x86_64-linux-gnu/4.8
 -XS
 -Xs
 -g-
 -p-
 -b-
 -O2
#ENDIF
and the config files are where you launch fp ( default home directory from a terminal window)
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Paolo_R

  • New Member
  • *
  • Posts: 34
Re: Unable to compile on Ubuntu 14.04
« Reply #22 on: November 02, 2015, 12:48:48 am »

Ubuntu 14.04 ,  it's my version of Ubuntu and i have version 2.6.4 in synaptic. Maybe you must update your fp packages.

JP - I changed the server setting from Australia (where I am) to main server and updated all packages. Synaptic is still showing version 2.6.2. If I search for fpc 2.6.4 no result is returned.

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1290
Re: Unable to compile on Ubuntu 14.04
« Reply #23 on: November 02, 2015, 12:53:06 am »
fpc 2.6.4 version ubuntu 14.04 package  is only for 64 bits architecture  :(
« Last Edit: November 02, 2015, 12:54:52 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Paolo_R

  • New Member
  • *
  • Posts: 34
Re: Unable to compile on Ubuntu 14.04
« Reply #24 on: November 02, 2015, 12:57:50 am »
Molly

Quote
Right now i believe you have to get yourself a little more familiar with FP-IDE and compilation with Free Pascal as a whole.

I've used Turbo Pascal/Turbo Vision for a long time on DOS. It's not Free Pascal IDE that I need to be familiar with - it's the Linux installation and getting FP to work in Linux

Paolo_R

  • New Member
  • *
  • Posts: 34
Re: Unable to compile on Ubuntu 14.04
« Reply #25 on: November 02, 2015, 12:59:11 am »
fpc 2.6.4 version ubuntu 14.04 package  is only for 64 bits architecture  :(

JP - that explains why I can't see it.

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1290
« Last Edit: November 02, 2015, 01:19:44 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Unable to compile on Ubuntu 14.04
« Reply #27 on: November 02, 2015, 01:22:36 am »
I've used Turbo Pascal/Turbo Vision for a long time on DOS. It's not Free Pascal IDE that I need to be familiar with - it's the Linux installation and getting FP to work in Linux
Well, not to offend but Turbo IDE <> FP-IDE.

In Turbo you did not have to set some of the options (weren't even available) that are needed for Free Pascal / FP-IDE.

Unfortunately, i can't 'guess' where your package manager installs all the files. The package manager should be able to tell you that.

In case everything fails (and you are familiar with that as well), try to install midnight commander (which has a pretty good resemblance with old Norton Commander for DOS). It helped me tremendously with my first Linux experience.

Regarding the version of FPC... it doesn't really matter much. Of course there are improvements and new features in later versions, but since you're 'exploring' with Linux, i would just stick with things until you get more familiar with things. You can always opt (at any given time) for downloading a non-package manager version (like JP suggests)  or to compile FP-IDE from source in order to update to a newer version.

Regarding your fp.cfg file inside project directory. I know this is a feature of fpc command-line compiler, but i seem unable to locate something similar for FP-IDE. Simply remove fp.cfg from the project directory and use the global one from user directory.

@Jurrasic Pork:
Thank you for the confirmation.

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1290
Re: Unable to compile on Ubuntu 14.04
« Reply #28 on: November 02, 2015, 01:39:22 am »
success story for fpc  2.6.4 i386 on Ubuntu 14.04

1 - Download fpc sources from here :  http://sourceforge.net/projects/freepascal/files/Source/2.6.4/fpc-2.6.4.source.tar.gz/download
2 - extract the files in your home directory
3 - open a terminal window and go in fpc 2.6.4 sources folder
4 - type make and cross the fingers.
5 - if it is ok copy plateform.inc from packages/fv/src to packages/fv/examples
6 - go in the ide folder and launch fp
7 - open testapp.pas , compile and run
« Last Edit: November 02, 2015, 01:51:32 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Paolo_R

  • New Member
  • *
  • Posts: 34
Re: Unable to compile on Ubuntu 14.04
« Reply #29 on: November 02, 2015, 05:06:55 am »
Quote
3 - open a terminal window and go in fpc 2.6.4 sources folder

JP - I have created a directory (fpc-2.6.4) into which I extracted the tar file.

That directory has the following sub-directories: compiler, ide, installer, packages, rtl, tests and utils plus a Makefile and a Makefile.fpc.

If I issue 'sudo make' from this directory I get:

Targets
all Alias for build
build Build a new compiler and all packages
install Install newly build files
zipinstall Create zip/tar of installed files
singlezipinstall Alias for zipinstall

and that's it.

 

TinyPortal © 2005-2018