For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

g++ link undefined references error?

Charles Bradshaw's picture

Building occ undet Fedora 17

Does anybody know why this make error occurs:

/home/brad/work/occ/adm/make/TKService/.libs/ undefined reference to `fipImage::getScanLine(unsigned int) const'
/home/brad/work/occ/adm/make/TKService/.libs/ undefined reference to `fipImage::fipImage(FREE_IMAGE_TYPE, unsigned int, unsigned int, unsigned int)'

The errant g++ line is:

g++ -DCSFDB -DOCC_CONVERT_SIGNALS -DLIN -DLININTEL -D_GNU_SOURCE=1 -O2 -o .libs/DRAWEXE DRAWEXE.o -lstdc++ ../TKDraw/.libs/ -L/usr/lib /home/brad/work/occ/adm/make/TKMesh/.libs/ /home/brad/work/occ/adm/make/TKService/.libs/ /home/brad/work/occ/adm/make/TKHLR/.libs/ ../TKMesh/.libs/ ../TKTopAlgo/.libs/ ../TKHLR/.libs/ /home/brad/work/occ/adm/make/TKTopAlgo/.libs/ /home/brad/work/occ/adm/make/TKGeomAlgo/.libs/ ../TKGeomAlgo/.libs/ /home/brad/work/occ/adm/make/TKBRep/.libs/ ../TKGeomBase/.libs/ ../TKG2d/.libs/ ../TKBRep/.libs/ /home/brad/work/occ/adm/make/TKGeomBase/.libs/ /home/brad/work/occ/adm/make/TKG3d/.libs/ ../TKMath/.libs/ ../TKG3d/.libs/ /home/brad/work/occ/adm/make/TKG2d/.libs/ ../TKernel/.libs/ ../TKService/.libs/ /home/brad/work/occ/adm/make/TKMath/.libs/ /home/brad/work/occ/adm/make/TKernel/.libs/ -lrt -ltcl8.5 -ltk8.5 -ltbb -ltbbmalloc -lXt -lX11 -lXmu -lfreeimageplus -ldl -lpthread -Wl,-rpath -Wl,/home/brad/lib

In which -lfreeimage occours after

Both fipImage::getScanLine and fipImage::fipImage are present in /usr/lib/

$ nm -D /usr/lib/
00005490 T _ZNK8fipImage11getScanLineEt
00004bf0 T _ZN8fipImageD1Ev

The symbols are both correctly flagged U in, although I am unclear as to how is compiled and linked!

Changing the g++ line to specifically link using /usr/lib/ in place of -lfreeimage produces the identical error.

I'm completely baffled! Can suggest a solution?

Charles Bradshaw's picture

I've just discovered the -C switch to nm with the result that:

$ nm -DC /usr/lib/ | grep getScanLine
00005490 T fipImage::getScanLine(unsigned short) const

$ [brad@p2800 lib]$ nm -DC /usr/lib/ | grep fipImage::fipImage
00004d60 T fipImage::fipImage(FREE_IMAGE_TYPE, unsigned short, unsigned short, unsigned short)

In which I note that unsigned short is specified whereas unsigned int is required.

Is this the problem? If so where is the source for TKService so I can patch it?