Problem with link in Power C

Started by bacon, January 31, 2008, 05:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bacon

I'm not a C programmer (although I know the absolute basics) but I thought I'd try some C programming on the 128, jus for fun. When following the instructions in the manual how to compile the test.c program on the Power C disk everything goes well until I run the link command. The computer locks up and the disk drive sits there spinning and reading (or writing, I don't know which) forever. In VICE I can see that the drive switches between track 18 and track 13 over and over. This happens with every copy of Power C I've found online and it happens on my real C128 + 1541-II drive, in VICE on my Linux box at home and on WinVICE at work (ahem...). Anyone else experiencing this problem?
Bacon
-------------------------------------------------------
Das rubbernecken Sichtseeren keepen das cotton-pickenen Hands in die Pockets muss; relaxen und watschen die Blinkenlichten.

hannenz

#1
hmm... sounds really strange... at which stage of linking does this occur? when you link "test.o" ? or the libs (up-arrow) ? Do you give any options to the linker? It is known that the linker crashes if it is fed with an invalid object file, so it seems that the object file "test.o" must be corrupted in some way, so try recompiling it... please give detailed info on what you are typing in..., it should be something like:

[insert powerc-128-sys-disk]
> cc -n test.c
> [compiler output]
> link
> test.o
[insert powerc-128-lib-disk]
> ^
output filename: test
>


EDIT: I just tested with VICE/Linux and the disk image i uploaded at my hp (http://people.freenet.de/hannenz/powerc/powerc.html) and it works with the commands above:

bacon

I followed the instructions in the Power C manual (e-text from Project 64), which means I didn't pass any options to the compiler. It linked test.o as it should but it failed when linking the libs (up-arrow). I'll try it with the -n option.
Bacon
-------------------------------------------------------
Das rubbernecken Sichtseeren keepen das cotton-pickenen Hands in die Pockets muss; relaxen und watschen die Blinkenlichten.

bacon

Nope, didn't help. Maybe this version of Power C expects the libraries to be on the same disk as the object file (I'm using the D64 images with the libraries on a seperate disk)? I'll try it later with the version from your site.
Bacon
-------------------------------------------------------
Das rubbernecken Sichtseeren keepen das cotton-pickenen Hands in die Pockets muss; relaxen und watschen die Blinkenlichten.

hannenz

no, the libraries are always on an extra disk, that's not the problem, since if the linker doesn't find a special file from a lib, it issues
62, file not found, x, y
as i said, there must be a problem with one of the object files it tries to load. Please try linking "test.o" but then press RETURN alone, so that the linker prints out all missing modules, and post it here. One of them must be corrupted, thats the only possibility i can imagine; still being very strange since you say, you tested different disk images... can't imagine that they are all broken in the same way...???!

hannenz

Do you TRIM the object file??! If yes, try recompiling and DON'T trim it. I just recall that though i didn't experience any bugs when trimmimg obj files on the c64 version, i had many cases similar to your description, when trying to link a trimmed obj file on the 128er version of Power-C. I am nearly 100% sure now, that that's the problem!!!

bacon

Yes, as I said, I followed the instructions in the manual and it said there to trim. That must be it. Thanks!
Bacon
-------------------------------------------------------
Das rubbernecken Sichtseeren keepen das cotton-pickenen Hands in die Pockets muss; relaxen und watschen die Blinkenlichten.