Author Topic: no$cart can be compiled in GNU/Linux?  (Read 978 times)

0 Members and 1 Guest are viewing this topic.

Offline CPCBEGIN

  • CPC464
  • **
  • Posts: 19
  • Country: es
    • Malagueños originales y libres
  • Liked: 25
  • Likes Given: 35
no$cart can be compiled in GNU/Linux?
« on: 01:31, 17 November 19 »
I try to compile no$cart in Ubuntu Mate 18.04 64 bits using the commands:
Code: [Select]
sudo apt install pasmo build-essential cmakecd srcmake
but I get this error:
Code: [Select]
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.

Offline megachur

  • CPC664
  • ***
  • Posts: 74
  • Country: fr
  • z80 Powaaa !
    • cpc-power
  • Liked: 103
  • Likes Given: 9

Offline CPCBEGIN

  • CPC464
  • **
  • Posts: 19
  • Country: es
    • Malagueños originales y libres
  • Liked: 25
  • Likes Given: 35
Re: no$cart can be compiled in GNU/Linux?
« Reply #2 on: 14:10, 17 November 19 »
I change %d to %ld in main.cpp but I still get the same errors and much more.

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.337
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1043
  • Likes Given: 2512
Re: no$cart can be compiled in GNU/Linux?
« Reply #3 on: 15:16, 17 November 19 »
Where can I download the no$cart source code?

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.337
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1043
  • Likes Given: 2512
Re: no$cart can be compiled in GNU/Linux?
« Reply #4 on: 15:42, 17 November 19 »
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.

Offline CPCBEGIN

  • CPC464
  • **
  • Posts: 19
  • Country: es
    • Malagueños originales y libres
  • Liked: 25
  • Likes Given: 35
Re: no$cart can be compiled in GNU/Linux?
« Reply #5 on: 16:24, 17 November 19 »
I download latest version from this wiki than includes a folder with the source code.

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.337
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1043
  • Likes Given: 2512
Re: no$cart can be compiled in GNU/Linux?
« Reply #6 on: 16:48, 17 November 19 »
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.

Offline CPCBEGIN

  • CPC464
  • **
  • Posts: 19
  • Country: es
    • Malagueños originales y libres
  • Liked: 25
  • Likes Given: 35
Re: no$cart can be compiled in GNU/Linux?
« Reply #7 on: 17:35, 17 November 19 »
Thanks, I compile it successfully  8)