News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_CPCBEGIN

no$cart can be compiled in GNU/Linux?

Started by CPCBEGIN, 00:31, 17 November 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CPCBEGIN

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.
Retro & opensource


CPCBEGIN

I change %d to %ld in main.cpp but I still get the
same errors and much more.
Retro & opensource

robcfg

Where can I download the no$cart source code?

robcfg

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.

CPCBEGIN

I download latest version from this wiki than includes a folder with the source code.
Retro & opensource

robcfg

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.

CPCBEGIN

Thanks, I compile it successfully  8)
Retro & opensource

Powered by SMFPacks Menu Editor Mod