sai-nirish / glib-for-ios

The C++ library - "glib" built for ios-simulator and ios-devices
11 stars 2 forks source link

Error during compiling Glib for arm64 #1

Open ericwang0701 opened 9 years ago

ericwang0701 commented 9 years ago

Hi,

I follow the instructions to build dependencies for glib. However, when I try to compile glib_arm64, there is a error during make.

clang: error: no such file or directory: '/Users/rahul/Desktop/ios_compilation/libiconv-1.14/dependencies/lib/libiconv.a'

Could you tell me how to solve this problem ?

Thanks for your help

Best Regards, Eric Wang

sai-nirish commented 9 years ago

Can you just send the screenshot of the compile process

On Fri, Aug 7, 2015 at 2:40 PM, Eric Wang notifications@github.com wrote:

Hi,

I follow the instructions to build dependencies for glib. However, when I try to compile glib_arm64, there is a error during make.

clang: error: no such file or directory: '/Users/rahul/Desktop/ios_compilation/libiconv-1.14/dependencies/lib/libiconv.a'

Could you tell me how to solve this problem ?

Thanks for your help

Best Regards, Eric Wang

— Reply to this email directly or view it on GitHub https://github.com/sai-nirish/glib-for-ios/issues/1.

ericwang0701 commented 9 years ago

Here is the error when I run the make command after running the glib.sh in the glib_arm64 folder. It's seems that it search for the wrong path for libiconv.a. Besides, I follow the instructions to build dependencies lib first (glib_dependencies.sh, make, make install), how do I make sure I generate all the file that we need.

screen shot 2015-08-07 at 8 44 45 am

Thanks for your help.

Best Regards, Eric Wang

sai-nirish commented 9 years ago

It seems that the glib_arm64 in my github repository has some path hardcoded as the library was already built and somehow it is reffering to it . First try running make clean in glib_arm64 and build the dependencies seperately and put them in put them in glib_arm64/dependencies and try to bulid glib If this does not work then try creating the entire directory structure similar to the one in github except that glib_arm64(or any name) must contain only glib source (you can download zip file online) and glib.sh make sure that you have built dependencies correctly (and put them in glib_arm64/dependencies )and then run glib.sh

On Fri, Aug 7, 2015 at 9:24 PM, Eric Wang notifications@github.com wrote:

Here is the error when I run the make command after running the glib.sh in the glib_arm64 folder. It's seems that it search for the wrong path for libiconv.a. Besides, I follow the instructions to build dependencies lib first (glib_dependencies.sh, make, make install), how do I make sure I generate all the file that we need.

[image: screen shot 2015-08-07 at 8 44 45 am] https://cloud.githubusercontent.com/assets/1519164/9139728/e4dd6704-3ce0-11e5-86b8-4a94a66ea1bb.png

Thanks for your help.

Best Regards, Eric Wang

— Reply to this email directly or view it on GitHub https://github.com/sai-nirish/glib-for-ios/issues/1#issuecomment-128745781 .

ericwang0701 commented 9 years ago

Thanks for your reply :)

what are the dependencies files that I need to put in the glib_arm64/dependencies ? I compile the libffi-3.1, gettext-0.19.3, libiconv-1.14 and put all the file in the dependencies folder of each folder(ex.libffi-3.1/dependencies) to glib_arm64/dependencies. Is it correct?

The library path error disappear but here is the new error when I run make command for glib_arm64

screen shot 2015-08-08 at 2 02 06 am

Thanks for your help. I really want to build the Glib_arm64 and I think it's almost there.

sai-nirish commented 9 years ago

Yup , What you did is correct I searched your problem online and i found this : "

This mean you have an old executable that was compiled for a Power PC Mac (the ones before they got the Intel chips). On systems running 10.6 (Snow Leopard) there was code called Rosetta that was able to run the PPC code on the Intel CPU, That went away in 10.7

Sounds like you recently upgraded to 10.8 from 10.6 or earlier and copied the binary to the new OS.

If you compiled the code yourself you need to recompile it for the new OS. If you installed the binary you need to go to the site you got the binary from and see if there is a newer version for Intel Macs.

"

