FPC problems! 
Author Message
 FPC problems!

Hello!

At first here is some general information:
- FPC 1.0.6 and a 1.0.7 snapshot installed
- standard IDE (no snapshot), which comes with FPC 1.0.6
- RedHat Linux 7.3

I have two problems. I can't compile testvga.pp (hello.pp works).
The first problem is in the IDE, there I got the following error:
"can't find unit sysbsd".

There is no "sysbsd" file on my harddisk (I have searched for 'sysbsd*'),
so I don't know how to solve this problem.

And I have a question: I have read that the IDE has a built-in compiler.
Is it possible to disable it and use the external one instead? Because
there are no snapshot binaries of the IDE, only snapshots binaries of the
command-line compiler, and I know I would run into many problems if I
wanted to compile the snapshot sources.

The second problem (which is curiously different) is when I try to
compile testvga.pp using the command-line compiler. Then I got this
error:
"/usr/bin/ld: cannot find -lvga"

What is "-lvga"? Is it some file that can be found in some package? If
yes, in which one? I got the same error message when trying to compile
"hello.pas" with GNU Pascal Compiler.

Thanks!

Jan



Sun, 12 Dec 2004 07:29:51 GMT  
 FPC problems!
Quote:

> Hello!

> The second problem (which is curiously different) is when I try to
> compile testvga.pp using the command-line compiler. Then I got this
> error:
> "/usr/bin/ld: cannot find -lvga"

> What is "-lvga"? Is it some file that can be found in some package? If
> yes, in which one? I got the same error message when trying to compile
> "hello.pas" with GNU Pascal Compiler.

> Thanks!

> Jan

I had the same problem a long time ago.  Make a symbolic link to
/usr/lib/libsvga.a as /usr/lib/vga.a .

I reported the bug a while back to freepascal and well, they couldn't
reproduce it so they called it "notabug".  You will also have to do this
for other required libraries.



Sun, 12 Dec 2004 05:13:22 GMT  
 FPC problems!

Quote:

> I had the same problem a long time ago.  Make a symbolic link to
> /usr/lib/libsvga.a as /usr/lib/vga.a .

> I reported the bug a while back to freepascal and well, they couldn't
> reproduce it so they called it "notabug".  You will also have to do this
> for other required libraries.

Thanks for the answer, I will try it. But how have you found out the name
of the required symbolic link? (libsvga.a is not the same as vga.a)
What other links will I need to create?

Thanks,
Jan



Mon, 13 Dec 2004 03:12:43 GMT  
 FPC problems!
It's even worse in my case!
I don't have /usr/lib/libsvga.a !!!

What now?

And I have also a similar problem, when trying to compile hello.pas with
GNU Pascal. Then I get this error message:

/usr/bin/ld: cannot find -lgcc

It's always this {*filter*} linker, I hate it. Why can't the Pascal guys put
all necessary files into one package? There are languages that need no
external files, so it should be no problem.



Mon, 13 Dec 2004 06:23:56 GMT  
 FPC problems!

Quote:

> At first here is some general information:
> - FPC 1.0.6 and a 1.0.7 snapshot installed
> - standard IDE (no snapshot), which comes with FPC 1.0.6
> - RedHat Linux 7.3

> I have two problems. I can't compile testvga.pp (hello.pp works).
> The first problem is in the IDE, there I got the following error:
> "can't find unit sysbsd".

That is because you have a 1.0.6 IDE (from the release) and a 1.0.7 RTL
(from the snapshot).

Compiler and RTL have to be in sync.

Quote:
> There is no "sysbsd" file on my harddisk (I have searched for 'sysbsd*'),
> so I don't know how to solve this problem.

The target OS in your IDE is probably set to FreeBSD.

Quote:
> And I have a question: I have read that the IDE has a built-in compiler.
> Is it possible to disable it and use the external one instead?

No.

Quote:
> Because there are no snapshot binaries of the IDE, only snapshots binaries
> of the command-line compiler, and I know I would run into many problems if
> I wanted to compile the snapshot sources.

I'll talk to Michael (who maintains the Linux snapshot generator) if we can
start making IDE snapshots.

