esp32-gameboy
esp32-gameboy copied to clipboard
compilation error : multiple definition of `mem_init'
I don't know what went wrong. The compilation tips are as follows
Can you help me
C:\Users\ASUS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/lib\liblwip.a(mem.o): In function `mem_init':
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/mem.c:76: multiple definition of `mem_init'
C:\Users\ASUS\AppData\Local\Temp\arduino_build_126247\sketch\mem.cpp.o:C:\Users\ASUS\Desktop\esp32-gameboy\gameboy/mem.cpp:202: first defined here
collect2.exe: error: ld returned 1 exit status
Hi, I seem to be having the same issue.
From what I can tell, it's something to do with declaring the variable in both the header and the C++ file. But I don't know how to fix it.
Were you able to solve the problem?
I ended up just renaming the function to "mem_init2" and went through the following files to adjust it: gameboy.ino, main.cpp, mem.cpp, mem.h. I was able to compile it afterwards.
I ended up just renaming the function to "mem_init2" and went through the following files to adjust it: gameboy.ino, main.cpp, mem.cpp, mem.h. I was able to compile it afterwards.
Can you explain the changes you have made ?
Can you explain the changes you have made ?
Just find and replace mem_init
to mem_init2
in these 4 files; gameboy.ino, main.cpp, mem.cpp, mem.h.
Its as simple as that