Page 1 of 1

Fixed: Cannot build software

Posted: Mon Sep 20, 2021 5:45 am
by Wortel
Hi,

I am new to the solution, I am having an issue when using make

c++ -I. -g -O2 -Wall -Wextra -pedantic -Werror -std=c++11 -D_GNU_SOURCE -c -o WebServer/HtmlTagAccessory.o WebServer/HtmlTagAccessory.cpp
In file included from WebServer/HtmlTagAccessory.cpp:24:
./WebServer/HtmlTagAccessory.h:47:16: error: 'IsAttributeSet' overrides a member function but is not marked
'override' [-Werror,-Winconsistent-missing-override]
inline bool IsAttributeSet(const std::string& name)
^
./WebServer/HtmlTag.h:54:24: note: overridden virtual function is here
inline virtual bool IsAttributeSet(const std::string& name)

Can you help me ?

regards
Wortel

Re: Cannot build software

Posted: Mon Sep 20, 2021 6:19 am
by teddy
Hi Wortel

Yes, you are right, there were some minor issues in the code. But they should be fixed now in the Github repository.

Please update your repository and try again.

And another question: What platform and what compiler do you use? (on command line: c++ --version)

Regards
Teddy

Re: Cannot build software

Posted: Tue Sep 21, 2021 5:15 am
by Wortel
Hi Teddy

Thanks for the reply, I have updated the files (git pull) however a new eurror appeared

c++ -I. -g -O2 -Wall -Wextra -pedantic -Werror -std=c++11 -D_GNU_SOURCE -c -o WebServer/Response.o WebServer/Response.cpp
WebServer/Response.cpp:47:25: error: use of overloaded operator '<<' is ambiguous (with operand types 'basic_ostream<char,
std::__1::char_traits<char> >' and 'const WebServer::Response::ResponseCode')
stream << "HTTP/1.1 " << response.responseCode << " " << Response::responseTexts.at(response.responseCode) << "\r\n";
~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ostream:209:20: note: candidate function
basic_ostream& operator<<(unsigned short __n);

I am using a Mac - Cataline 10.15.3 , and Xtools 11.3.1

Regards
Wortel

Re: Cannot build software

Posted: Tue Sep 21, 2021 5:43 am
by Wortel
Teddy
Xcode 11.3.1, I believe it uses c++11
Regards
Wortel

Re: Cannot build software

Posted: Wed Sep 22, 2021 7:07 pm
by teddy
Hello Wortel

Xcode 11.3.1 uses clang 11.0.0 as C++ compiler.

Xcode version 11.3.1 and up to 12.5.1 are all marked as discontinued. Therefore my question: Do you have the possibility to update Xcode?

Tomorrow I will check, if I find a machine with an old clang compilier installed and try to reproduce your errors.

Regards
Teddy

Re: Cannot build software

Posted: Sat Sep 25, 2021 9:23 am
by _DB_
Hallo Wortel,

sorry for my late answer. I'm only a Mac-user, not a Mac developer. But it may be helpful to see, that compiling railcontrol is NOT complicate.

What did I done with my Mac which was NOT a development system?

1 - installing the tools for compiling in terminal: sudo xcode-select --install
2 - fetching sources: git clone https://github.com/teddych/railcontrol.git
3 - go to railcontrol-directory: cd railcontrol
4 - compiling: make
5 - starting railcontrol: ./railcontrol

This is exactly what I did because Teddy has documentated this precisely at his site: https://www.railcontrol.org/index.php/en/sourcecode

What I didn't have done: updating the project with 'git pull' and 'make'.
If the compiling went wrong I've started every time the process written above to avoid mistakes:
deleting directory 'railcontrol', then continuing with step 2 - 3 - 4 - 5

I'm quite sure, that you have done it in this way, but for me it is important to mention it (-> common basics)

As I really want to help you, it would be the best to install Catalina on my Mac. But it is not possible at once - it need some time for me - let me say: next week.

My Mac is running under MacOS Big Sur, but one year before I've used MacOS Catalina as you do today and it has worked fine.

Feel free to contact me at any time, I'm sure that I can learn a lot on solving this problem.
With Teddy in background we have a very good support!

With best regards from Herne, Germany - Detlef

Re: Cannot build software

Posted: Sun Sep 26, 2021 7:34 pm
by teddy
Hello Wortel

I found a machine with an old clang compiler installed. And I have resolved the "problems". All of them were bugs in clang itself that are fixed in recent versions of clang.

But now it should also compile well on older MacOS and older Xcode.

Regards
Teddy

Re: Cannot build software

Posted: Mon Sep 27, 2021 7:11 am
by _DB_
Hi Teddy,

thank you very much - this saves a lot of time for me.

Best regards from Herne - Detlef