Open NeoTechni opened 6 months ago
Had a chance to chat on Discord in GBADEV. This user copied the sources into their project and redefined a few things in the global namespace the project relies on. They were able to build the project on its own no problem standalone. I'd close this as a non-issue.
I'd like to know what those things are though, otherwise I still can't use it. My code is mostly the tonc big map demo, so very little is my own definitions.
On Sun, 17 Mar 2024 at 06:08, aronson @.***> wrote:
Had a chance to chat on Discord in GBADEV. This user copied the sources into their project and redefined a few things in the global namespace the project relies on. They were able to build the project on its own no problem standalone. I'd close this as a non-issue.
— Reply to this email directly, view it on GitHub https://github.com/laqieer/libsavgba/issues/3#issuecomment-2002391580, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF26DTBMJEZV4LZQZC6RQZDYYVTQ7AVCNFSM6AAAAABEJYE4MGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSGM4TCNJYGA . You are receiving this because you authored the thread.Message ID: @.***>
I still can't use it
I gave you detailed instructions on Discord on how everyone else has been using this with success. If you "still can't use it" after that, I'm going to wager the issue is lack of expending effort in lieu of meaningful feedback.
As I said before, you cannot expect to copy an entire library into a foreign source tree and expect it to work. This is not the fault of the library. This is on you, the developer. I understand you copied someone else's code, why you don't copy someone else's general workflow and link the binary?
If you really want to solve it on your own, here's all your issues from your compiler output summarized with clear descriptions of the problem:
flash_absmemcmp
Function Callsconst volatile unsigned char *
, but arguments of type const char *
and char *
are passed instead.pointer targets in passing argument 2 of 'flash_absmemcmp' differ in signedness [-Wpointer-sign]
wait_until
Function Callsconst char *
, but arguments of type const unsigned char *
and u8 *
(aka unsigned char *
) are passed instead.pointer targets in passing argument 2 of 'wait_until' differ in signedness [-Wpointer-sign]
flash_memcpy
Function Callsvolatile unsigned char *
, but an argument of type char *
is passed instead.pointer targets in passing argument 1 of 'flash_memcpy' differ in signedness [-Wpointer-sign]
sram_memcpy
Function Callsflash_memcpy
, the function expects the first argument of type volatile unsigned char *
and the second argument of type const volatile unsigned char *
, but arguments of type char *
are passed instead.pointer targets in passing argument 1 of 'sram_memcpy' differ in signedness [-Wpointer-sign]
sram_absmemcmp
Function Callsconst volatile unsigned char *
, but arguments of type char *
are passed instead.pointer targets in passing argument 2 of 'sram_absmemcmp' differ in signedness [-Wpointer-sign]
as stated in the discord, I have no idea what any of that means. There's no suggestions in that in how to actually fix those errors. the library is useless to me if it's giving me these kinds of errors. I SHOULD be able to copy it into a folder and it compile without even being included, especially with tonc's demos.
" why you don't copy someone else's general workflow and link the binary?"
What? I don't even know what that means I think you're overestimating my skill level here, then blaming me for things I clearly have no idea how they happened.
On Sun, 17 Mar 2024 at 11:21, aronson @.***> wrote:
I still can't use it
I gave you detailed instructions on Discord on how everyone else has been using this with success. If you "still can't use it" after that, I'm going to wager the issue is lack of expending effort.
As I said before, you cannot expect to copy an entire library into a foreign source tree and expect it to work. This is not the fault of the library. This is on you, the developer. I understand you copied someone else's code, why you don't copy someone else's general workflow and link the binary?
If you really want to solve it on your own, here's all your issues from your compiler output summarized with clear descriptions of the problem:
Mismatch in flash_absmemcmp Function Calls
- Issue: The function expects arguments of type const volatile unsigned char , but arguments of type const char and char * are passed instead.
- Example Warning: pointer targets in passing argument 2 of 'flash_absmemcmp' differ in signedness [-Wpointer-sign]
Mismatch in wait_until Function Calls
- Issue: The function expects arguments of type const char , but arguments of type const unsigned char and u8 (aka unsigned char ) are passed instead.
- Example Warning: pointer targets in passing argument 2 of 'wait_until' differ in signedness [-Wpointer-sign]
Mismatch in flash_memcpy Function Calls
- Issue: The function expects the first argument of type volatile unsigned char , but an argument of type char is passed instead.
- Example Warning: pointer targets in passing argument 1 of 'flash_memcpy' differ in signedness [-Wpointer-sign]
Mismatch in sram_memcpy Function Calls
- Issue: Similar to flash_memcpy, the function expects the first argument of type volatile unsigned char and the second argument of type const volatile unsigned char , but arguments of type char * are passed instead.
- Example Warning: pointer targets in passing argument 1 of 'sram_memcpy' differ in signedness [-Wpointer-sign]
Mismatch in sram_absmemcmp Function Calls
- Issue: The function expects arguments of type const volatile unsigned char , but arguments of type char are passed instead.
- Example Warning: pointer targets in passing argument 2 of 'sram_absmemcmp' differ in signedness [-Wpointer-sign]
— Reply to this email directly, view it on GitHub https://github.com/laqieer/libsavgba/issues/3#issuecomment-2002507289, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF26DTH4VTYR27CHBIL7UYLYYWYJNAVCNFSM6AAAAABEJYE4MGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSGUYDOMRYHE . You are receiving this because you authored the thread.Message ID: @.***>
Reposting what I posted in Discord so that anyone who runs into this in the future can avoid all these errors:
You can avoid that by using the headers and linking to the libsavgba.a file This might come up again if you want to bring in another library you would put the headers in your include dir and use the code like usual. You would add the linker flags
-lsavgba
and the path to the library .a file-L/path/to/containing/folder
many people put stuff like this in a lib/ folder in the project dir to make it portable I think the usual GBA makefile lets you adjust this withLDLIBS
andLDFLAGS
at the top
Good luck on your projects! 😄
~~~~~~^~~ E:/VB6/GBA/Projects/Awakening/source/gba_flash.c:77:43: warning: pointer targets in passing argument 2 of 'flash_absmemcmp' differ in signedness [-Wpointer-sign] 77~~~~~~^~~ E:/VB6/GBA/Projects/Awakening/source/gba_flash.c: In function 'flash_reset': E:/VB6/GBA/Projects/Awakening/source/gba_flash.c:143:25: warning: pointer targets in passing argument 2 of 'wait_until' differ in signedness [-Wpointer-sign] 143~~~~~~~^~ E:/VB6/GBA/Projects/Awakening/source/gba_flash.c:146:30: warning: pointer targets in passing argument 2 of 'wait_until' differ in signedness [-Wpointer-sign] 146~~~~~~~^~ E:/VB6/GBA/Projects/Awakening/source/gba_flash.c: In function 'flash_erase': E:/VB6/GBA/Projects/Awakening/source/gba_flash.c:166:28: warning: pointer targets in passing argument 2 of 'wait_until' differ in signedness [-Wpointer-sign] 166~~~~~~~^~ E:/VB6/GBA/Projects/Awakening/source/gba_flash.c:169:30: warning: pointer targets in passing argument 2 of 'wait_until' differ in signedness [-Wpointer-sign] 169~~~~~~~^~ E:/VB6/GBA/Projects/Awakening/source/gba_flash.c: In function 'flash_read': E:/VB6/GBA/Projects/Awakening/source/gba_flash.c:210:18: warning: pointer targets in passing argument 1 of 'flash_memcpy' differ in signedness [-Wpointer-sign] 210~~~~~~^E:/VB6/GBA/Projects/Awakening/source/gba_flash.c: In function 'flash_write_byte': E:/VB6/GBA/Projects/Awakening/source/gba_flash.c:224:29: warning: pointer targets in passing argument 2 of 'wait_until' differ in signedness [-Wpointer-sign] 224~~^~ E:/VB6/GBA/Projects/Awakening/source/gba_flash.c: In function 'flash_write': E:/VB6/GBA/Projects/Awakening/source/gba_flash.c:346:43: warning: pointer targets in passing argument 2 of 'flash_absmemcmp' differ in signedness [-Wpointer-sign] 346~~~~~~^~~ gba_sram.c E:/VB6/GBA/Projects/Awakening/source/gba_sram.c: In function 'sram_read': E:/VB6/GBA/Projects/Awakening/source/gba_sram.c:35:17: warning: pointer targets in passing argument 1 of 'sram_memcpy' differ in signedness [-Wpointer-sign] 35~~~~~~^E:/VB6/GBA/Projects/Awakening/source/gba_sram.c: In function 'sram_write': E:/VB6/GBA/Projects/Awakening/source/gba_sram.c:50:34: warning: pointer targets in passing argument 2 of 'sram_memcpy' differ in signedness [-Wpointer-sign] 50~~~~~~^~~ E:/VB6/GBA/Projects/Awakening/source/gba_sram.c:52:41: warning: pointer targets in passing argument 2 of 'sram_absmemcmp' differ in signedness [-Wpointer-sign] 52E:/VB6/GBA/Projects/Awakening/source/gba_sram.c:14:101: note: expected 'const volatile unsigned char ' but argument is of type 'char ' 14 | static unsigned int sram_absmemcmp(const volatile unsigned char dst, const volatile unsigned char src, size_t size) {