Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in ExamRank 05 the first exercise always give compilation error #44

Open
YD-S opened this issue Aug 15, 2024 · 5 comments
Open

in ExamRank 05 the first exercise always give compilation error #44

YD-S opened this issue Aug 15, 2024 · 5 comments

Comments

@YD-S
Copy link

YD-S commented Aug 15, 2024

I tried using code from github but i cant seem to get to lvl 1 i'm stuck on lvl 0

@maitreverge
Copy link

Hi 👋
Could you put your code of both Warlock.hpp and Warlock.cpp bellow, so I can have a look !

Also, could you show me the compilation error you get, either in the /trace folder when you do grademe or when you compile it yourself ?

(if you compile yourself, could you also provide the main.cpp so I have the full scope of your bugs)

@YD-S
Copy link
Author

YD-S commented Aug 23, 2024

Hello. i dont have my verison anymore but i was testing with pasqualerossi's, i copied and pasted making sure everything is good.
The weird thing is that if i try to compile it myself it works, and when i do a grademe, in traces i have a compilation error.
I also had a main.cpp too from the subject and it didnt work

Ty

@maitreverge
Copy link

Problem might come from the constructor Warlock(std::string name, std::string title);

Which in theory should be more like Warlock(const std::string &name, const std::string &title);

This kind of implementation actually provides a more safe and stable way to pass by reference the string, but it does not actually changes anything to the code itself (and neither the logic behind it !)

You might ask why does it fails compiling ?

I was struggling today to understand why some functions seems to require a const attribute plus a reference while others do not.

I went straight within the .system/ folder, and it all comes down to the original implementation of the functions.

Let's take an example :

If you have setter wrote like

void setFoo( std::string input )
{
    this->_foo = input;
}

and GradeMe setter is more like :

void setFoo( const std::string &input )
{
    this->_foo = input;
}

It produces exactly the same result, but GradeMe's functions declaration must match yours, and yes it is very odd why it does produce an error compilation.

There is a pull request is just found today that is supposed to fix this problem, and I'm still trying to understand why does it fails compiling.

(giving the fact I am using the same compiler, flags and main.cpp )

Hope it helps !

@JCluzet
Copy link
Owner

JCluzet commented Aug 23, 2024

Hey @maitreverge 👋

Thanks a lot for your help with issues, I really appreciate it.

I haven’t been as involved in the project lately due to new commitments, so I’m grateful that you took the time to understand and respond thoroughly to the issues.

If you think this pull request will improve Grademe, I can merge it.

Jo

@maitreverge
Copy link

Hi @JCluzet

Appreciate your comment, no worries !

This project helped us a lot, it's the least I can do at my level !

I'll make sure this pull request is pertinent, and tag you or open a new PR soon !

Thanks again for GradeMe, it does helps a lot 😊

Florian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants