Recent

Author Topic: error while linking  (Read 17456 times)

beppe_1964

  • New member
  • *
  • Posts: 6
error while linking
« on: February 04, 2011, 11:30:51 pm »
hi all,
i come from windows and delphi , i installed lazarus 0.9.31 + fpc 2.4.2 on a mac os snowleopard 10.6.3 .
i did a very simple application , a form with a hello and i have a 'error while linking' error when i try to build the application .
in the message box i see some messages but at the end remain only one row with the 'error while linking' message.
i really don't know how to solve it.
Thanks in advance
Beppe

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: error while linking
« Reply #1 on: February 04, 2011, 11:34:06 pm »
Did you install Xcode? That's where the linker and other tools that FPC needs come from.

You can Ctrl+Click (right-click) in the message box and copy all messages, including any hidden ones, to the clipboard. Then you can paste them into a text editor. That may provide more information.

Thanks.

-Phil

beppe_1964

  • New member
  • *
  • Posts: 6
Re: error while linking
« Reply #2 on: February 04, 2011, 11:51:21 pm »
hi Phil,
i installed XcodeTools.mpkg ,do i need to install some other packages?

sorry to bother you but i am a newbie in Mac world.

 %)


beppe_1964

  • New member
  • *
  • Posts: 6
Re: error while linking
« Reply #3 on: February 04, 2011, 11:56:17 pm »
Handling option "-l"
interpreting firstpass option "-l"
Handling option "-dLCL"
interpreting firstpass option "-dLCL"
Handling option "-dLCLcarbon"
interpreting firstpass option "-dLCLcarbon"
Hint: Start of reading config file /etc/fpc.cfg
interpreting file option "#"
interpreting file option "# Example fpc.cfg for Free Pascal Compiler"
interpreting file option "#"
interpreting file option "# ----------------------"
interpreting file option "# Defines (preprocessor)"
interpreting file option "# ----------------------"
interpreting file option "#"
interpreting file option "# nested #IFNDEF, #IFDEF, #ENDIF, #ELSE, #DEFINE, #UNDEF are allowed"
interpreting file option "#"
interpreting file option "# -d is the same as #DEFINE"
interpreting file option "# -u is the same as #UNDEF"
interpreting file option "#"
interpreting file option "#"
interpreting file option "# Some examples (for switches see below, and the -? helppages)"
interpreting file option "#"
interpreting file option "# Try compiling with the -dRELEASE or -dDEBUG on the commandline"
interpreting file option "#"
interpreting file option "# For a release compile with optimizes and strip debuginfo"
interpreting file option "#IFDEF RELEASE"
interpreting file option "#WRITE Compiling Release Version"
interpreting file option "#ENDIF"
interpreting file option "# For a debug version compile with debuginfo and all codegeneration checks on"
interpreting file option "#IFDEF DEBUG"
interpreting file option "#WRITE Compiling Debug Version"
interpreting file option "#ENDIF"
interpreting file option "# set binutils prefix"
interpreting file option "#IFNDEF CPUI386"
interpreting file option "#IFNDEF CPUAMD64"
interpreting file option "#DEFINE NEEDCROSSBINUTILS"
interpreting file option "#ENDIF"
interpreting file option "#ENDIF"
interpreting file option "#ifdef darwin"
interpreting file option "#undef NEEDCROSSBINUTILS"
interpreting file option "#endif"
interpreting file option "#IFDEF FPC_CROSSCOMPILING"
interpreting file option "#IFDEF NEEDCROSSBINUTILS"
interpreting file option "#ENDIF NEEDCROSSBINUTILS"
interpreting file option "#ENDIF"
interpreting file option "# assembling"
interpreting file option "#ifdef darwin"
interpreting file option "# use pipes instead of temporary files for assembling"
Handling option "-ap"
interpreting option "-ap"
interpreting file option "#endif"
interpreting file option "# ----------------"
interpreting file option "# Parsing switches"
interpreting file option "# ----------------"
interpreting file option "# Pascal language mode"
interpreting file option "#      -Mfpc      free pascal dialect (default)"
interpreting file option "#      -Mobjfpc   switch some Delphi 2 extensions on"
interpreting file option "#      -Mdelphi   tries to be Delphi compatible"
interpreting file option "#      -Mtp       tries to be TP/BP 7.0 compatible"
interpreting file option "#      -Mgpc      tries to be gpc compatible"
interpreting file option "#      -Mmacpas   tries to be compatible to the macintosh pascal dialects"
interpreting file option "#"
interpreting file option "# Turn on Object Pascal extensions by default"
interpreting file option "#-Mobjfpc"
interpreting file option "# Assembler reader mode"
interpreting file option "#      -Rdefault  use default assembler"
interpreting file option "#      -Ratt      read AT&T style assembler"
interpreting file option "#      -Rintel    read Intel style assembler"
interpreting file option "#"
interpreting file option "# All assembler blocks are AT&T styled by default"
interpreting file option "#-Ratt"
interpreting file option "# Semantic checking"
interpreting file option "#      -S2        same as -Mobjfpc"
interpreting file option "#      -Sc        supports operators like C (*=,+=,/= and -=)"
interpreting file option "#      -Sa        include assertion code."
interpreting file option "#      -Sd        same as -Mdelphi"
interpreting file option "#      -Se<x>     error options. <x> is a combination of the following:"
interpreting file option "#         <n> : compiler stops after the <n> errors (default is 1)"
interpreting file option "#         w : compiler stops also after warnings"
interpreting file option "#         n : compiler stops also after notes"
interpreting file option "#         h : compiler stops also after hints"
interpreting file option "#      -Sg        allow LABEL and GOTO"
interpreting file option "#      -Sh        Use ansistrings"
interpreting file option "#      -Si        support C++ styled INLINE"
interpreting file option "#      -Sk        load fpcylix unit"
interpreting file option "#      -SI<x>     set interface style to <x>"
interpreting file option "#         -SIcom     COM compatible interface (default)"
interpreting file option "#         -SIcorba   CORBA compatible interface"
interpreting file option "#      -Sm        support macros like C (global)"
interpreting file option "#      -So        same as -Mtp"
interpreting file option "#      -Sp        same as -Mgpc"
interpreting file option "#      -Ss        constructor name must be init (destructor must be done)"
interpreting file option "#      -St        allow static keyword in objects"
interpreting file option "#      -Sx        enable exception keywords (default in Delphi/ObjFPC modes)"
interpreting file option "#"
interpreting file option "# Allow goto, inline, C-operators, C-vars"
Handling option "-Sgic"
interpreting option "-Sgic"
interpreting file option "# ---------------"
interpreting file option "# Code generation"
interpreting file option "# ---------------"
interpreting file option "# Uncomment the next line if you always want static/dynamic units by default"
interpreting file option "# (can be overruled with -CD, -CS at the commandline)"
interpreting file option "#-CS"
interpreting file option "#-CD"
interpreting file option "# Set the default heapsize to 8Mb"
interpreting file option "#-Ch8000000"
interpreting file option "# Set default codegeneration checks (iocheck, overflow, range, stack)"
interpreting file option "#-Ci"
interpreting file option "#-Co"
interpreting file option "#-Cr"
interpreting file option "#-Ct"
interpreting file option "# Optimizer switches"
interpreting file option "# -Os        generate smaller code"
interpreting file option "# -O1        level 1 optimizations (quick optimizations, debuggable)"
interpreting file option "# -O2        level 2 optimizations (-O1 + optimizations which make debugging more difficult)"
interpreting file option "# -O3        level 3 optimizations (-O2 + optimizations which also may make the program slower rather than faster)"
interpreting file option "# -Op<x>     set target cpu for optimizing, see fpc -i for possible values"
interpreting file option "#"
interpreting file option "# See "fpc -i" also for more fine-grained control over which optimizations"
interpreting file option "# to perform"
interpreting file option "#ifdef darwin"
interpreting file option "#ifdef cpui386"
Handling option "-Cppentiumm"
interpreting option "-Cppentiumm"
Handling option "-Oppentiumm"
interpreting option "-Oppentiumm"
interpreting file option "#endif"
interpreting file option "#endif"
interpreting file option "# -----------------------"
interpreting file option "# Set Filenames and Paths"
interpreting file option "# -----------------------"
interpreting file option "# Slashes are also allowed under dos"
interpreting file option "# path to the messagefile, not necessary anymore but can be used to override"
interpreting file option "# the default language"
interpreting file option "#-Fr/usr/local/lib/fpc/2.4.2/msg/errore.msg"
interpreting file option "#-Fr/usr/local/lib/fpc/2.4.2/msg/errorn.msg"
interpreting file option "#IFDEF FPCAPACHE_1_3"
interpreting file option "#ELSE"
interpreting file option "#IFDEF FPCAPACHE_2_0"
interpreting file option "#ELSE"
Handling option "-Fu/usr/local/lib/fpc/2.4.2/units/i386-darwin/httpd22"
interpreting option "-Fu/usr/local/lib/fpc/2.4.2/units/i386-darwin/httpd22"
interpreting file option "#ENDIF"
interpreting file option "#ENDIF"
interpreting file option "# searchpath for units and other system dependent things"
Handling option "-Fu/usr/local/lib/fpc/2.4.2/units/i386-darwin"
interpreting option "-Fu/usr/local/lib/fpc/2.4.2/units/i386-darwin"
Handling option "-Fu/usr/local/lib/fpc/2.4.2/units/i386-darwin/*"
interpreting option "-Fu/usr/local/lib/fpc/2.4.2/units/i386-darwin/*"
Handling option "-Fu/usr/local/lib/fpc/2.4.2/units/i386-darwin/rtl"
interpreting option "-Fu/usr/local/lib/fpc/2.4.2/units/i386-darwin/rtl"
interpreting file option "#-Fu~/fpc/packages/base/*/units/;~/fpc/fcl/units/;~/fpc/rtl/units/"
interpreting file option "# searchpath for libraries"
interpreting file option "#ifdef cpux86_64"
interpreting file option "#endif"
interpreting file option "#ifdef cpupowerpc"
interpreting file option "#endif"
interpreting file option "#ifdef cpupowerpc64"
interpreting file option "#endif"
interpreting file option "#ifdef cpui386"
Handling option "-Fl/usr/lib"
interpreting option "-Fl/usr/lib"
interpreting file option "#endif"
interpreting file option "#-Fl/pp/lib"
interpreting file option "#-Fl/lib;/usr/lib"
interpreting file option "# -------------"
interpreting file option "# Linking"
interpreting file option "# -------------"
interpreting file option "# generate always debugging information for GDB (slows down the compiling"
interpreting file option "# process)"
interpreting file option "#      -gc        generate checks for pointers"
interpreting file option "#      -gd        use dbx"
interpreting file option "#      -gg        use gsym"
interpreting file option "#      -gh        use heap trace unit (for memory leak debugging)"
interpreting file option "#      -gl        use line info unit to show more info for backtraces"
interpreting file option "#      -gv        generates programs tracable with valgrind"
interpreting file option "#      -gw        generate dwarf debugging info"
interpreting file option "#"
interpreting file option "# Enable debuginfo and use the line info unit by default"
interpreting file option "#-gl"
interpreting file option "# always pass an option to the linker"
interpreting file option "#-k-s"
interpreting file option "# Always strip debuginfo from the executable"
Handling option "-Xs"
interpreting option "-Xs"
interpreting file option "# -------------"
interpreting file option "# Miscellaneous"
interpreting file option "# -------------"
interpreting file option "# Write always a nice FPC logo ;)"
Handling option "-l"
interpreting option "-l"
interpreting file option "# Verbosity"
interpreting file option "#      e : Show errors (default)       d : Show debug info"
interpreting file option "#      w : Show warnings               u : Show unit info"
interpreting file option "#      n : Show notes                  t : Show tried/used files"
interpreting file option "#      h : Show hints                  c : Show conditionals"
interpreting file option "#      i : Show general info           d : Show debug info"
interpreting file option "#      l : Show linenumbers            r : Rhide/GCC compatibility mode"
interpreting file option "#      a : Show everything             x : Executable info (Win32 only)"
interpreting file option "#      b : Write file names messages with full path"
interpreting file option "#      v : write fpcdebug.txt with     p : Write tree.log with parse tree"
interpreting file option "#          lots of debugging info"
interpreting file option "#"
interpreting file option "# Display Info, Warnings and Notes"
Handling option "-viwn"
interpreting option "-viwn"
interpreting file option "# If you don't want so much verbosity use"
interpreting file option "#-vw"
interpreting file option "#"
interpreting file option "# That's all folks"
interpreting file option "#"
Hint: End of reading config file /etc/fpc.cfg
Handling option "-B"
interpreting option "-B"
Handling option "-MObjFPC"
interpreting option "-MObjFPC"
Handling option "-Scghi"
interpreting option "-Scghi"
Handling option "-O1"
interpreting option "-O1"
Handling option "-OpPENTIUM4"
interpreting option "-OpPENTIUM4"
Handling option "-gl"
interpreting option "-gl"
Handling option "-k-framework"
interpreting option "-k-framework"
Handling option "-kCarbon"
interpreting option "-kCarbon"
Handling option "-k-framework"
interpreting option "-k-framework"
Handling option "-kOpenGL"
interpreting option "-kOpenGL"
Handling option "-k-dylib_file"
interpreting option "-k-dylib_file"
Handling option "-k/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
interpreting option "-k/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
Handling option "-vewnhibdp"
interpreting option "-vewnhibdp"
Handling option "-l"
interpreting option "-l"
Handling option "-Fi/Developer/lazarus/examples/lib/i386-darwin"
interpreting option "-Fi/Developer/lazarus/examples/lib/i386-darwin"
Handling option "-Fu/Developer/lazarus/lcl/units/i386-darwin"
interpreting option "-Fu/Developer/lazarus/lcl/units/i386-darwin"
Handling option "-Fu/Developer/lazarus/lcl/units/i386-darwin/carbon"
interpreting option "-Fu/Developer/lazarus/lcl/units/i386-darwin/carbon"
Handling option "-Fu/Developer/lazarus/packager/units/i386-darwin"
interpreting option "-Fu/Developer/lazarus/packager/units/i386-darwin"
Handling option "-Fu/Developer/lazarus/examples/"
interpreting option "-Fu/Developer/lazarus/examples/"
Handling option "-FU/Developer/lazarus/examples/lib/i386-darwin/"
interpreting option "-FU/Developer/lazarus/examples/lib/i386-darwin/"
Handling option "-oprova_beppe2"
interpreting option "-oprova_beppe2"
Handling option "-dLCL"
interpreting option "-dLCL"
Handling option "-dLCLcarbon"
interpreting option "-dLCLcarbon"
Handling option "prova_beppe2.lpr"
found source file name "prova_beppe2.lpr"
Free Pascal Compiler version 2.4.2 [2010/11/09] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Compiler OS: Darwin for i386
Target OS: Darwin for i386
Compiling prova_beppe2.lpr
/Developer/lazarus/examples/prova_beppe2.lpr(3,2)  Handling switch "$MODE"
/Developer/lazarus/examples/prova_beppe2.lpr(8,10)  Handling switch "$ENDIF"
Compiling u_prova.pas
/Developer/lazarus/examples/u_prova.pas(3,2)  Handling switch "$MODE"
/Developer/lazarus/examples/u_prova.pas(27,2)  Handling switch "$R"
Assembling (pipe) /Developer/lazarus/examples/lib/i386-darwin/u_prova.s
/Developer/lazarus/examples/prova_beppe2.lpr(13,2)  Handling switch "$R"
Assembling (pipe) /Developer/lazarus/examples/lib/i386-darwin/prova_beppe2.s
Compiling resource /Developer/lazarus/examples/lib/i386-darwin/prova_beppe2.or
Calling resource compiler "/usr/local/bin/fpcres" with "-o /Developer/lazarus/examples/lib/i386-darwin/prova_beppe2.or -a i386 -of mach-o -v "@/Developer/lazarus/examples/lib/i386-darwin/prova_beppe2.reslst"" as command line
Debug: parsing command line parameters
Debug: parsing parameter '-o'
Debug: parsing parameter '-a'
Debug: parsing parameter '-of'
Debug: parsing parameter '-v'
Debug: parsing parameter '@/Developer/lazarus/examples/lib/i386-darwin/prova_beppe2.reslst'
Debug: parsing parameter '/Developer/lazarus/lcl/units/i386-darwin/finddlgunit.lfm'
Debug: parsing parameter '/Developer/lazarus/lcl/units/i386-darwin/replacedlgunit.lfm'
Debug: parsing parameter 'u_prova.lfm'
Debug: parsing parameter 'prova_beppe2.res'
Debug: target set to i386 - mach-o
Debug: finished parsing command line parameters
Debug: Trying to open file /Developer/lazarus/lcl/units/i386-darwin/finddlgunit.lfm...
Debug: Chosen reader: DFM resource reader
Debug: Reading resource information...
Debug: Resource information read
Debug: Trying to open file /Developer/lazarus/lcl/units/i386-darwin/replacedlgunit.lfm...
Debug: Chosen reader: DFM resource reader
Debug: Reading resource information...
Debug: Resource information read
Debug: Trying to open file u_prova.lfm...
Debug: Chosen reader: DFM resource reader
Debug: Reading resource information...
Debug: Resource information read
Debug: Trying to open file prova_beppe2.res...
Debug: Chosen reader: .res resource reader
Debug: Reading resource information...
Debug: Resource information read
Debug: 11 resources read.
Debug: Trying to create output file /Developer/lazarus/examples/lib/i386-darwin/prova_beppe2.or...
Debug: Setting up resource writer...
Debug: Writing output file /Developer/lazarus/examples/lib/i38Linking prova_beppe2
/usr/bin/ld: /System/Library/Frameworks/Carbon.framework/Carbon load command 3 unknown cmd field
/usr/bin/ld: /System/Library/Frameworks/OpenGL.framework/OpenGL load command 4 unknown cmd field
/usr/bin/ld: /usr/lib//libiconv.dylib load command 4 unknown cmd field
/usr/bin/ld: /usr/lib//libobjc.dylib unknown flags (type) of section 6 (__TEXT,__dof_objc_runt) in load command 0
/usr/bin/ld: /usr/lib//libc.dylib unknown flags (type) of section 5 (__TEXT,__dof_magmalloc) in load command 0
/usr/bin/ld: /System/Library/Frameworks/Carbon.framework/Carbon load command 3 unknown cmd field
/usr/bin/ld: /System/Library/Frameworks/Cocoa.framework/Cocoa load command 3 unknown cmd field
/usr/bin/ld: /System/Library/Frameworks/AGL.framework/AGL load command 4 unknown cmd field
/usr/bin/ld: /System/Library/Frameworks/OpenGL.framework/OpenGL load command 4 unknown cmd field
An error occurred while linking
Error: Error while linking       


the messages

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: error while linking
« Reply #4 on: February 05, 2011, 06:20:02 am »
Take a look at this earlier exchange with a similar problem. It looks like maybe you need to update your Xcode or something. What version of Xcode do you have installed? Is it from your Leopard (10.5) DVD?

http://www.lazarus.freepascal.org/index.php?topic=7748.0;wap2

Click Next Page at the bottom to see more.

Thanks.

-Phil

beppe_1964

  • New member
  • *
  • Posts: 6
Re: error while linking
« Reply #5 on: February 05, 2011, 11:34:12 am »
i downloaded it from apple thinkingh was the last version ...

thi is what i have :

xcode_2.2.1_8g1165_018213632.dmg

Xcode Tools 2.2.1 Release for Mac OS X v10.4 (Tiger)
 may be this is the error.....

i look for a newer version .

thanks for the moment

Beppe

beppe_1964

  • New member
  • *
  • Posts: 6
Re: error while linking
« Reply #6 on: February 05, 2011, 02:39:46 pm »
hi !!

i solved my problem using the 3.2.2 xcode version from my dvd !!!

a big thanks to Phil for the Help !

i compiled my first mac little program , i owe you one.

Beppe

 

TinyPortal © 2005-2018