You are not logged in.

#1 2009-09-11 20:39:48

dragos240
Member
Registered: 2009-05-23
Posts: 189

Trying to compile dcdis.

But I'm getting this:

[root@localhost dcdis-0.4a]# make
gcc -g -O2 -Wall -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDIO_H=1 -DHAVE_FPRINTF=1 -DHAVE_FOPEN=1 -DHAVE_FREAD=1 -DHAVE_STAT=1 -DHAVE_SSCANF=1 -DHAVE_STRSTR=1 -DHAVE_MEMCPY=1  -c dcdis.c
In file included from dcdis.c:13:
dcdis.h:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2short'
dcdis.h:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2int'
In file included from dcdis.c:14:
decode.h:17: error: expected ')' before 'char'
In file included from dcdis.c:16:
symtab.h:23: error: expected specifier-qualifier-list before 'uint32_t'
symtab.h:29: error: expected declaration specifiers or '...' before 'uint32_t'
symtab.h:32: error: expected ')' before 'addr'
dcdis.c:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2short'
dcdis.c:32: error: expected identifier or '(' before '{' token
dcdis.c:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2int'
dcdis.c:48: error: expected identifier or '(' before '{' token
dcdis.c: In function 'main':
dcdis.c:99: error: 'uint16_t' undeclared (first use in this function)
dcdis.c:99: error: (Each undeclared identifier is reported only once
dcdis.c:99: error: for each function it appears in.)
dcdis.c:99: error: expected ';' before 'my_opcode'
dcdis.c:111: error: 'uint32_t' undeclared (first use in this function)
dcdis.c:111: error: expected ';' before 'my_pc'
dcdis.c:112: error: expected ';' before 'start_address'
dcdis.c:121: error: 'start_address' undeclared (first use in this function)
dcdis.c:183: error: 'my_pc' undeclared (first use in this function)
dcdis.c:193: warning: implicit declaration of function 'symtab_lookup'
dcdis.c:199: error: 'my_opcode' undeclared (first use in this function)
dcdis.c:199: warning: implicit declaration of function 'char2short'
dcdis.c:206: warning: implicit declaration of function 'decode'
dcdis.c:206: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
make: *** [dcdis.o] Error 1

For those who don't know, Dcdis is a set of dev tools for developing software for the sega dreamcast. The last modification to this program was in 2004.

Offline

#2 2009-09-13 12:48:53

dragos240
Member
Registered: 2009-05-23
Posts: 189

Re: Trying to compile dcdis.

dragos240 wrote:

But I'm getting this:

[root@localhost dcdis-0.4a]# make
gcc -g -O2 -Wall -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDIO_H=1 -DHAVE_FPRINTF=1 -DHAVE_FOPEN=1 -DHAVE_FREAD=1 -DHAVE_STAT=1 -DHAVE_SSCANF=1 -DHAVE_STRSTR=1 -DHAVE_MEMCPY=1  -c dcdis.c
In file included from dcdis.c:13:
dcdis.h:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2short'
dcdis.h:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2int'
In file included from dcdis.c:14:
decode.h:17: error: expected ')' before 'char'
In file included from dcdis.c:16:
symtab.h:23: error: expected specifier-qualifier-list before 'uint32_t'
symtab.h:29: error: expected declaration specifiers or '...' before 'uint32_t'
symtab.h:32: error: expected ')' before 'addr'
dcdis.c:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2short'
dcdis.c:32: error: expected identifier or '(' before '{' token
dcdis.c:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2int'
dcdis.c:48: error: expected identifier or '(' before '{' token
dcdis.c: In function 'main':
dcdis.c:99: error: 'uint16_t' undeclared (first use in this function)
dcdis.c:99: error: (Each undeclared identifier is reported only once
dcdis.c:99: error: for each function it appears in.)
dcdis.c:99: error: expected ';' before 'my_opcode'
dcdis.c:111: error: 'uint32_t' undeclared (first use in this function)
dcdis.c:111: error: expected ';' before 'my_pc'
dcdis.c:112: error: expected ';' before 'start_address'
dcdis.c:121: error: 'start_address' undeclared (first use in this function)
dcdis.c:183: error: 'my_pc' undeclared (first use in this function)
dcdis.c:193: warning: implicit declaration of function 'symtab_lookup'
dcdis.c:199: error: 'my_opcode' undeclared (first use in this function)
dcdis.c:199: warning: implicit declaration of function 'char2short'
dcdis.c:206: warning: implicit declaration of function 'decode'
dcdis.c:206: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
make: *** [dcdis.o] Error 1

For those who don't know, Dcdis is a set of dev tools for developing software for the sega dreamcast. The last modification to this program was in 2004.

Help?

Offline

#3 2009-09-14 10:00:31

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Trying to compile dcdis.

