acgessler / assimp2json

JSON exporter for Open Asset Import Library to make 3D models accessible from JS/WebGl
http://assimp.sf.net
Other
188 stars 44 forks source link

ubuntu build error #20

Closed makc closed 7 years ago

makc commented 7 years ago

I am trying to run make assimp2json after cmake ./ and I get this: screen shot 2016-12-06 at 21 26 05

I was thinking where do I add that -fPIC flag, and opened flags.make, and it was already there: screen shot 2016-12-06 at 21 25 29

What am I doing wrong? Thanks.

kimkulling commented 7 years ago

You need to enable this flag for yor executable as well.

makc commented 7 years ago

But how come this builds perfectly fine on mac, but not so on ubuntu, what's the difference? I did exact same thing on both, mac is fine, ubuntu -> build error.

makc commented 7 years ago

Also, tried to do

cmake -DCMAKE_CXX_FLAGS=-fPIC ./
make assimp2json

as per this comment, but the error did not go away.

makc commented 7 years ago

ok, yet another version here says to also specify -DCMAKE_C_FLAGS=-fPIC edit ok that does it.

agirault commented 6 years ago

If using CMake, prefer the use of CMAKE_POSITION_INDEPENDENT_CODE, instead of manually editing the flags.

https://stackoverflow.com/questions/38296756/what-is-the-idiomatic-way-in-cmake-to-add-the-fpic-compiler-option