Porting iGame to AmigaOS 4 using vbcc

7 posts / 0 new
Last post
walkero
walkero's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2009-05-03 16:54
Porting iGame to AmigaOS 4 using vbcc

Hello everyone.
I am trying to port iGame (https://github.com/MrZammler/iGame) to AmigaOS 4, but I have an error on compiling were I need your help. I use vbcc compiler, the latest version 0.9g.

When I compile the code, I get the following error:

  1. vc +aosppc -dontwarn=-1 -O2 -c99 -v -I/opt/sdk/ppc-amigaos/Include/include_h -I/opt/sdk/ppc-amigaos/clib2/include -I/opt/sdk/MUI_5.0/C/include -o src/funcs_AOS4.o src/funcs.c
  2. vc frontend for vbcc (c) in 1995-2016 by Volker Barthelmann
  3. vbccppc -quiet "src/funcs.c" -o= "/tmp/fileGSzXrR.scs" -dontwarn=-1 -c99 -I/opt/sdk/ppc-amigaos/Include/include_h -I/opt/sdk/ppc-amigaos/clib2/include -I/opt/sdk/MUI_5.0/C/include -elf -no-regnames -no-multiple-ccs -madd -c99 -use-commons -O=1023 -I$VBCC/targets/ppc-amigaos/include -D__amigaos4__
  4. > ULONG data[0]
  5. warning 61 in line 4294 of "libraries/mui.h": array of size <=0 (set to 1)
  6. included from file "src/funcs.c":36
  7. >#error "Unknown compiler"
  8. error 292 in line 89 of "stdarg.h": #error "Unknown compiler"
  9. included from file "/opt/sdk/ppc-amigaos/clib2/include/stdio.h":51
  10. included from file "src/funcs.c":40
  11. 1 error found!
  12. vbccppc -quiet "src/funcs.c" -o= "/tmp/fileGSzXrR.scs" -dontwarn=-1 -c99 -I/opt/sdk/ppc-amigaos/Include/include_h -I/opt/sdk/ppc-amigaos/clib2/include -I/opt/sdk/MUI_5.0/C/include -elf -no-regnames -no-multiple-ccs -madd -c99 -use-commons -O=1023 -I$VBCC/targets/ppc-amigaos/include -D__amigaos4__ failed
  13. Makefile.docker:168: recipe for target 'src/funcs_AOS4.o' failed
  14. make: *** [src/funcs_AOS4.o] Error 1

The error occurs on funcs.c at line 40, which you can find at the GitHub

Thank you for all the help you can give.

salass00
salass00's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2011-02-03 11:27
Re: Porting iGame to AmigaOS 4 using vbcc

Remove the "-I/opt/sdk/ppc-amigaos/clib2/include" option. You shouldn't be using clib2 header files with vbcc.

walkero
walkero's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: Porting iGame to AmigaOS 4 using vbcc

Thank you for your reply. I did what you said

  1. vc +aosppc -dontwarn=-1 -O2 -lauto -v -I/opt/sdk/ppc-amigaos/Include/include_h -I/opt/sdk/MUI_5.0/C/include -o src/funcs_AOS4.o src/funcs.c
  2. vc frontend for vbcc (c) in 1995-2016 by Volker Barthelmann
  3. vbccppc -quiet "src/funcs.c" -o= "/tmp/fileDfDQW4.scs" -dontwarn=-1 -I/opt/sdk/ppc-amigaos/Include/include_h -I/opt/sdk/MUI_5.0/C/include -elf -no-regnames -no-multiple-ccs -madd -c99 -use-commons -O=1023 -I$VBCC/targets/ppc-amigaos/include -D__amigaos4__
  4. > ULONG data[0]
  5. warning 61 in line 4294 of "libraries/mui.h": array of size <=0 (set to 1)
  6. included from file "src/funcs.c":24
  7. > set(app->LV_GamesList, MUIA_List_Quiet, FALSE);
  8. warning 161 in line 114 of "src/funcs.c": implicit declaration of function <SetAttrs>
  9. > DoMethod(app->LV_GamesList, MUIM_List_InsertSingle, item_games->title, MUIV_
  10. warning 161 in line 127 of "src/funcs.c": implicit declaration of function <DoMethod>
  11. > const BPTR fpsettings = Open((CONST_STRPTR)filename, MODE_OLDFILE);
  12. warning 161 in line 197 of "src/funcs.c": implicit declaration of function <Open>
  13. > if (FGets(fpsettings, file_line, buffer_size) == NULL)
  14. warning 161 in line 202 of "src/funcs.c": implicit declaration of function <FGets>
  15. > if (FGets(fpsettings, file_line, buffer_size) == NULL)
  16. error 93 in line 202 of "src/funcs.c": both operands of comparison must be pointers
  17. > Close(fpsettings);
  18. warning 161 in line 232 of "src/funcs.c": implicit declaration of function <Close>
  19. > if (FGets(fpgames, file_line, buffer_size) == NULL)
  20. error 93 in line 264 of "src/funcs.c": both operands of comparison must be pointers
  21. > if (FGets(fpgames, file_line, 500) == NULL)
  22. error 93 in line 282 of "src/funcs.c": both operands of comparison must be pointers
  23. > list_show_favorites(NULL);
  24. warning 161 in line 461 of "src/funcs.c": implicit declaration of function <list_show_favorites>
  25. >{
  26. warning 68 in line 517 of "src/funcs.c": redeclaration of var <list_show_favorites> with new type
  27. > get(app->STR_Filter, MUIA_String_Contents, &str);
  28. warning 161 in line 715 of "src/funcs.c": implicit declaration of function <GetAttr>
  29. > const BPTR oldlock = Lock((CONST_STRPTR)PROGDIR, ACCESS_READ);
  30. warning 161 in line 752 of "src/funcs.c": implicit declaration of function <Lock>
  31. > CurrentDir(oldlock);
  32. warning 161 in line 764 of "src/funcs.c": implicit declaration of function <CurrentDir>
  33. > if ((icon_base = (struct Library *)OpenLibrary((CONST_STRPTR)ICON_LIBRARY, 0)
  34. warning 161 in line 845 of "src/funcs.c": implicit declaration of function <OpenLibrary>
  35. > struct FileInfoBlock* m = (struct FileInfoBlock *)AllocMem(sizeof(struct Fil
  36. warning 161 in line 851 of "src/funcs.c": implicit declaration of function <AllocMem>
  37. > Examine(lock, m);
  38. warning 161 in line 853 of "src/funcs.c": implicit declaration of function <Examine>
  39. > while ((success = ExNext(lock, m)))
  40. warning 161 in line 860 of "src/funcs.c": implicit declaration of function <ExNext>
  41. > NameFromLock(lock, (unsigned char*)str2, 512);
  42. warning 161 in line 864 of "src/funcs.c": implicit declaration of function <NameFromLock>
  43. > if ((disk_obj = GetDiskObject((STRPTR)fullpath)))
  44. warning 161 in line 875 of "src/funcs.c": implicit declaration of function <GetDiskObject>
  45. > if ((disk_obj = GetDiskObject((STRPTR)fullpath)))
  46. error 39 in line 875 of "src/funcs.c": invalid types for assignment
  47. > || MatchToolValue(FindToolType(disk_obj->do_ToolTypes, (unsigned char*)"
  48. warning 161 in line 878 of "src/funcs.c": implicit declaration of function <MatchToolValue>
  49. > || MatchToolValue(FindToolType(disk_obj->do_ToolTypes, (unsigned char*)"
  50. warning 161 in line 878 of "src/funcs.c": implicit declaration of function <FindToolType>
  51. > FreeDiskObject(disk_obj);
  52. warning 161 in line 915 of "src/funcs.c": implicit declaration of function <FreeDiskObject>
  53. > CloseLibrary(icon_base);
  54. warning 161 in line 923 of "src/funcs.c": implicit declaration of function <CloseLibrary>
  55. > success = Execute((unsigned char*)exec, 0, 0);
  56. warning 161 in line 959 of "src/funcs.c": implicit declaration of function <Execute>
  57. > MUI_DisposeObject(app->IM_GameImage_0);
  58. warning 161 in line 1019 of "src/funcs.c": implicit declaration of function <MUI_DisposeObject>
  59. > End;
  60. warning 161 in line 1094 of "src/funcs.c": implicit declaration of function <MUI_NewObject>
  61. > End;
  62. error 39 in line 1094 of "src/funcs.c": invalid types for assignment
  63. > End;
  64. error 39 in line 1105 of "src/funcs.c": invalid types for assignment
  65. > End;
  66. error 39 in line 1140 of "src/funcs.c": invalid types for assignment
  67. > FPuts(fprepos, repo_path);
  68. warning 161 in line 1242 of "src/funcs.c": implicit declaration of function <FPuts>
  69. > FPutC(fprepos, '\n');
  70. warning 161 in line 1243 of "src/funcs.c": implicit declaration of function <FPutC>
  71. > char* helperstr = AllocMem(512 * sizeof(char), MEMF_CLEAR);
  72. error 39 in line 1284 of "src/funcs.c": invalid types for assignment
  73. > char* fullpath = AllocMem(800 * sizeof(char), MEMF_CLEAR);
  74. error 39 in line 1285 of "src/funcs.c": invalid types for assignment
  75. > char* str2 = AllocMem(512 * sizeof(char), MEMF_CLEAR);
  76. error 39 in line 1286 of "src/funcs.c": invalid types for assignment
  77. Maximum number of errors reached!
  78. unexpected end of file
  79. 10 errors found!
  80. vbccppc -quiet "src/funcs.c" -o= "/tmp/fileDfDQW4.scs" -dontwarn=-1 -I/opt/sdk/ppc-amigaos/Include/include_h -I/opt/sdk/MUI_5.0/C/include -elf -no-regnames -no-multiple-ccs -madd -c99 -use-commons -O=1023 -I$VBCC/targets/ppc-amigaos/include -D__amigaos4__ failed
  81. Makefile.docker:168: recipe for target 'src/funcs_AOS4.o' failed
  82. make: *** [src/funcs_AOS4.o] Error 1

I defined USE_INLINE and got the following

  1. vc +aosppc -dontwarn=-1 -O2 -lauto -v -I/opt/sdk/ppc-amigaos/Include/include_h -I/opt/sdk/MUI_5.0/C/include -D__USE_INLINE__ -o src/funcs_AOS4.o src/funcs.c
  2. vc frontend for vbcc (c) in 1995-2016 by Volker Barthelmann
  3. vbccppc -quiet "src/funcs.c" -o= "/tmp/fileiDNvqS.scs" -dontwarn=-1 -I/opt/sdk/ppc-amigaos/Include/include_h -I/opt/sdk/MUI_5.0/C/include -D__USE_INLINE__ -elf -no-regnames -no-multiple-ccs -madd -c99 -use-commons -O=1023 -I$VBCC/targets/ppc-amigaos/include -D__amigaos4__
  4. > ULONG data[0]
  5. warning 61 in line 4294 of "libraries/mui.h": array of size <=0 (set to 1)
  6. included from file "src/funcs.c":24
  7. > list_show_favorites(NULL);
  8. warning 161 in line 461 of "src/funcs.c": implicit declaration of function <list_show_favorites>
  9. >{
  10. warning 68 in line 517 of "src/funcs.c": redeclaration of var <list_show_favorites> with new type
  11. > CurrentDir(oldlock);
  12. warning 161 in line 764 of "src/funcs.c": implicit declaration of function <CurrentDir>
  13. > strcat(fname, request->rf_Dir);
  14. error 23 in line 1950 of "src/funcs.c": <rf_Dir> no member of struct/union
  15. > strcat(fname, request->rf_File);
  16. error 23 in line 1953 of "src/funcs.c": <rf_File> no member of struct/union
  17. 2 errors found!
  18. vbccppc -quiet "src/funcs.c" -o= "/tmp/fileiDNvqS.scs" -dontwarn=-1 -I/opt/sdk/ppc-amigaos/Include/include_h -I/opt/sdk/MUI_5.0/C/include -D__USE_INLINE__ -elf -no-regnames -no-multiple-ccs -madd -c99 -use-commons -O=1023 -I$VBCC/targets/ppc-amigaos/include -D__amigaos4__ failed
  19. Makefile.docker:168: recipe for target 'src/funcs_AOS4.o' failed
  20. make: *** [src/funcs_AOS4.o] Error 1

seems the problems reduced but does it make sense to use USE_INLINE or I shouldn't use it as well?

walkero
walkero's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: Porting iGame to AmigaOS 4 using vbcc

Managed to fix the above errors but I get something like the following

  1. vscppc -quiet "/tmp/filezmsdOG.scs" "/tmp/filezmsdOG.asm"
  2. sh: 1: vscppc: not found
  3. vscppc -quiet "/tmp/filezmsdOG.scs" "/tmp/filezmsdOG.asm" failed
  4. Makefile.docker:168: recipe for target 'src/funcs_AOS4.o' failed
  5. make: *** [src/funcs_AOS4.o] Error 1

Is this a vbcc installation error? Have in mind that I use a cross compiling environment based on Linux.

walkero
walkero's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: Porting iGame to AmigaOS 4 using vbcc

Found a solution with vscppc. Compiled it from vbcc sources. Everything is now included at my Amiga VBCC docker images, which can be found at https://github.com/walkero-gr/docker4AmigaVBCC

walkero
walkero's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: Porting iGame to AmigaOS 4 using vbcc

Woohooo. I managed to compile the application. I have only one warning that seems it comes from MUI and maybe is an incompatibility with vbcc which supports only up to c99

  1. > ULONG data[0]
  2. warning 61 in line 4294 of "libraries/mui.h": array of size <=0 (set to 1)

Did anyone have the same issue before? Is it possible to resolve or should I ignore it for now? Should I create a ticket at MUI dev website?

salass00
salass00's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2011-02-03 11:27
Re: Porting iGame to AmigaOS 4 using vbcc

Assuming that it's supposed to be a flexible array at the end of a struct, it should be declared as "ULONG data[];" instead of as a zero sized array which is something different and not standards compliant AFAIK.

Log in or register to post comments