at https://discussions.apple.com/thread/6130828

It seems like a machine specific problem to me. Try compiling it on different machine.

OR it could happen if you are having the same dependencies/bin file which is already present on my GitHub where the executables were already build on my machine (Which seems to be different :P). So try cleaning the bin folder and recompiling it

Good Luck Trying.

Best Regards,

Sai Nirish Padala

On Sat, Aug 8, 2015 at 2:40 PM, Eric Wang notifications@github.com wrote:

Thanks for your reply :)

what are the dependencies files that I need to put in the glib_arm64/dependencies ? I compile the libffi-3.1, gettext-0.19.3, libiconv-1.14 and put all the file in the dependencies folder of each folder(ex.libffi-3.1/dependencies) to glib_arm64/dependencies. Is it correct?

The library path error disappear but here is the new error when I run make command for glib_arm64 [image: screen shot 2015-08-08 at 2 02 06 am] https://cloud.githubusercontent.com/assets/1519164/9149841/3a7133e4-3d72-11e5-942b-0764091e27ff.png

Thanks for your help. I really want to build the Glib_arm64 and I think it's almost there.

— Reply to this email directly or view it on GitHub https://github.com/sai-nirish/glib-for-ios/issues/1#issuecomment-128942778 .

ericwang0701 commented 9 years ago

Hi @sai-nirish,

Thanks for your quick reply. It's really helpful.

I remove all the files in glib_arm64/dependencies first and put the files that I compiled in glib_arm64/dependencies. Then, I run ./glib.sh, make, make install command in the glib_arm64 folder. There is no error message now :)

The last question is where are the files that I need to include/link in my Xcode iOS project. What should I do ?

Thanks for your time and help

Best Regards, Eric Wang

sai-nirish commented 9 years ago

Hi, You can find files like libglib_arm64.a and related *.a files in glib_arm64/dependencies/lib

Regards, Sai Nirish Padala

On Sun, Aug 9, 2015 at 8:33 AM, Eric Wang notifications@github.com wrote:

Hi @sai-nirish https://github.com/sai-nirish,

Thanks for your quick reply. It's really helpful.

I remove all the files in glib_arm64/dependencies first and put the files that I compiled in glib_arm64/dependencies. Then, I run ./glib.sh, make, make install command in the glib_arm64 folder. There is no error message now :)

The last question is where are the files that I need to include/link in my Xcode iOS project. What should I do ?

Thanks for your time and help

Best Regards, Eric Wang

— Reply to this email directly or view it on GitHub https://github.com/sai-nirish/glib-for-ios/issues/1#issuecomment-129097693 .

ericwang0701 commented 9 years ago

Hi, I only find libglib.a and other .a (no _arm64 in the filename) files in the glib_arm64/dependencies/lib. Does it means that I didn't build the glib_arm64 correctly? I also try to add those .a file in my project. but there are some error messages.

Undefined symbols for architecture arm64: "_iconv_open", referenced from: __nl_find_msg in libintl.a(dcigettext.o) (maybe you meant: _g_iconv_open)

I have already add the libiconv.a and libintl.a in the project. I follow the instruction to build dependencies library and glib_arm64. Although there are no errors during the process, maybe I miss or generate the wrong file.

screen shot 2015-08-09 at 2 58 41 am

By the way, is it possible to share the libglib_arm64.a library directly? or it need to be build on each computer.

Thanks for your time and help.

Best Regards, Eric Wang

sai-nirish commented 9 years ago

Sorry for the mistake in the previous mail, you will not find any _arm64.a files, (In my github repository i renamed the generated files to _arm64.a) but the *.a files will be generated in glib_arm64/dependencies/lib you can view the newly built files by checking the latest modified time . The error is happening in lbintl.a which is built while compiling gettext and not glib. so try building gettext for arm64

On Sun, Aug 9, 2015 at 3:40 PM, Eric Wang notifications@github.com wrote:

Hi, I only find libglib.a and other .a (no _arm64 in the filename) files in the glib_arm64/dependencies/lib. Does it means that I didn't build the glib_arm64 correctly? I also try to add those .a file in my project. but there are some error messages.