IDE snapshots on Linux used to be really unstable, but have improved a lot.
Maybe it is time to include them in the nightly build.

Quote:
> The second problem (which is curiously different) is when I try to
> compile testvga.pp using the command-line compiler. Then I got this
> error:
> "/usr/bin/ld: cannot find -lvga"

There used to be a package VGA, which was later renamed to SVGALIB.

On ordinary Linux/FreeBSD systems this works, but some of the commercial
distributions don't create legacy support anymore.

There should be a libsvga.so somewhere in your path. Eiter from a real lib,
or a symlink to libsvga.so

It could also mean that you miss libsvga all together. Try to search for
a SVGALIB package.

Quote:
> What is "-lvga"? Is it some file that can be found in some package?

It means the linker should link to a C library.

Quote:
> If
> yes, in which one? I got the same error message when trying to compile
> "hello.pas" with GNU Pascal Compiler.

That's odd. If you don't need graphics, you should need it, for the rest the
story is the same as for FPC. This is a setup problem of your *nix.


Mon, 13 Dec 2004 04:05:17 GMT  
 FPC problems!

Quote:
> The target OS in your IDE is probably set to FreeBSD.

Yes, I'm sorry, I haven't seen it.

Quote:
> It could also mean that you miss libsvga all together. Try to search for
> a SVGALIB package.

As I have seen some minutes ago, there is a svgalib unit in the units
directory of FPC. I have typed in the path (into the IDE), the first
error is gone, but now there is another error:

...
Linking /home/jp/freepas/testvga
Using util /usr/bin/ld
/usr/bin/ld  -dynamic-linker=/lib/ld-linux.so.2  -L. -o
/home/jp/freepas/testvga link.res
testvga.pp(24,7) Error: Error while linking
Closing script ppas.sh

And I have one question: why doesn't the compiler search
in all subdirectories of a given path?
When I tell him to look into
/usr/lib/fpc/1.0.6/units/linux/
the compiler looks _only_ into this directory.
I don't want to type in all 20 subdirectories of /usr/lib/.../linux/

I really don't know why the Linux version of FPC is so complicated.
I have used FPC for DOS in the past and I had no problems with it (but of
course most of the problems seem to have something to do with the linker).

Thanks,
Jan



Mon, 13 Dec 2004 07:55:58 GMT  
 FPC problems!

Quote:


>> It could also mean that you miss libsvga all together. Try to search for
>> a SVGALIB package.

> As I have seen some minutes ago, there is a svgalib unit in the units
> directory of FPC. I have typed in the path (into the IDE), the first
> error is gone, but now there is another error:

That is the data for the Pascal _interface_ of the C package SVGALIB.

You still have to install SVGALIB.
  ...

Quote:
> Linking /home/jp/freepas/testvga
> Using util /usr/bin/ld
> /usr/bin/ld  -dynamic-linker=/lib/ld-linux.so.2  -L. -o
> /home/jp/freepas/testvga link.res
> testvga.pp(24,7) Error: Error while linking
> Closing script ppas.sh

The reason why it failes isn't specified. Hard to say.

Quote:
> And I have one question: why doesn't the compiler search
> in all subdirectories of a given path?
> When I tell him to look into
> /usr/lib/fpc/1.0.6/units/linux/
> the compiler looks _only_ into this directory.
> I don't want to type in all 20 subdirectories of /usr/lib/.../linux/

