glastonbridge / SuperCollider-Android

An Android port of SuperCollider
http://wiki.github.com/glastonbridge/SuperCollider-Android
GNU General Public License v3.0
122 stars 22 forks source link

ndk-build fails #27

Open mrdevis opened 8 years ago

mrdevis commented 8 years ago

Hi, Following your itinerary to build SC-Android, the instruction ndk-build fails with the linker complaining::

jni/Source/plugins/onsetsds.c:400: error: undefined reference to 'onsetsds_phase_rewrap' jni/Source/plugins/onsetsds.c:415: error: undefined reference to 'onsetsds_phase_rewrap' jni/Source/plugins/onsetsds.c:442: error: undefined reference to 'onsetsds_phase_rewrap' jni/Source/plugins/onsetsds.c:458: error: undefined reference to 'onsetsds_phase_rewrap' collect2: error: ld returned 1 exit status

This is on OSX10.10.5, crystax-ndk-10.3.1 Something known??

Thanks for any pointers!

Jeroen

danstowell commented 8 years ago

Seems weird. You'll notice that on line 38 of onsetsds.c, onsetsds_phase_rewrap is definitely defined: https://github.com/glastonbridge/SuperCollider-Android/blob/master/jni/Source/plugins/onsetsds.c#L38 So I can only presume your compiler is insane...

mrdevis commented 8 years ago

maybe has something to do with being inline?

mrdevis commented 8 years ago

... any cures known for an insane compile/linker??

FRD93 commented 8 years ago

Hello everyone,

I've encountered the same issue (OSX Yosemite, crystax-ndk-10.3.1); I changed the lines

ifdef _WIN32

// the MSVC 2005 compiler is not up to date with inline float onsetsds_phase_rewrap(float phase); float onsetsds_phase_rewrap(float phase){ return (phase>MINUSPI && phase<PI) ? phase : phase + TWOPI * (1.f + floorf((MINUSPI - phase) * INV_TWOPI)); }

else

// Inline inline float onsetsds_phase_rewrap(float phase); inline float onsetsds_phase_rewrap(float phase){ return (phase>MINUSPI && phase<PI) ? phase : phase + TWOPI * (1.f + floorf((MINUSPI - phase) * INV_TWOPI)); }

endif

to this:

// FRD ADD /*

ifdef _WIN32

/ // END FRD ADD // the MSVC 2005 compiler is not up to date with inline float onsetsds_phase_rewrap(float phase); float onsetsds_phase_rewrap(float phase){ return (phase>MINUSPI && phase<PI) ? phase : phase + TWOPI * (1.f + floorf((MINUSPI - phase) \ INV_TWOPI)); }

// FRD ADD /*

else

// Inline inline float onsetsds_phase_rewrap(float phase); inline float onsetsds_phase_rewrap(float phase){ return (phase>MINUSPI && phase<PI) ? phase : phase + TWOPI * (1.f + floorf((MINUSPI - phase) * INV_TWOPI)); }

endif

*/ // END FRD ADD

and it worked. onsetsds.c.zip

felixdollack commented 5 years ago

I get the same error messages on macOS High Sierra 10.13.6 with crystax-ndk-10.3.2. The workaround from @FRD93 works fine for me as well.