try to put a

#include <climits>

somewhere befoor line 13 of dcdis.c

Offline

#4 2009-09-14 19:22:33

dragos240
Member
Registered: 2009-05-23
Posts: 189

Re: Trying to compile dcdis.

Stefan Husmann wrote:

try to put a

#include <climits>

somewhere befoor line 13 of dcdis.c

Will do!

EDIT: When I added that, This happened:

dcdis.c:12:19: error: climits: No such file or directory

Last edited by dragos240 (2009-09-14 19:51:38)

Offline

#5 2009-09-15 00:31:54

Varreon
Member
Registered: 2008-07-03
Posts: 95

Re: Trying to compile dcdis.

Try changing <climits> to <climits.h>

Offline

#6 2009-09-15 00:53:14

dragos240
Member
Registered: 2009-05-23
Posts: 189

Re: Trying to compile dcdis.

Varreon wrote:

Try changing <climits> to <climits.h>

I also did that too. Same. I also downloaded climits.h from the web into the dcdis folder, and still. No luck.

Offline

#7 2009-09-16 04:29:33

cha0s6983
Member
Registered: 2009-09-15
Posts: 5

Re: Trying to compile dcdis.

I'm having the uint32_h problem too, just trying to compile some of my code for the first time on Arch. Anyone know what gives?

Offline

#8 2009-09-16 20:28:37

dragos240
Member
Registered: 2009-05-23
Posts: 189

Re: Trying to compile dcdis.

cha0s6983 wrote:

I'm having the uint32_h problem too, just trying to compile some of my code for the first time on Arch. Anyone know what gives?

I don't think it has anything to do what system you're using. The latest version is from 2004 and it's pre-alpha. So I expect there are some bugs. Also, the newer software may be incompatible with the older code.

Offline

#9 2009-09-17 01:13:52

Lexion
Member
Registered: 2008-03-23
Posts: 510

Re: Trying to compile dcdis.

try a

$ locate climit

and put the path (relative to /usr/include) in the #include <...> command.  If climits.h isn't in /usr/include/** then use -I.


urxvtc / wmii / zsh / configs / onebluecat.net
Arch will not hold your hand

Offline

#10 2009-09-19 00:20:14

dragos240
Member
Registered: 2009-05-23
Posts: 189

Re: Trying to compile dcdis.

What is climits exactly?

Offline

#11 2009-09-19 12:36:37

dragos240
Member
Registered: 2009-05-23
Posts: 189

Re: Trying to compile dcdis.

Lexion wrote:

try a

$ locate climit

and put the path (relative to /usr/include) in the #include <...> command.  If climits.h isn't in /usr/include/** then use -I.

make
gcc -g -O2 -Wall -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDIO_H=1 -DHAVE_FPRINTF=1 -DHAVE_FOPEN=1 -DHAVE_FREAD=1 -DHAVE_STAT=1 -DHAVE_SSCANF=1 -DHAVE_STRSTR=1 -DHAVE_MEMCPY=1  -c dcdis.c
In file included from dcdis.c:13:
dcdis.h:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2short'
dcdis.h:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2int'
In file included from dcdis.c:14:
decode.h:17: error: expected ')' before 'char'
In file included from dcdis.c:16:
symtab.h:23: error: expected specifier-qualifier-list before 'uint32_t'
symtab.h:29: error: expected declaration specifiers or '...' before 'uint32_t'
symtab.h:32: error: expected ')' before 'addr'
dcdis.c:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2short'
dcdis.c:32: error: expected identifier or '(' before '{' token
dcdis.c:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char2int'
dcdis.c:48: error: expected identifier or '(' before '{' token
dcdis.c: In function 'main':
dcdis.c:99: error: 'uint16_t' undeclared (first use in this function)
dcdis.c:99: error: (Each undeclared identifier is reported only once
dcdis.c:99: error: for each function it appears in.)
dcdis.c:99: error: expected ';' before 'my_opcode'
dcdis.c:111: error: 'uint32_t' undeclared (first use in this function)
dcdis.c:111: error: expected ';' before 'my_pc'
dcdis.c:112: error: expected ';' before 'start_address'
dcdis.c:121: error: 'start_address' undeclared (first use in this function)
dcdis.c:183: error: 'my_pc' undeclared (first use in this function)
dcdis.c:193: warning: implicit declaration of function 'symtab_lookup'
dcdis.c:193: warning: cast to pointer from integer of different size
dcdis.c:199: error: 'my_opcode' undeclared (first use in this function)
dcdis.c:199: warning: implicit declaration of function 'char2short'
dcdis.c:206: warning: implicit declaration of function 'decode'
dcdis.c:206: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
make: *** [dcdis.o] Error 1

Well, good news, it found climits. But the same errors occur.

