cocos2d / cocos2d-x-3rd-party-libs-src

Dependencies of cocos2d-x.
142 stars 169 forks source link

Fixed linker error in Linux #153

Closed Rubonnek closed 7 years ago

Rubonnek commented 7 years ago

Linux needs the -fPIC flag for libbullet too.

Otherwise I get messages like the following from ld:

/usr/bin/ld: ../cocos2d/external/bullet/prebuilt/linux/64-bit/libBulletDynamics.a(btSequentialImpulseConstraintSolver.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
minggo commented 7 years ago

but i don't meet problem in ubuntu

Rubonnek commented 7 years ago

It's probably only an issue in Arch Linux right now since recently SSP and PIE got enabled on gcc by default.

I didn't have this problem until after that gcc update. Still, thanks for merging. Eventually the -fPIC flag would still have to be added for Ubuntu in case they enable SSP and PIE too on gcc by default.