Undefined symbols for architecture arm64: "_iconv_open", referenced from: __nl_find_msg in libintl.a(dcigettext.o) (maybe you meant: _g_iconv_open)

I have already add the libiconv.a and libintl.a in the project. I follow the instruction to build dependencies library and glib_arm64. Although there are no errors during the process, maybe I miss or generate the wrong file.

[image: screen shot 2015-08-09 at 2 58 41 am] https://cloud.githubusercontent.com/assets/1519164/9154442/2107c9e6-3e43-11e5-96f2-eba66180ac75.png

By the way, is it possible to share the libglib_arm64.a library directly? or it need to be build on each computer.

Thanks for your time and help.

Best Regards, Eric Wang

— Reply to this email directly or view it on GitHub https://github.com/sai-nirish/glib-for-ios/issues/1#issuecomment-129150636 .

ericwang0701 commented 9 years ago

Hi @sai-nirish,

I recompile the gettext for arm64 but still got the same error when I build the Xcode project. Here are the steps : (1) change PREFIX "dependencies" to "dependencies2" in the glib_dependencies.sh (mkdir -p "dependencies2" PREFIX="pwd/dependencies2")

(2) ./glib_dependencies.sh make

(3) error: sh: ../build-aux/git-version-gen: No such file or directory configure.ac:25: error: AC_INIT should be called with package and version arguments /usr/local/share/aclocal-1.14/init.m4:167: AM_INIT_AUTOMAKE is expanded from... configure.ac:25: the top level autom4te: /usr/bin/m4 failed with exit status: 1 aclocal-1.14: error: echo failed with exit status: 1 make[2]: * [aclocal.m4] Error 1 make[1]: * [all-recursive] Error 1 make: *\ [all] Error 2

I remove the line in m4_esyscmd([build-aux/git-version-gen .tarball-version]) in configure.ac AC_INIT([gettext], m4_esyscmd([build-aux/git-version-gen .tarball-version]), [bug-gnu-gettext@gnu.org])

(4) make again and error: "crt_externs.h" not found. I remove the line include ""crt_externs.h" in /glib-for-ios/dependencies-glib-arm64/gettext-0.19.3/gettext-tools/gnulib-lib/unistd.h

(5) make and make install

I think maybe the (3) step is wrong. But it still generate the .a file in dependencies2 folder. Is there a way to test the generated .a file is correct ?

ericwang0701 commented 9 years ago

After recompiling libintl.a today, still got the same error :(

Undefined symbols for architecture arm64: "_iconv_open", referenced from: nl_find_msg in libintl.a(dcigettext.o) (maybe you meant: _g_iconv_open) "_iconv", referenced from: nl_find_msg in libintl.a(dcigettext.o) (maybe you meant: _g_iconv, _g_iconv_close , _g_iconv_open , _iconv_canonicalize , _g_convert_with_iconv ) ld: symbol(s) not found for architecture arm64

Is it possible to share the your Xcode project setting and Glib_arm64 library files? It would be very helpful

Thanks for your help

Best Regards, Eric Wang

sai-nirish commented 9 years ago

I did this work as a part of my internship so i don't have the files with me, In the above i don't remember doing the step (3) and did you set ac_cv_func__NSGetEnviron=no before compilation?

On Mon, Aug 10, 2015 at 2:07 PM, Eric Wang notifications@github.com wrote:

After recompiling libintl.a today, still got the same error :(

Undefined symbols for architecture arm64: "_iconv_open", referenced from: nl_find_msg in libintl.a(dcigettext.o) (maybe you meant: _g_iconv_open) "_iconv", referenced from: nl_find_msg in libintl.a(dcigettext.o) (maybe you meant: _g_iconv, _g_iconv_close , _g_iconv_open , _iconv_canonicalize , _g_convert_with_iconv ) ld: symbol(s) not found for architecture arm64

Is it possible to share the your Xcode project setting and Glib_arm64 library files? It would be very helpful

Thanks for your help

Best Regards, Eric Wang

— Reply to this email directly or view it on GitHub https://github.com/sai-nirish/glib-for-ios/issues/1#issuecomment-129366616 .