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

Build.sh fails with "error: incompatible function pointer" #68

Open
TemporaryUntemporary opened this issue May 3, 2024 · 8 comments
Open

Comments

@TemporaryUntemporary
Copy link

I am using MacOs 14.4.1 with Apple M3 Chip. I installed Apple's Roesetta on my system and followed the installation instructions of pokemon emerald.

While trying to build agbcc I have encountered the following error:

expr.c:8863:19: error: incompatible function pointer types initializing 'rtx (*)(rtx, rtx, rtx)' (aka 'struct rtx_def ()(struct rtx_def *, struct rtx_def *, struct rtx_def *)') with an expression of type 'rtx (rtx, ...)' (aka 'struct rtx_def *(struct rtx_def *, ...)') [-Wincompatible-function-pointer-types]
rtx (*gen_insn)(rtx, rtx, rtx) = GEN_FCN (icode);

I added the log as a text file, in case it helps.
build.log

@jcimo
Copy link

jcimo commented May 4, 2024

im having the same problem

@connordoman
Copy link

me too ✋

@PikalaxALT
Copy link
Contributor

PikalaxALT commented May 4, 2024

This is a known issue. The solution is to install GCC from Homebrew or Macports. NOTE: Even though xcode gives you gcc, it's not actually gcc but rather apple clang wearing a troll mask. You can invoke the required version of gcc as (for homebrew) gcc-13.

@TemporaryUntemporary
Copy link
Author

TemporaryUntemporary commented May 5, 2024

I see. So the next steps would be to edit the file gcc/MakeFile and replace line 25

CC = gcc

with

CC = gcc-13

or am I missing something?

@TemporaryUntemporary
Copy link
Author

TemporaryUntemporary commented May 7, 2024

Sooo … it might work now.

build.sh
Download gcc (version 13) via homebrew (if not already installed)

brew install gcc@13

Add the lines

CC=gcc-13
export CC

in a new lines after CXXOPT= and use ./build.sh & co. as described in the manual. My previous answer worked, but only for one step as it did not set the compiler for the following processes. With export I make sure of that. Not sure if it is an elegant solution, but it works (for me).

Building Emerald
Next thing to do is to update the package-list the command pkg-config has access to. Simply do

brew install pkg-config

This makes the packages in the homebrew environment available to pkg-config. (You will otherwise receive an error that "No package 'libpng' found" and that you should adapt "PKG_CONFIG_PATH")

make

Afterwards I used make as described in the manual. It did not complain and make compare did not complain either.

@jm5049
Copy link

jm5049 commented May 8, 2024

i tried this but ended up with an error message: 'make: gcc-13: No such file or directory'. Any ideas?

@TemporaryUntemporary
Copy link
Author

TemporaryUntemporary commented May 9, 2024

i tried this but ended up with an error message: 'make: gcc-13: No such file or directory'. Any ideas?

Did you install gcc like PikalaxALT mentioned?

brew install gcc@13

(It was already installed on my computer, so I did not mention it.)

@jm5049
Copy link

jm5049 commented May 9, 2024

That's done it hahah, thanks!

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

5 participants