CMake IA64 FPIC problem

From KitwarePublic
Revision as of 16:43, 13 December 2005 by Barre (talk | contribs)
Jump to navigationJump to search

bar.c:

int i = 0;
void bar()
 {
 i = 5;
 }

foo.c:

extern void bar();
void foo()
  {
  bar();
  }

Compiled with

rm -f libbar.a *.o
gcc -c bar.c
ar cr libbar.a bar.o
gcc -c foo.c
gcc -shared -o libfoo.so foo.o -L. -lbar

Will fail:

/usr/bin/ld: bar.o: @gprel relocation against dynamic symbol i collect2: ld returned 1 exit status

But, putting:

gcc -fPIC -c bar.c

works.




CMake: [Welcome | Site Map]