Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues in compiling on Android Studio 3.6 #2

Open
azghanvi opened this issue Nov 26, 2020 · 1 comment
Open

Issues in compiling on Android Studio 3.6 #2

azghanvi opened this issue Nov 26, 2020 · 1 comment

Comments

@azghanvi
Copy link

azghanvi commented Nov 26, 2020

I tried compiling it on android studio 3.6, win10 64 bit and found following issues. Also fixed them and logging here to support the community.

  1. liblame\machine.h:43:9: error: redeclaration of 'strchr' must have the 'overloadable' attribute
    Fix:
# ifndef HAVE_STRCHR
# // define strchr index // <---- uncomment this.
#  define strchr index
#  define strrchr rindex
# endif
  1. id3tag.c:833: error: undefined reference to 'index'
    Fix:
    In jni/Application.mk, add this:
    APP_CFLAGS += -DSTDC_HEADERS

  2. sock.c:686:5: error: 'memcpy' will always overflow - destination buffer has size 12, but size argument is 16
    Fix:
    On this line add -4 at end of sizeof. I know it's not a fix but it went through after this. If someone know the solution of Implementation #3, please mention in comments.
    memcpy(&server.sin_addr, &sin.sin_addr, sizeof(struct sockaddr_in)-4);

@mirsamantajbakhsh
Copy link
Owner

Really sorry. Replying very late. The fix is this:
Change

memcpy(&server.sin_addr, &sin.sin_addr, sizeof(struct sockaddr_in)-4);

to:

memcpy(&server.sin_addr, &sin.sin_addr, sizeof(sin.sin_addr));

Then it will compile.

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

No branches or pull requests

2 participants