Offline

#12 2009-09-19 12:46:07

arkham
Member
From: Stockholm
Registered: 2008-10-26
Posts: 516
Website

Re: Trying to compile dcdis.

The problem is that the code you are trying to compile was developed using a much older version of gcc; unfortunately at every gcc release a lot of code gets broken. Imagine 5 years of releases smile


"I'm Winston Wolfe. I solve problems."

~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~

Offline

#13 2009-09-19 16:21:22

kumyco
Member
From: somewhere
Registered: 2008-06-23
Posts: 153
Website

Re: Trying to compile dcdis.

unless i got the wrong dcdis(never heard of it before today), patch below should fix it

:100644 100644 14f6ec8... 0000000... M    dcdis.c
:100644 100644 d385f3b... 0000000... M    dcdis.h
:100644 100644 bc1039d... 0000000... M    decode.c
:100644 100644 48d01e0... 0000000... M    decode.h
:100644 100644 6186d00... 0000000... M    symtab.c
:100644 100644 4dc82cc... 0000000... M    symtab.h

diff --git a/dcdis.c b/dcdis.c
index 14f6ec8..c4bafcb 100644
--- a/dcdis.c
+++ b/dcdis.c
@@ -196,7 +196,7 @@ main(argc, argv)
 #endif
         fprintf(out, "H'%08x: ", my_pc);
 
-        my_opcode = char2short(&file[i]);
+        my_opcode = char2short((uint8_t*)&file[i]);
         fprintf(out, "H'%04x  ", my_opcode);
 
         for (j = 0; j < (N_O_BITS/8); j++) {
diff --git a/dcdis.h b/dcdis.h
index d385f3b..200317c 100644
--- a/dcdis.h
+++ b/dcdis.h
@@ -12,7 +12,7 @@
 #ifndef _DCDIS_H_
 #define _DCDIS_H_
 
-#include <sys/types.h>
+#include <stdint.h>
 
 #define N_O_BITS 16    /* SH-4 instructions are 16-bit fixed width */
 #define START_ADDRESS    0x8c010000
diff --git a/decode.c b/decode.c
index bc1039d..af16527 100644
--- a/decode.c
+++ b/decode.c
@@ -16,6 +16,7 @@
 #include "symtab.h"
 #endif
 #include <stdio.h>
+#include <string.h>
 
 extern int standard_disp;
 
@@ -50,7 +51,7 @@ decode(opcode, cur_PC, file, size, start_address)
             reference = IMM*2+cur_PC+4;
             reference2 = (reference&0x1fffffff)-(start_address&0x1fffffff);
             if (reference2 >= 0 && reference2 <= size) {
-                literal = char2short(&file[reference2]);
+                literal = char2short((uint8_t*)&file[reference2]);
             }
 #ifdef DO_SYMBOL
             my_sym = (char *)symtab_lookup(reference);
@@ -80,7 +81,7 @@ decode(opcode, cur_PC, file, size, start_address)
             reference = (IMM*4+(cur_PC&0xfffffffc)+4);
             reference2 = (reference&0x1fffffff)-(start_address&0x1fffffff);
             if (reference2 >= 0 && reference2 <= size) {
-                literal = char2int(&file[reference2]);
+                literal = char2int((uint8_t*)&file[reference2]);
             }
 #ifdef DO_SYMBOL
             my_sym = (char *)symtab_lookup(reference);
diff --git a/decode.h b/decode.h
index 48d01e0..639435f 100644
--- a/decode.h
+++ b/decode.h
@@ -12,7 +12,7 @@
 #ifndef _DECODE_H_
 #define _DECODE_H_
 
-#include <sys/types.h>
+#include <stdint.h>
 
 char *decode(uint16_t, uint32_t, char *, uint32_t, uint32_t);
 
diff --git a/symtab.c b/symtab.c
index 6186d00..e9c07fc 100644
--- a/symtab.c
+++ b/symtab.c
@@ -86,8 +86,8 @@ symtab_read(fp)
     FILE *fp;
 {
 
-    unsigned char buf[256];
-    unsigned char buf2[256];
+    char buf[256];
+    char buf2[256];
     char *ptr;
     struct symtab *entry;
     int i;
@@ -134,7 +134,7 @@ symtab_read(fp)
             symtab_insert(entry);
         }
     }
-
+    return 0;
 }
 
 char *
diff --git a/symtab.h b/symtab.h
index 4dc82cc..29a72d3 100644
--- a/symtab.h
+++ b/symtab.h
@@ -12,7 +12,7 @@
 #ifndef _SYMTAB_H_
 #define _SYMTAB_H_
 
-#include <sys/types.h>
+#include <stdint.h>
 #include "dcdis.h"
 #include <stdio.h>

