Beginner question about DreamSDK R2

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
User avatar
Memorix101
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 13
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Apr 21, 2016 7:03 am
Has thanked: 3 times
Been thanked: 0
Contact:

Beginner question about DreamSDK R2

Post by Memorix101 »

Hey,
I am new to DreamSDK and dc development and I have a few questions.

I wrote a little c++ code and tried to compile it.
The terminal regularly prompts me this note:
D:/Dev/DreamSDK/msys/1.0/opt/toolchains/dc/kos/kernel/arch/dreamcast/include/arch/arch.h:32:10: note: #pragma message: Outdated toolchain: not patched for 32MB support, limiting KOS to 16MB-only behavior to retain maximum compatibility. Please update toolchain.
But the Manager always tells me that I am up to date. Maybe some of you have some information about this.

The other thing is that I am not really sure how I can enable C++11 or newer features as I get warning or error messages like:
error: in C++98 'vec' must be initialized by constructor, not by '{...}'
vec is a variable. Its datatype is a struct called vector2

Code: Select all

struct vector2
{
	int x = 0;
	int y = 0;
};
Gcc complains that I do this:

Code: Select all

 vector2 vec = { 10, 10 };
While msvc does not. Maybe this is also a conflict that msvc does certain things differently.
My code works flawlessly in msvc but not with gcc as you can see.
warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]
warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
error: 'nullptr' was not declared in this scope
This one is really weird, so C++11 is not enabled?!

I tried a few things but the makefile ignores it maybe because of the makefile.rules applied, I don't know.
I hope some of you can help me. :)

Edit:
My code compiles fine under WSL (Ubuntu) :grin:
I also tested the DreamSDK R3-dev build, but this is completely unsusable for me. I can't get any of the kos-ports compiled without an error.
|darc|
DCEmu Webmaster
DCEmu Webmaster
Posts: 16378
Joined: Wed Mar 14, 2001 6:00 pm
Location: New Orleans, LA
Has thanked: 109 times
Been thanked: 91 times
Contact:

Re: Beginner question about DreamSDK R2

Post by |darc| »

I don't use DreamSDK so I'm not sure if this is a difference between R2 and R3, but DreamSDK definitely has a more up to date compiler to download with 32MB support, I guess it's in R3?
What error do you see when trying to compile kos-ports with R3?
It's thinking...
User avatar
ThePerfectK
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Apr 27, 2006 10:15 am
Has thanked: 27 times
Been thanked: 35 times

Re: Beginner question about DreamSDK R2

Post by ThePerfectK »

To force C++11 you need to pass your compiler the -std=c++11 or -std=gnu++11 flag in your makefile rules. I don't use DreamSDK but I would imagine there is a makefile definition somewhere like CXXFLAGS += "blah" where you can add -std=c++11 or -std=gnu++11.
These users thanked the author ThePerfectK for the post:
Memorix101
Still Thinking!~~
User avatar
Memorix101
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 13
Joined: Thu Apr 21, 2016 7:03 am
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Beginner question about DreamSDK R2

Post by Memorix101 »

|darc| wrote: Mon May 08, 2023 5:46 pm I don't use DreamSDK so I'm not sure if this is a difference between R2 and R3, but DreamSDK definitely has a more up to date compiler to download with 32MB support, I guess it's in R3?
What error do you see when trying to compile kos-ports with R3?
This happens for every kos-port in R3:

Code: Select all

Installing the KallistiOS Port...
libGL is not currently installed.
Finished processing dependencies for libGL.
Fetching libGL from git://git.code.sf.net/p/cadcdev/libgl ...
Cloning into 'libGL-2.0.0'...
Copying SCM checkout of libGL ...
Copying KOS files...
make[1]: Entering directory `/usr/opt/toolchains/dc/kos-ports/libGL/build/libGL-2.0.0'
kos-cc  -c gl-rgb.c -o gl-rgb.o
kos-cc  -c gl-fog.c -o gl-fog.o
kos-as gl-sh4-light.S -o gl-sh4-light.o
kos-cc  -c gl-light.c -o gl-light.o
kos-cc  -c gl-clip.c -o gl-clip.o
kos-cc  -c gl-clip-arrays.c -o gl-clip-arrays.o
kos-cc  -c gl-arrays.c -o gl-arrays.o
kos-cc  -c gl-pvr.c -o gl-pvr.o
kos-cc  -c gl-matrix.c -o gl-matrix.o
kos-cc  -c gl-api.c -o gl-api.o
kos-cc  -c gl-texture.c -o gl-texture.o
kos-cc  -c glu-texture.c -o glu-texture.o
kos-cc  -c gl-framebuffer.c -o gl-framebuffer.o
kos-cc  -c gl-cap.c -o gl-cap.o
kos-cc  -c gl-error.c -o gl-error.o
rm -f libGL.a
/opt/toolchains/dc/sh-elf/bin/sh-elf-gcc-ar rcs libGL.a gl-rgb.o gl-fog.o gl-sh4-light.o gl-light.o gl-clip.o gl-clip-arrays.o gl-arrays.o gl-pvr.o gl-matrix.o gl-api.o gl-texture.o glu-texture.o gl-framebuffer.o gl-cap.o gl-error.o 
make[1]: *** [linklib] Error 5
make[1]: Leaving directory `/usr/opt/toolchains/dc/kos-ports/libGL/build/libGL-2.0.0'
make: *** [build-stamp] Error 2
Cleaning up build directories ...
Cleaning up dist files ...
*** Operation done with errors.
and because of this I can't compile anything that requires kos-ports :(

Code: Select all

$ make
rm -f gltest.elf romdisk.*
kos-c++   -c gltest.cpp -o gltest.o
gltest.cpp:9:10: fatal error: GL/gl.h: No such file or directory
    9 | #include <GL/gl.h>
      |          ^~~~~~~~~
compilation terminated.
make: *** [gltest.o] Error 1
Post Reply