Help Setting up KOS in Netbeans IDE

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
CSword123
DCEmu Newbie
DCEmu Newbie
Posts: 8
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sat Sep 22, 2018 11:14 pm
Has thanked: 3 times
Been thanked: 0

Help Setting up KOS in Netbeans IDE

Post by CSword123 »

I'd like to use NetBeans 8.2 to start making DC compatible programs so I ran the KOS Windows script from the dcemulation wiki, then edited the environ.sh file a bit. I'm trying to compile hello.c from the examples directory but I get the following error in the Netbeans Output log:

Code: Select all

cd 'C:\msys64\opt\toolchains\dc\kos\examples\dreamcast\hello'
C:\msys64\usr\bin\make.exe -f Makefile
Makefile:21: /Makefile.rules: No such file or directory
make: *** No rule to make target '/Makefile.rules'.  Stop.

BUILD FAILED (exit value 2, total time: 53ms)
Here's what the Build Tools settings looks like in NetBeans:
buildtools.PNG
How should I proceed from here?
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Help Setting up KOS in Netbeans IDE

Post by BlueCrab »

Unfortunately, the way KOS is setup, it really requires a UNIX-like environment unless you want to do a lot of tinkering to make it work. All of the Makefiles for the examples and such really need to be run in a POSIX-like shell, with a bunch of environment variables set.
CSword123
DCEmu Newbie
DCEmu Newbie
Posts: 8
Joined: Sat Sep 22, 2018 11:14 pm
Has thanked: 3 times
Been thanked: 0

Re: Help Setting up KOS in Netbeans IDE

Post by CSword123 »

Oh dear. I didn't want to have to go full Ubuntu :(. I prefer a Windows environment. I'm not opposed to switching to a Linux partition but only if I absolutely cannot get NetBeans to work here. Any ideas?
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Help Setting up KOS in Netbeans IDE

Post by BlueCrab »

You could make it work, but you’re going to basically need to do one of the following:
1. Use a MSYS terminal to compile (or something similar like the Windows Subsystem for Linux).
2. Rewrite all the Makefiles for the things you’re compiling such that they don’t rely on the environment variables that KOS’ normal Makefiles have set.

It is entirely possible to do number 2 on that list, as people have used KOS with other Windows IDEs before. Unfortunately, I know next to nothing about Netbeans and never have used an IDE for doing Dreamcast stuff.
CSword123
DCEmu Newbie
DCEmu Newbie
Posts: 8
Joined: Sat Sep 22, 2018 11:14 pm
Has thanked: 3 times
Been thanked: 0

Re: Help Setting up KOS in Netbeans IDE

Post by CSword123 »

Can I get contact info on those who got KOS to work on Windows IDEs or can you alert them to this thread? Pure text interfaces for programming isn't my thing, though I am currently learning Unix in school.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Help Setting up KOS in Netbeans IDE

Post by BlueCrab »

Unfortunately, those setups were pretty darn old at this point.
CSword123
DCEmu Newbie
DCEmu Newbie
Posts: 8
Joined: Sat Sep 22, 2018 11:14 pm
Has thanked: 3 times
Been thanked: 0

Re: Help Setting up KOS in Netbeans IDE

Post by CSword123 »

Darn, then I guess i'll proceed with text-based compilation for now. No worries.
Thanks for the assistance.
User avatar
lerabot
Insane DCEmu
Insane DCEmu
Posts: 134
Joined: Sun Nov 01, 2015 8:25 pm
Has thanked: 2 times
Been thanked: 19 times

Re: Help Setting up KOS in Netbeans IDE

Post by lerabot »

If you switch to Ubuntu you could get VS Studio? I've just looked at NetBeans and it looks kinda like it.
I use Atom personnaly but I see that it might be a bit barebone for you.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Help Setting up KOS in Netbeans IDE

Post by BlueCrab »

lerabot wrote: Mon Sep 24, 2018 9:10 am If you switch to Ubuntu you could get VS Studio? I've just looked at NetBeans and it looks kinda like it.
I use Atom personnaly but I see that it might be a bit barebone for you.
Assuming you're talking about VS Code, that's available on Windows too.
CSword123
DCEmu Newbie
DCEmu Newbie
Posts: 8
Joined: Sat Sep 22, 2018 11:14 pm
Has thanked: 3 times
Been thanked: 0

Re: Help Setting up KOS in Netbeans IDE

Post by CSword123 »

I'll check out VS Code. I've used VS2017 Community so I imagine it's a more portable version with an even simpler interface.

After I type something up, my next step would be to run g++ in the MSYS2 terminal correct? I'm going to prototype code on a DC using DreamShell so I believe I only need an ELF file until I make a CD-R final which requires IP.bin and 1ST_READ.bin converted to an ISO.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Help Setting up KOS in Netbeans IDE

Post by BlueCrab »

Your next step would be to put together a simple Makefile that builds your code. Most people just take one of the ones from the KOS examples and just modify it to suit their needs. Then you'd build your program by going into its directory with MSYS2 and running the make program.
CSword123
DCEmu Newbie
DCEmu Newbie
Posts: 8
Joined: Sat Sep 22, 2018 11:14 pm
Has thanked: 3 times
Been thanked: 0

Re: Help Setting up KOS in Netbeans IDE

Post by CSword123 »

So I tried using make on MSYS2 and I got the exact same error as the Netbeans output log so I assumed that the make program couldn't find the directory where "Makefile.rules" is stored. In the hello.c example, I commented out the "KOS_BASE" path and added:

Code: Select all

#include $(KOS_BASE)/Makefile.rules
include $ C:/msys64/opt/toolchains/dc/kos/Makefile.rules
And now I get the following error when I type "make" in the hello folder

Code: Select all

$ make hello
kos-cc  -c hello.c -o hello.o
make: kos-cc: Command not found
make: *** [C:/msys64/opt/toolchains/dc/kos/Makefile.rules:13: hello.o] Error 127
I go to line 13 in Makefile.rules but i'm not sure how to change it to get the compiler to work and get my precious ELF file. What should I do?

Forgive my incompetence with Makefiles, they just seem painful to work with for me.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Help Setting up KOS in Netbeans IDE

Post by BlueCrab »

You need to source the environment script (usually called "environ.sh") to set up the various variables that the shell needs (including the aforementioned KOS_BASE).

The easiest thing to do is to do so in your shell's startup file (which if you're using bash as your shell (I'm not sure what MSYS2 uses, to be perfectly honest) is usually either ~/.bashrc or ~/.bash_profile).
Post Reply