After you have a source code how do you compile it.

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
Cmtz
Mental DCEmu
Mental DCEmu
Posts: 380
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sun Nov 18, 2001 6:19 pm
Location: Tx
Has thanked: 0
Been thanked: 0

After you have a source code how do you compile it.

Post by Cmtz »

How do you make a sourc code into a program the dc can read.

I have the dcphoenix code and I'm working with it, but don't expect anything. I haven't worked with c or c++ in four years.


How do you compile the code.

Thanks
Cmtz
IUG-13
Has thanked: 0
Been thanked: 0

Post by IUG-13 »

MOVED TO PROGRAMING HELP FROM OFF TOPIC
Sanchez
DCEmu Ex-Admin
DCEmu Ex-Admin
Posts: 1098
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by Sanchez »

There should be a makefile included that has the specifics. Make sure you have everything that's required (GCC for SH4, etc...) I think that used libdream so you'll need it too.... You'll essentially need a full development environment setup before you can do anything with it.....
The Biz
DCEmu Junior
DCEmu Junior
Posts: 45
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by The Biz »

If you have MS Visual c++, just open filename.c and find the menu bar option for link/compile. The executable ends up in a subfolder of the folder of the source.

In nix, at prompt type: gcc -c filename.c
then: gcc filename.o -o filename
then to run: ./filename
or
gcc filename.c
then to run: ./a.out

Dunno about c++ sources or other compiler apps.
Sanchez
DCEmu Ex-Admin
DCEmu Ex-Admin
Posts: 1098
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by Sanchez »

[quote="The Biz"]
If you have MS Visual c++, just open filename.c and find the menu bar option for link/compile. The executable ends up in a subfolder of the folder of the source.

In nix, at prompt type: gcc -c filename.c
then: gcc filename.o -o filename
then to run: ./filename
or
gcc filename.c
then to run: ./a.out

Dunno about c++ sources or other compiler apps.
[/quote]

This procedure won't work (at least not as written) when compiling for the DC. You must specify exactly what libraries to link against, the location in memory to sit, and other DC specific options.
The Biz
DCEmu Junior
DCEmu Junior
Posts: 45
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by The Biz »

oops, missed that part about "for the dreamcast"

/me lowers head in shame
User avatar
showka
DCEmu Freak
DCEmu Freak
Posts: 95
Joined: Fri Nov 23, 2001 12:01 pm
Location: Border Town
Has thanked: 0
Been thanked: 0
Contact:

Geeze,

Post by showka »

Someone needs to write up a very thorough guide for idiots that will allow them to compile source code into a CD that'll work on the Dreamcast. If this ever happened, the "scene" would get a hell of a lot more active.
kRYPT_
DCFactory Creator
DCFactory Creator
Posts: 597
Joined: Mon Nov 12, 2001 7:58 pm
Location: Ontario, Canada
Has thanked: 0
Been thanked: 0
Contact:

Geeze,

Post by kRYPT_ »

showka wrote: Someone needs to write up a very thorough guide for idiots that will allow them to compile source code into a CD that'll work on the Dreamcast. If this ever happened, the "scene" would get a hell of a lot more active.
Oh, for sure!

Then, Idiots everywhere would use the DreamCast as their platform of choice...
NiGHTSFTP
Mental DCEmu
Mental DCEmu
Posts: 491
Joined: Tue Nov 20, 2001 7:35 pm
Has thanked: 0
Been thanked: 0

Geeze,

Post by NiGHTSFTP »

kRYPT_ wrote:
showka wrote: Someone needs to write up a very thorough guide for idiots that will allow them to compile source code into a CD that'll work on the Dreamcast. If this ever happened, the "scene" would get a hell of a lot more active.
Oh, for sure!

Then, Idiots everywhere would use the DreamCast as their platform of choice...
Yesh, but active idiots, not idle ones that bitch & whine about the shitty EMU's for the DC. Think about it! They can say "Hey, the DreaMSNES sux, SPIT!!!$#@%%!!!", but you can say "Here's the instructions, compile your own, ya ungrateful fuc|<."
Signatures images may be no greater than cock pixels high by dick pixels wide in dimension and balls kilobytes in filesize. Multiple images may be wang, but in total they may not exceed the johnson specifications.
Sanchez
DCEmu Ex-Admin
DCEmu Ex-Admin
Posts: 1098
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by Sanchez »

ok, enough of this.....

TOPIC CLOSED
IUG-13
Has thanked: 0
Been thanked: 0

Post by IUG-13 »

TOPIC OPENED

Sorry, but I want to know how you are supposed to compile for the DC...
Sanchez
DCEmu Ex-Admin
DCEmu Ex-Admin
Posts: 1098
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by Sanchez »

heh... alright, mod fight!!!

Nah, typically you have to setup the SH4 (and possibly ARM7) gcc toolchain on either a Unix system or Cygwin. This is a rather long, involved process that is more properly documented elsewhere. The site I used long ago to do it was Hitmen's description, I believe there have been a few more since.

As for actually compiling it, it's really no different than a standard program compilation. The main differences are you specify the proper library and compilation tools (in this case sh-elf-xxxx). You also obviously must copy to the dc to run it.

All of the compilation is typically handled via make, which reads the Makefile and follows the appropriate instructions. For source code someone else wrote, you usually just change the Makefile to point to the location of the sh-elf toolchain on your system. If writing your own software, it's usually easier to copy a Makefile and go from there (I did this for some KOS code...)

That brings up the other point of having some library to compile against for setting up the DC. This is usually libdream or KOS.
Post Reply