put

 /usr/lib/fpc/1.0.6/units/linux/*

in the IDE units dir, or

-Fu/usr/lib/fpc/1.0.6/units/linux/*

in your ppc386.cfg (for the commandline compiler)

Quote:
> I really don't know why the Linux version of FPC is so complicated.

It isn't, really ;-) Just try to read some docs.

E.g. the VGA issue is in the FAQ.



Mon, 13 Dec 2004 04:59:53 GMT  
 FPC problems!

Quote:
> You still have to install SVGALIB.

OK, I have downloaded and installed the svgalib package, I also had to
install libc5. But the problem still remains (now there is even more):

ppc386 testvga.pp
...
Linking testvga
/lib/libvga.so: undefined reference to `_xstat'
/lib/libm.so.5: undefined reference to `__getfpucw'
/lib/libvga.so: undefined reference to `_fxstat'
testvga.pp(24,4) Error: Error while linking
Closing script ppas.sh

Quote:
> put

>  /usr/lib/fpc/1.0.6/units/linux/*

> in the IDE units dir, or

> -Fu/usr/lib/fpc/1.0.6/units/linux/*

> in your ppc386.cfg (for the commandline compiler)

OK, thanks, this works now.


Tue, 14 Dec 2004 07:38:52 GMT  
 FPC problems!
Can you please tell me what "-lgpm" means???

I wanted to test the video unit, because I want to rewrite a DOS program,
which uses direct screen writing (in text mode), and the video unit seems
to have all I need. But the linker (again) refuses to work.

/usr/bin/ld: cannot find -lgpm

I also had

cannot find -lgcc

when I wanted to compile "hello.pas" with GNU Pascal. -lgcc could be the
gnu c-compiler libraries, but I have all gnu c-compiler files installed.

If this strange things won't stop, I will probably continue writing
programs for old good DOS.

Thanks,
Jan



Tue, 14 Dec 2004 23:53:06 GMT  
 FPC problems!

Quote:

> Can you please tell me what "-lgpm" means???

It means that the library "gpm" should be linked in. (it is pretty much
the same as {$linklib gpm} in the source.

Gpm is the textmodem mouse driver.

Quote:
> I wanted to test the video unit, because I want to rewrite a DOS program,
> which uses direct screen writing (in text mode), and the video unit seems
> to have all I need. But the linker (again) refuses to work.

Install GPM, or recompile mouse unit, and other units dependant on it
with -dNOGPM or -dNOMOUSE.

Quote:
> I also had

> cannot find -lgcc

This is more strange.

Quote:
> when I wanted to compile "hello.pas" with GNU Pascal. -lgcc could be the
> gnu c-compiler libraries, but I have all gnu c-compiler files installed.

Then you maybe have a different path where the gcc libraries are than usual,
or somehow the autodetect went wrong.

You have to specify it using -Fl/path/to/gcc-lib-directory  in ppc386.cfg or
the commandline. E.g.

-Fl/usr/lib/gcc-lib/i386-linux/2.95.2

for my (very old, and several times upgraded) Debian installation.

Quote:
> If this strange things won't stop, I will probably continue writing
> programs for old good DOS.

Its the bump to move to a new compiler (and maybe also OS). It is always
cultureshock, since you got nice and comfortable with your current compiler
over the years. There is nothing you can do than sit it out, and master the
basics. After a few weeks tinkering, it'll get better and easier.


Fri, 17 Dec 2004 22:47:41 GMT  
 FPC problems!

Quote:

> I also had

> cannot find -lgcc

> when I wanted to compile "hello.pas" with GNU Pascal. -lgcc could be the
> gnu c-compiler libraries, but I have all gnu c-compiler files installed.

With GNU Pascal you must have installed a gcc compiler with the same version number
as gpc, at least all the files that this gcc compiler puts in the directory
...lib/gcc-lib/<system>/<version>
(for 2.95.3 they are cc1 collect2 cpp0 libgcc.a specs SYSCALLS.cX)
You can simultaneously use an other (newer) version of gcc which
puts its files into a different directory (different <version>)

Maurice

--
        Maurice Lombardi
Laboratoire de  Spectrometrie Physique,
Universite Joseph Fourier de Grenoble, BP87
38402 Saint Martin d'Heres Cedex     FRANCE
Tel: 33 (0)4 76 51 47 51
Fax: 33 (0)4 76 63 54 95



Sun, 19 Dec 2004 00:51:29 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. FPC:problem with printing from fpc programs

2. FPC Problems

3. FPC: translate execvp from c to FPC

4. Some problem with FPC and Gtk

5. FPC - Socket Problem

6. FPC: no more linking problems

7. problems with Free Pascal Editor IDE for FPC

8. Problem with interfaces (FPC)

9. Printing problem again FPC under linux

10. fpc mysql.pp problem

11. FPC & BP- Set type problems

12. Invalid Pointer Operation after FPC 1.00 installation and an Ansistring problem

 

 
Powered by phpBB® Forum Software