I try to compile no$cart in Ubuntu Mate 18.04 64 bits using the commands:sudo apt install pasmo build-essential cmakecd srcmake
but I get this error:main.cpp:76:7: error: declaration of 'XPDB <unnamed struct>::XPDB' [-fpermissive]
XPDB XPDB;
^~~~
main.cpp:66:3: error: changes meaning of 'XPDB' from 'typedef struct XPDB XPDB' [-fpermissive]
} XPDB;
^~~~
main.cpp: In function 'int main(int, const char**)':
main.cpp:933:87: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=]
printf("Using Binary File '%s' length %d\n", pBinaryFilename, BinaryFileLength);
^
main.cpp:1091:112: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=]
fprintf(stderr, "Binary file is too large to write to cartridge. %d bytes remaining\n", BinaryFileLength);
^
<integrado>: recipe for target 'main.o' failed
Is there a way to compile this tool successfully in GNU/Linux.
replace the %d with
%ld
cf https://stackoverflow.com/questions/38561/what-is-the-argument-for-printf-that-formats-a-long (https://stackoverflow.com/questions/38561/what-is-the-argument-for-printf-that-formats-a-long)
I change %d to %ld in main.cpp but I still get the same errors and much more (https://pastebin.com/Ee9J8gUX).
Where can I download the no$cart source code?
Ok, got it, saw the problems, and compiled it on Linux Mint.
So, you only had to change %d to %ld on lines 933 and 1091. The rest are ok.
The other problem comes from having a variable name (XPDB), that is the same name of a structure definition.I changed all XPDB var names to Xpdb, and it compiles just fine.
Find attached the fixed main.cpp file.
I download latest version from this wiki (http://www.cpcwiki.eu/index.php/Nocart) than includes a folder with the source code.
Yes, I downloaded the latest version, 1.9 I think, and fixed it.
Just overwrite main.cpp with the one I uploaded in my previous post.
Thanks, I compile it successfully 8)