only major change is sys/type.h changed to stdint.h, other changes are to fix warnings and potential bugs.

Offline

#14 2009-09-19 23:16:16

dragos240
Member
Registered: 2009-05-23
Posts: 189

Re: Trying to compile dcdis.

kumyco wrote:

unless i got the wrong dcdis(never heard of it before today), patch below should fix it

:100644 100644 14f6ec8... 0000000... M    dcdis.c
:100644 100644 d385f3b... 0000000... M    dcdis.h
:100644 100644 bc1039d... 0000000... M    decode.c
:100644 100644 48d01e0... 0000000... M    decode.h
:100644 100644 6186d00... 0000000... M    symtab.c
:100644 100644 4dc82cc... 0000000... M    symtab.h

diff --git a/dcdis.c b/dcdis.c
index 14f6ec8..c4bafcb 100644
--- a/dcdis.c
+++ b/dcdis.c
@@ -196,7 +196,7 @@ main(argc, argv)
 #endif
         fprintf(out, "H'%08x: ", my_pc);
 
-        my_opcode = char2short(&file[i]);
+        my_opcode = char2short((uint8_t*)&file[i]);
         fprintf(out, "H'%04x  ", my_opcode);
 
         for (j = 0; j < (N_O_BITS/8); j++) {
diff --git a/dcdis.h b/dcdis.h
index d385f3b..200317c 100644
--- a/dcdis.h
+++ b/dcdis.h
@@ -12,7 +12,7 @@
 #ifndef _DCDIS_H_
 #define _DCDIS_H_
 
-#include <sys/types.h>
+#include <stdint.h>
 
 #define N_O_BITS 16    /* SH-4 instructions are 16-bit fixed width */
 #define START_ADDRESS    0x8c010000
diff --git a/decode.c b/decode.c
index bc1039d..af16527 100644
--- a/decode.c
+++ b/decode.c
@@ -16,6 +16,7 @@
 #include "symtab.h"
 #endif
 #include <stdio.h>
+#include <string.h>
 
 extern int standard_disp;
 
@@ -50,7 +51,7 @@ decode(opcode, cur_PC, file, size, start_address)
             reference = IMM*2+cur_PC+4;
             reference2 = (reference&0x1fffffff)-(start_address&0x1fffffff);
             if (reference2 >= 0 && reference2 <= size) {
-                literal = char2short(&file[reference2]);
+                literal = char2short((uint8_t*)&file[reference2]);
             }
 #ifdef DO_SYMBOL
             my_sym = (char *)symtab_lookup(reference);
@@ -80,7 +81,7 @@ decode(opcode, cur_PC, file, size, start_address)
             reference = (IMM*4+(cur_PC&0xfffffffc)+4);
             reference2 = (reference&0x1fffffff)-(start_address&0x1fffffff);
             if (reference2 >= 0 && reference2 <= size) {
-                literal = char2int(&file[reference2]);
+                literal = char2int((uint8_t*)&file[reference2]);
             }
 #ifdef DO_SYMBOL
             my_sym = (char *)symtab_lookup(reference);
diff --git a/decode.h b/decode.h
index 48d01e0..639435f 100644
--- a/decode.h
+++ b/decode.h
@@ -12,7 +12,7 @@
 #ifndef _DECODE_H_
 #define _DECODE_H_
 
-#include <sys/types.h>
+#include <stdint.h>
 
 char *decode(uint16_t, uint32_t, char *, uint32_t, uint32_t);
 
diff --git a/symtab.c b/symtab.c
index 6186d00..e9c07fc 100644
--- a/symtab.c
+++ b/symtab.c
@@ -86,8 +86,8 @@ symtab_read(fp)
     FILE *fp;
 {
 
-    unsigned char buf[256];
-    unsigned char buf2[256];
+    char buf[256];
+    char buf2[256];
     char *ptr;
     struct symtab *entry;
     int i;
@@ -134,7 +134,7 @@ symtab_read(fp)
             symtab_insert(entry);
         }
     }
-
+    return 0;
 }
 
 char *
diff --git a/symtab.h b/symtab.h
index 4dc82cc..29a72d3 100644
--- a/symtab.h
+++ b/symtab.h
@@ -12,7 +12,7 @@
 #ifndef _SYMTAB_H_
 #define _SYMTAB_H_
 
-#include <sys/types.h>
+#include <stdint.h>
 #include "dcdis.h"
 #include <stdio.h>

only major change is sys/type.h changed to stdint.h, other changes are to fix warnings and potential bugs.

Where does this go?

Offline

#15 2009-09-20 06:32:51

kumyco
Member
From: somewhere
Registered: 2008-06-23
Posts: 153
Website

Re: Trying to compile dcdis.

Offline

Board footer

Powered by FluxBB