Help For A C++ Noob

All the inane chatter goes in here. If you're curious about whether we will support a game, post HERE not in General Discussion :)

Moderator: ScummVM Team

Post Reply
Manannan
Posts: 8
Joined: Wed Sep 25, 2019 11:17 am

Help For A C++ Noob

Post by Manannan »

My apologies if this is totally the wrong forum, but I couldn't find a definite home for questions like these.

I am new to C++, although I am an experienced C# developer.

I am trying to challenge myself by writing a .NET CLI wrapper around the Scumm VM.

As you can see I have linked my CLI project called CLRScrumm.

My strategy is to copy sdl.h, sdl-events and sdl-graphics, rename them as clr-xxx and gut them. Note that the OSystem_CLR is based on sdl.h

My end goal is for C# to pass in a callback function which can be called from clr-graphics.copyRectToScreen.

I managed to those class skeletons compile, but not link. I guess I must be missing some function implementations somewhere, but I can't for the life of me
see where. The errors from the linker are very cryptic.

I would appreciate if someone would:
1. Give me a general strategy for fixing these errors
2. Point me in the right direction for fixing them.

I have my project, which can be found here: https://www.dropbox.com/s/srt1y84yteje4 ... m.zip?dl=0

I wanted to show you guys the whole solution, but it zipped to 600mb.

The error trace is here: https://www.dropbox.com/s/7tg29pyn7d2d6 ... e.txt?dl=0

Thank you
User avatar
sev
ScummVM Lead
Posts: 2306
Joined: Wed Sep 21, 2005 1:06 pm
Contact:

Re: Help For A C++ Noob

Post by sev »

Could the following be of any help: https://github.com/scemino/nscumm


Eugene
Manannan
Posts: 8
Joined: Wed Sep 25, 2019 11:17 am

Re: Help For A C++ Noob

Post by Manannan »

Thank you for that pointer (notice my C++ joke :)), and I might consider using that if I became totally stuck, but I was really hoping for a C++ wiz to give me some debugging help.

If this is not the forum for this, please let me know and might look elsewhere.
Reckless
Posts: 221
Joined: Tue Nov 01, 2005 1:12 am

Re: Help For A C++ Noob

Post by Reckless »

Just because you (although in this case, clearly not you specifically) could, it doesn't mean you should... :)

C++/CLI is a terrible environment with all the worst of managed and unmanaged code provided in a single pot of hell being useful only to interop with "legacy" unmanaged code. That (legacy) is not something I'd label ScummVM as - it's an active project with a team that would benefit from direct support rather than people wasting time creating wrappers.

As for the errors... maybe your definitions are incorrect for the types used or you've not included the library that includes said types to the linker. It's been a long time since I touched MC++ or C++/CLI and as you can probably tell from above I think it's a waste of time.
Manannan
Posts: 8
Joined: Wed Sep 25, 2019 11:17 am

Re: Help For A C++ Noob

Post by Manannan »

Thanks for putting effort into your reply Reckless. Sorry for the late reply, as life got in the way.

I don't expect to contribute this work to the Scumm VM repository; I am doing it to teach myself C++. In the future when I am more competent I might consider contributing something else.

I hope I might be able to lean on your expertise in the future.
Post Reply