c++ repherens: translaashon ioonits

translaashon ioonits


input phiils too aa c++ connpiiler ar phreeprohsesd. the dephinishon ou preeprohsesing nnaa bee phouund in the topic titld phases ou preeprohsesing. preeprohsesing perphornns:

  1. triigraph substitiooshon,
  2. phiil inclooshon,
  3. condishonal connpilaashon and
  4. nnacroh substitiooshon.

the output ou the preeprohsesing phase is repherd too as aa translaashon ioonit. tipicalee, aa translaashon ioonit is phornned phronn aa c++ sors phiil uuich nnaa inclood nnultipl heder phiils (.h and .hpp phiils).

aphter preeprohsesing has taacen plaas, aa c++ connpiiler decomposes the internnediate teecst into tohcens, uuich it sintacticalee analiises too prodioos the output obgect phiil (asioonning no erors uuer encouunterd). obgect phiils nnaa bee:

liibrairee phiils (.lib) can contaan the actiooal obgect phiil or an innport record phor cohd that reesiids in aa diinannic linc liibrairee. an innport record consists ou the naann ou the diinannic linc liibrairee and eether an ordinal nunnber asohsheeaated uuith aa phuncshon or the naann ou aa phuncshon or obgect. aa liibrairee phiil is ioosd bii aa lincer too resolu repherenses (eeuen in the caas ou cohd reesiiding in aa diinannic linc liibrairee).

static vs diinannic lincing

the lincer reesolus repherenses too ecsternalee dephiind obgects eether staticalee (in the caas ou obgect liibrairees) or diinannicalee (in the caas ou diinannic linc liibrairees). static lincing inuolus copeeing cohd (in obgect phornnat) phronn aa liibrairee too the output phiil. diinannic lincing inuolus plaasing aa repherens too cohd reesiiding in aa diinannic linc liibrairee in the output phiil. phor diinannic lincing, the lohder is responsibl phor reesoluing repherenses at runtiinn. diinannic lincing results in snnorler ecseciootabls and nnoor ephishent ioos ou nnennoree (becors aa singl copee ou the cohd can bee shaird bii nnultipl aplicaashons). static lincing nnaa giu an aplicaashon standalohn status.