#Using SDL3 with Code::Blocks or coming up with alternatives?

29 messages · Page 1 of 1 (latest)

civic jungle
#

Question: I'm trying to use Code::Blocks to build a game engine and when running the game in the editor if I include the following lines I get an error while not including them works but everything I can find says I need these lines. Is this something weird about C::B and if so is there a better development tool I should be using? (Besides VS or VSC because they don't want to work on my system)

    if (SDL_Init(SDL_INIT_VIDEO) != 0) {
        std::cerr << "SDL_Init Error: " << SDL_GetError() << std::endl;
        return 1;
    }

It prints SDL_Init Error: but SDL_GetError() seems to be returning an empty string.

wintry citrusBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

pallid mauve
#

yeah, for c++ in general not too many people are still using codeblocks for bigger projects. i'd try CLion if you don't want to figure outt why the other two aren't working for you. if you're a student it's free.

#

otherwise it's something like 100ish/year maybe with discounts that get better if you resubscribe for updates

civic jungle
#

Unfortunately not a student but am currently stuck with the finances of one. Working on fixing the issue but it'll be a while. I had been using IJI but switched to C::B because I'd been struggling to get mingw working with my project in it.

pallid mauve
#

why not try clang or msvc if mingw is giving you trouble... it will sometimes act up when the toher two main compilers work fine

#

or maybe try msys2 builds of mingw/clang if you're using the standalone install of mingw now. i think the build of gcc are newer in msys2 vs the other standalone releases

#

what goes wrong if you try just installing visual studio 2022 community edition? it's free for personal use and is an IDE that would typically cost a business a ton of money per license for roughly the same feature set as the personal version

civic jungle
#

I know very little of the compilation and honestly don't know why I'm using mingw aside from people on reddit saying it was one of the best options for standalone development.

pallid mauve
#

on windows it's the easiest and probably most powerful out of the box

#

you can use any compiler you want. msvc works fine, so does gcc and clang. they all have their pros/cons

civic jungle
#

I'll actually try getting it again. Before my factory reset it would always say not responding and close itself when I tried launching it

pallid mauve
#

just follow those instructions and you should be up and running pretty quickly. vs2022 doesn't require any manual setup, everything you need is included and preconfigured, which sounds like is what you're looking for

#

the microsoft docs also explain a lot more of the features in good detail if necessary

civic jungle
#

I'm mainly focused on wanting to use SDL3 and lualib, the other stuff is just what I grabbed to get it to work, installing is going better than it did before resetting my PC so hopefully it means it'll work this time.

lean sentinel
#

that's sdl2 code

#

in sdl3 SDL_Init return a boolean i think

#

so your if is basically if (SDL_init successully (!= false)) hence there's no error in SDL_GetError()

#

(bool) Returns true on success or false on failure; call SDL_GetError() for more information.

pallid mauve
#

that might just be a recent change, i just checked one of my sdl3 projects. the submodule is pretty out of date, but it's defined as this in there:

#

looks like the submodule is almost a year out of date so that would explain it

civic jungle
#

I feel a little foolish for checking reddit instead of the wiki lmao. I made it a lot harder than I needed to.

#

I now have the wiki in my workspace environment though so thank you for that.

#

!solved

wintry citrusBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity

pallid mauve