Recent

Author Topic: link error: /usr/bin/ld: [library] load command 7 unknown cmd field  (Read 10486 times)

WalterK

  • New Member
  • *
  • Posts: 48
I'll post this again because no one has replied yet, and I didn't see this problem addressed in other threads:

After reloading all Lazarus/FPC software (Mac PPC, OS 10.5.8), I got passed the "can't find Interfaces unit" problem to run into a linking problem:

Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.2.4 [2009/04/05] for powerpc
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Darwin for PowerPC
Compiling /tmp/project1.lpr
Compiling unit1.pas
Assembling unit1
Assembling project1
Linking /tmp/project1
/usr/bin/ld: /System/Library/Frameworks/Carbon.framework/Carbon load command 7 unknown cmd field
/usr/bin/ld: /System/Library/Frameworks/OpenGL.framework/OpenGL load command 7 unknown cmd field
/usr/bin/ld: /usr/lib//libiconv.dylib load command 7 unknown cmd field
/usr/bin/ld: /usr/lib//libc.dylib unknown flags (type) of section 9 (__TEXT,__dof_plockstat) in load command 0
/usr/bin/ld: /System/Library/Frameworks/Carbon.framework/Carbon load command 7 unknown cmd field
/usr/bin/ld: /System/Library/Frameworks/AGL.framework/AGL load command 7 unknown cmd field
/usr/bin/ld: /System/Library/Frameworks/OpenGL.framework/OpenGL load command 7 unknown cmd field
An error occurred while linking
Error: Error while linking

What am I doing wrong?

TIA.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1071
Re: link error: /usr/bin/ld: [library] load command 7 unknown cmd field
« Reply #1 on: March 20, 2011, 09:18:24 pm »
/usr/bin/ld: /System/Library/Frameworks/Carbon.framework/Carbon load command 7 unknown cmd field
[snip]
What am I doing wrong?

You have probably installed a version of Xcode that is not qualified for use with your OS version. Install the latest Xcode 3.1.x release (not 3.2.x or 4, those will only work under Mac OS X 10.6), and make sure that you do not deselect "install support for UNIX development" in case you perform a custom install.

WalterK

  • New Member
  • *
  • Posts: 48
Re: link error: /usr/bin/ld: [library] load command 7 unknown cmd field
« Reply #2 on: March 21, 2011, 03:23:34 am »
THANKS!  That did the trick...

Only now I'm getting a warning message:

ld warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/powerpc-darwin/interfacebase.o

... (probably over a 100 of this type of warning) ...

ld warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/powerpc-darwin/carbon/carbonwsdialogs.o
5259 lines compiled, 44.2 sec
2 hint(s) issued
Project "Project1" successfully built. :)

Any thoughts on that?

Thank you.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1071
Re: link error: /usr/bin/ld: [library] load command 7 unknown cmd field
« Reply #3 on: March 21, 2011, 11:43:52 am »
Only now I'm getting a warning message:

ld warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/powerpc-darwin/interfacebase.o

Those are only warnings, not errors. See http://bugs.freepascal.org/view.php?id=12001 and the linked mailing list message for more details (but I would *not* recommend installing the patched Xcode 3.0 linker mentioned there, since that may result in exactly the same problems as you had before).

The best solution is to update to FPC 2.4.2 and use DWARF instead, but you may want to wait with that until Lazarus 0.9.30 has been released in a couple of days/weeks, since Lazarus 0.9.28 does not work well with FPC 2.4.2. You could also install a Lazarus snapshot, but given the imminent release of the next Lazarus version that's probably not worth it (and generally debugging still works fairly well despite the warnings, except for stepping in procedures that have local formal constant declarations).

WalterK

  • New Member
  • *
  • Posts: 48
Re: link error: /usr/bin/ld: [library] load command 7 unknown cmd field
« Reply #4 on: March 22, 2011, 06:36:01 pm »
I happened to check to see that the new Lazarus packages were "rolled" about four hours ago; so I've installed them.

I'm still getting the above error(s).  PLUS, when Lazarus loads, I'm getting two pop-up dialog warnings that say:

   Unable to open package "cgiLaz".
   This package was marked for installation.

   Unable to open package "CGILazIDE".
   This package was marked for installation.

Otherwise, it seems to compile & run.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1071
Re: link error: /usr/bin/ld: [library] load command 7 unknown cmd field
« Reply #5 on: March 22, 2011, 06:39:39 pm »
I happened to check to see that the new Lazarus packages were "rolled" about four hours ago; so I've installed them.

I'm still getting the above error(s).

They are warnings, not errors. And as I mentioned, they will only go away if you switch from Stabs debug information (-g) to DWARF debug information (-gw).

Quote
  PLUS, when Lazarus loads, I'm getting two pop-up dialog warnings that say:

I can't help with that.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1071
Re: link error: /usr/bin/ld: [library] load command 7 unknown cmd field
« Reply #6 on: March 23, 2011, 10:48:49 am »
PLUS, when Lazarus loads, I'm getting two pop-up dialog warnings that say:

   Unable to open package "cgiLaz".
   This package was marked for installation.

   Unable to open package "CGILazIDE".
   This package was marked for installation.

Apparently, that's mentioned in the Lazarus 0.9.30 release notes: http://wiki.lazarus.freepascal.org/Lazarus_0.9.30_release_notes#CGI

 

TinyPortal © 2005-2018