Setup Gendev linux [Solved]
Moderator: Stef
-
- Very interested
- Posts: 115
- Joined: Fri Sep 18, 2015 2:56 pm
Setup Gendev linux [Solved]
CRAP! continue reading:
[SOLVED]
Just stick to the instructions.
[SOLVED]
Just stick to the instructions.
Last edited by Montserrat on Wed Jan 20, 2016 4:01 pm, edited 2 times in total.
Re: Setup Gendev + Codeblocks in debian, compiling problem.
make.exe is a Windows binary. You are on Linux.
-
- Very interested
- Posts: 115
- Joined: Fri Sep 18, 2015 2:56 pm
Re: Setup Gendev + Codeblocks in debian, compiling problem.
Sure, obviously.cero wrote:make.exe is a Windows binary. You are on Linux.
This is what Gendev builds for me, windows executables in a linux package. I only followed the instructables.
How do you configure codeblocks (or any other ide) to compile from linux? i've used "make" in project's directory terminal, it does generate a output .bin rom, but it does not work. (windows done this great).
btw i am compiling the Hello world example.
Re: Setup Gendev + Codeblocks in debian, compiling problem.
Wrong makefile. You want gendev/sgdk/skeleton/Makefile
EDIT: It also appears your Code::Blocks projects is configured to use "make.exe" explicitly so you will probably want to change that as well. I don't use that IDE so I can't tell you where that is configured though.
EDIT: It also appears your Code::Blocks projects is configured to use "make.exe" explicitly so you will probably want to change that as well. I don't use that IDE so I can't tell you where that is configured though.
-
- Very interested
- Posts: 115
- Joined: Fri Sep 18, 2015 2:56 pm
Re: Setup Gendev + Codeblocks in debian, compiling problem.
seems you have a working linux sgdk enviorment....can i ask you for a little tutorial for dummies PLEAAASEEE???Grind wrote:Wrong makefile. You want gendev/sgdk/skeleton/Makefile
EDIT: It also appears your Code::Blocks projects is configured to use "make.exe" explicitly so you will probably want to change that as well. I don't use that IDE so I can't tell you where that is configured though.
Re: Setup Gendev + Codeblocks in debian, compiling problem.
I'm not very good at tutorials but maybe this will explain it
Build Gendev
Hello World program
If something breaks that's probably because it is 12 AM and I didn't test these commands. Where are you stuck at the moment? Does "make" give you an error when you use the gendev makefile?
Build Gendev
Code: Select all
sudo apt-get install build-essential texinfo
cd
git clone https://github.com/kubilus1/gendev
cd gendev
sudo make
Code: Select all
cd
cp gendev/sgdk/skeleton .
cd skeleton
mkdir src
cat <<EOF > src/main.c
#include <genesis.h>
void main() {
VDP_init();
VDP_drawText("Hello World!", 2, 2);
while(1) {
VDP_waitVSync();
}
return 0;
}
EOF
make
-
- Very interested
- Posts: 115
- Joined: Fri Sep 18, 2015 2:56 pm
Re: Setup Gendev + Codeblocks in debian, compiling problem.
Thanks grind. That is what i previusly did, except for using cat to create a .c file i've used gedit...may be its the encoding?? i just moved to linux mint now because got problems to build gendev in debian, gonna start over again then ill tell you.
-
- Very interested
- Posts: 115
- Joined: Fri Sep 18, 2015 2:56 pm
Re: Setup Gendev + Codeblocks in debian, compiling problem.
Got same results, a out.bin (and temp.bin) i load them into umdk but got blackscreen. Thats the terminal output:
also changed void man for int main (i think the compiler expected int), bug got similar results...
The log warns about some functions conflict memset, memcpy, strcmp and sprintf any ideas?
Code: Select all
fran@fran-System-Product-Name ~/sk_test $ make
/opt/toolchains/gen//m68k-elf/bin/m68k-elf-as -m68000 --register-prefix-optional boot/sega.s -o boot/sega.o
/opt/toolchains/gen//m68k-elf/bin/m68k-elf-gcc -m68000 -Wall -O2 -c -fomit-frame-pointer -I. -I/opt/toolchains/gen//m68k-elf/include -I/opt/toolchains/gen//m68k-elf/m68k-elf/include -Isrc -Ires -c src/main.c -o src/main.o
In file included from /opt/toolchains/gen//m68k-elf/include/genesis.h:11:0,
from src/main.c:1:
/opt/toolchains/gen//m68k-elf/include/memory.h:199:6: aviso: tipos en conflicto para la función interna ‘memset’ [activado por defecto]
void memset(void *to, u8 value, u16 len);
^
/opt/toolchains/gen//m68k-elf/include/memory.h:242:6: aviso: tipos en conflicto para la función interna ‘memcpy’ [activado por defecto]
void memcpy(void *to, const void *from, u16 len);
^
In file included from /opt/toolchains/gen//m68k-elf/include/genesis.h:15:0,
from src/main.c:1:
/opt/toolchains/gen//m68k-elf/include/string.h:83:5: aviso: tipos en conflicto para la función interna ‘strcmp’ [activado por defecto]
s16 strcmp(const char *str1, const char *str2);
^
/opt/toolchains/gen//m68k-elf/include/string.h:237:5: aviso: tipos en conflicto para la función interna ‘sprintf’ [activado por defecto]
u16 sprintf(char *buffer,const char *fmt, ...);
^
src/main.c:2:6: aviso: el tipo de devolución de ‘main’ no es ‘int’ [-Wmain]
void main() {
^
src/main.c: En la función ‘main’:
src/main.c:8:4: aviso: ‘return’ con valor, en una función que devuelve void [activado por defecto]
return 0;
^
/opt/toolchains/gen//m68k-elf/bin/m68k-elf-gcc -o out.elf -T /opt/toolchains/gen//ldscripts/sgdk.ld -nostdlib boot/sega.o /opt/toolchains/gen//m68k-elf/lib/libmd.a /opt/toolchains/gen//m68k-elf/lib/gcc/m68k-elf/4.8.2/libgcc.a src/main.o -L/opt/toolchains/gen//m68k-elf/lib -L/opt/toolchains/gen//m68k-elf/lib/gcc/m68k-elf/* -L/opt/toolchains/gen//m68k-elf/m68k-elf/lib -lmd -lnosys
/opt/toolchains/gen//m68k-elf/bin/m68k-elf-objcopy -O binary out.elf temp.bin
dd if=temp.bin of=out.bin bs=8K conv=sync
10+1 registros leídos
11+0 registros escritos
90112 bytes (90 kB) copiados, 0,0004133 s, 218 MB/s
rm src/main.o out.elf
The log warns about some functions conflict memset, memcpy, strcmp and sprintf any ideas?
Re: Setup Gendev + Codeblocks in debian, compiling problem.
Did you only try UMDK or an emulator also? It has been some time since I last set up Gendev so I will try it again tonight or tomorrow in Ubuntu.
You can add an option to the compiler line "-nostdlib" or "-nobuiltin" don't quite remember which. That should get rid of the warnings.
As a bit of a side note, in the future it may be better to use Chris's cross compiler setup from UMDK to create our games. Problem is the makefiles are completely different than Gendev and the version of SGDK is old. When I have a solid free weekend I would like to come up with an example/instructions for updating SGDK in his environment as well as compiling a game with debugging. Second part should be easy basing it off the menu.
You can add an option to the compiler line "-nostdlib" or "-nobuiltin" don't quite remember which. That should get rid of the warnings.
As a bit of a side note, in the future it may be better to use Chris's cross compiler setup from UMDK to create our games. Problem is the makefiles are completely different than Gendev and the version of SGDK is old. When I have a solid free weekend I would like to come up with an example/instructions for updating SGDK in his environment as well as compiling a game with debugging. Second part should be easy basing it off the menu.
-
- Very interested
- Posts: 115
- Joined: Fri Sep 18, 2015 2:56 pm
Re: Setup Gendev + Codeblocks in debian, compiling problem.
Only tried UMDK, since the rom i compiled in the sgdk windows version worked fine in the umdk i suposse there is no problem with the cart.
Also gonna ask Gendev creator aswell...
Also gonna ask Gendev creator aswell...
Re: Setup Gendev + Codeblocks in debian, compiling problem.
... should be cp -r gendev/sgdk/skeleton .cd
cp gendev/sgdk/skeleton .
This means the boot dir wasn't copies and is likely wrong. I don't have a convenient way to verify this on real hardware ATM, but I could see this leading to a blank screen. First step would be to verify on emulator perhaps.
Fyi, take a look here for some very basic instructions: https://github.com/kubilus1/gendev/
Nope. No windows executables here at all. Gendev is 100% pureish *nix.This is what Gendev builds for me, windows executables in a linux package. I only followed the instructables.
Don't know about IDEs, I never use them. Unless vim is considered an IDE.
Good luck and don't get discouraged. Getting a decent workflow that works for YOU is probably one of the most difficult parts of this stuff!
-
- Very interested
- Posts: 115
- Joined: Fri Sep 18, 2015 2:56 pm
Re: Setup Gendev + Codeblocks in debian, compiling problem.
Yup thanks for reply, about the skeleton directory, yes i copied recursively. Also followed the official intructions with same results i did:kubilus1 wrote:cd
cp gendev/sgdk/skeleton .
... should be cp -r gendev/sgdk/skeleton .
Fyi, take a look here for some very basic instructions: https://github.com/kubilus1/gendev/
Nope. No windows executables here at all. Gendev is 100% pureish *nix.This is what Gendev builds for me, windows executables in a linux package. I only followed the instructables.
Code: Select all
sudo apt-get install build-essential texinfo git
git clone https://github.com/kubilus1/gendev.git
cd gendev
make
....building process.
cp -r /opt/toolchains/gen/skeleton myfolder (also tried to copy cp -r gendev/sgdk/skeleton)
cd myfolder
*type type type the hello world example from sgdk wiki*
make
Re: Setup Gendev + Codeblocks in debian, compiling problem.
What about running the out.bin in an emulator? Does that work?
-
- Very interested
- Posts: 115
- Joined: Fri Sep 18, 2015 2:56 pm
Re: Setup Gendev + Codeblocks in debian, compiling problem.
....done a fresh install on mint, now it works....i've done this 1000 times without results i dont know wtf has happened but...
... problem solved, it works now both emulator and UMDK.
Thanks for your time!
PD: mod can you close this thread?
... problem solved, it works now both emulator and UMDK.
Thanks for your time!
PD: mod can you close this thread?