Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-07

crosscompiling problems with ld(w) from binutils-2.1.4

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tobias Diekershoff

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello everybody,

this is my first posting here, so please be paitient with me ;)

In 99% of the time I'm using linux, and therefore I'm writing my prgroms for linux. Lately more and more windoze using friends ask me, if I could give them my programs. And as those programs don't have much platform dependent codings it was not a problem to compile them using fpc1.0.10 on the installed win98. But as I was bored to reboot my linux, just to compile a program, I started looking for cross-compiling utils.

I've downloadet GNU binutils 2.1.4 and configured them with the "--target=winnt" option. Compilation worked just fine, and for test purposes I symlinkd as-new, ld-new to asw and ldw. For the first test I took hello-world, but it worked only partly :(

Below I've included the compiler output and the part from fpcdebug.txt, which deals with the error. Can anybody help me?

thx in advance
Tobias

Compiler output:

fpc -Twin32 -FDtmp/binutils/bin -V hello.pas

Free Pascal Compiler version 1.0.10 [2003/06/26] for i386 Copyright (c) 1993-2003 by Florian Klaempfl
Target OS: Win32 for i386
Compiling hello.pas
Linking hello.exe
tmp/binutils/bin/ldw: invalid BFD target `base.$$$' hello.pas(4,1) Error: Error while linking
Closing script ppas.sh

The last lines of fpcdebug.txt dealing with ldw:

00080000:Using util tmp/binutils/bin/ldw
00100000:tmp/binutils/bin/ldw -s -b base.$$$ -o hello.exe link.res 00000002:hello.pas(4,1) Error: Error while linking

- --
http://tobias.d.bei.t-online.de/ -=- PGP User ID: 0x825CE007 -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/J5ajZGcehYJc4AcRAikRAJ47SeSL8UcwJnwra7vPAwKRDaWG2gCeO5ec rep0bhpAhmKGjjLsR8JH1jw=
=/h5E
-----END PGP SIGNATURE-----

L D Blake
to Tobias Diekershoff

In reply to your message of July 30, 2003

00080000:Using util tmp/binutils/bin/ldw 00100000:tmp/binutils/bin/ldw -s -b base.$$$ -o hello.exe link.res 00000002:hello.pas(4,1) Error: Error while linking

Was there a copy of the hello.exe program running at that time?

I get that error all the time, when I forget to exit after testing or a program doesn't exit completely.

-----
L D Blake

Tobias Diekershoff
to L D Blake

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Show quoted text 5 lines
> 00080000:Using util tmp/binutils/bin/ldw > 00100000:tmp/binutils/bin/ldw -s -b base.$$$ -o hello.exe > link.res 00000002:hello.pas(4,1) Error: Error while linking Was there a copy of the hello.exe program running at that time?

No, there wasn't any. I just wrote up the four lines from hello-world and tried to compile it. Actually there isn't any hello.exe jet ;)

so long
Tobias

- --
http://tobias.d.bei.t-online.de/ -=- PGP User ID: 0x825CE007 -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/J+RFZGcehYJc4AcRAnVYAJ4nc62NVzMI3jLy+B6A3+MDK50MugCeLXDP Jyi9YOvPm/VNDTyBqZshi8M=
=n86A
-----END PGP SIGNATURE-----

Marco van de Voort
to Tobias Diekershoff
Show quoted text 11 lines
On Wed, 30 Jul 2003 10:11:11 -0400 L D Blake wrote: > > 00080000:Using util tmp/binutils/bin/ldw > > 00100000:tmp/binutils/bin/ldw -s -b base.$$$ -o hello.exe > > link.res 00000002:hello.pas(4,1) Error: Error while linking > > Was there a copy of the hello.exe program running at that time? No, there wasn't any. I just wrote up the four lines from hello-world and tried to compile it. Actually there isn't any hello.exe jet ;)

It could be that there is some mingw extension to ld, which is missing in the "ordinary" ld. However I don't know that much about Windows' formats.

Jeff Pohlmeyer
But as I was bored to reboot my linux, just to compile a program...

I feel your pain :-o

Another option, maybe to think about:

I have had *some* success running ppc386.exe under WINE, although it doesn't seem to find all of its units properly. So I had to put all of the binaries and units required to run ppc386.exe in the same directory -
~/fake_windows/pp/
or wherever.

This is not exactly a perfect solution, but it beats having to reboot into windows everytime I want to try a piece of cross-platform code.

- Jeff

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com

Tobias Diekershoff
to Jeff Pohlmeyer
This is not exactly a perfect solution, but it beats having to reboot into windows everytime I want to try a piece of cross-platform code.

Hey yes, that works. Somehow ;?)

Among all the output of wine, there are some error messages from fpc ending with

hello.pas(4,1) Error: Error while linking
Closing script ppas.bat

Nevertheless there is suprisingly a working hello.exe.

Thaks for this work-around, although I still would prefer to directly use fpc to cross-compile ;)

so long
Tobias

http://tobias.d.bei.t-online.de/ -=- PGP User ID: 0x825CE007
L D Blake
to Tobias Diekershoff: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, 30 Jul 2003 10:11:11 -0400 L D Blake

In the process of learning about windows programming in FP I've been looking at a lot of source code (some of which reads like Klingon secret code) and I'm beginning to wonder if there is a general strategy for programs that use multiple pop up windows performing different functions like setting options, editing lists, managing queues, etc.

1) Are windows programs generally constructed around a single core window and then everything else is dialogs or is it customary to create several windows from scratch?

2) Should I create windows on the fly, putting registration, creation etc into the a procedure so that when I click a button to open the window it's created and destroyed by the one procedure -- or -- should I register and create all my windows at program startup and just use the show/hide calls to make them visible/invisible as needed?

Or... are there basically no "rules" about this?

-----
L D Blake