Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Fix failure on GCC 4.9 #56

Closed
rmtheis opened this issue Jul 23, 2014 · 10 comments
Closed

Fix failure on GCC 4.9 #56

rmtheis opened this issue Jul 23, 2014 · 10 comments
Assignees

Comments

@rmtheis
Copy link
Owner

rmtheis commented Jul 23, 2014

No description provided.

@rmtheis rmtheis self-assigned this Jul 23, 2014
@rmtheis
Copy link
Owner Author

rmtheis commented Jul 24, 2014

FILE *__sfp(void);
int __sflags(const char *, int *);

@rmtheis rmtheis mentioned this issue Jul 31, 2014
@jvelo
Copy link

jvelo commented Jul 31, 2014

Is the failure the following ?

jni/com_googlecode_leptonica_android/stdio/open_memstream.c:188: error: undefined reference to '__sfp'
jni/com_googlecode_leptonica_android/stdio/fopencookie.c:154: error: undefined reference to '__sflags'
jni/com_googlecode_leptonica_android/stdio/fopencookie.c:161: error: undefined reference to '__sfp'
jni/com_googlecode_leptonica_android/stdio/fmemopen.c:209: error: undefined reference to '__sflags'
jni/com_googlecode_leptonica_android/stdio/fmemopen.c:215: error: undefined reference to '__sfp'

I've tried downgrading gcc (to 4.8.2) but still facing this

@rmtheis
Copy link
Owner Author

rmtheis commented Jul 31, 2014

@jvelo Yes. Can you try modifying these lines in your tess-two/jni/Application.mk, and let me know if this fixes it for you?

APP_CPPFLAGS += -fexceptions -frtti -ffat-lto-objects
NDK_TOOLCHAIN_VERSION := 4.9

@jvelo
Copy link

jvelo commented Jul 31, 2014

@rmtheis I've still got the error with the changed Application.mk

@rmtheis
Copy link
Owner Author

rmtheis commented Jul 31, 2014

@jvelo Really? It seems to be working for me.

@jvelo
Copy link

jvelo commented Jul 31, 2014

Yeah. I've just double-checked the changes and tried again, it fails. I have :

diff --git a/tess-two/jni/Application.mk b/tess-two/jni/Application.mk
index 0e43645..ebba2ba 100644
--- a/tess-two/jni/Application.mk
+++ b/tess-two/jni/Application.mk
@@ -2,5 +2,5 @@ APP_STL := gnustl_static
 APP_ABI := armeabi armeabi-v7a mips x86
 APP_OPTIM := release
 APP_PLATFORM := android-8
-APP_CPPFLAGS += -fexceptions -frtti
-NDK_TOOLCHAIN_VERSION := 4.8
+APP_CPPFLAGS += -fexceptions -frtti -ffat-lto-objects
+NDK_TOOLCHAIN_VERSION := 4.9
(END)

And

gcc version 4.9.1 (GCC) 

It fails with the same error as above. There' s also a couple warnings before that, not sure if they are relevant or not :

[armeabi] Compile++ thumb: lept <= readfile.cpp
jni/com_googlecode_leptonica_android/readfile.cpp: In function 'jint Java_com_googlecode_leptonica_android_ReadFile_nativeReadFiles(JNIEnv*, jclass, jstring, jstring)':
jni/com_googlecode_leptonica_android/readfile.cpp:103:12: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]
 return NULL;
        ^
jni/com_googlecode_leptonica_android/readfile.cpp:109:12: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]
 return NULL;
        ^
jni/com_googlecode_leptonica_android/readfile.cpp: In function 'jint Java_com_googlecode_leptonica_android_ReadFile_nativeReadFile(JNIEnv*, jclass, jstring)':
jni/com_googlecode_leptonica_android/readfile.cpp:127:12: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]
 return NULL;
        ^

@rmtheis
Copy link
Owner Author

rmtheis commented Jul 31, 2014

@jvelo You're right--that change doesn't fix it. I'm seeing the same result as you. The warnings are unrelated (see #18).

@rmtheis
Copy link
Owner Author

rmtheis commented Jul 31, 2014

@jvelo GCC 4.8.3 should still work for you though:

NDK_TOOLCHAIN_VERSION := 4.8

@chetanushar
Copy link

I am facing the same issue.
ubuntu 14.04 64bit.
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
Android ndk r10

NDK_TOOLCHAIN_VERSION := 4.9

@JasonNew
Copy link

nice work. I use the original version of tess and patch this. It's working for windows compiling.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants