antoniovazquezaraujo / letraincpp Goto Github PK
View Code? Open in Web Editor NEWThe Letter Train Simulator
The Letter Train Simulator
Please fix it
``Train.cpp: In member function ‘void Train::move()’:
**Train.cpp:278:21: error: call of overloaded ‘abs(float&)’ is ambiguous**
if(abs(totalImpulse) >= totalMass){
^
In file included from /usr/include/c++/6/cstdlib:75:0,
from ../include/Basic.h:4,
from ../include/Train.h:3,
from Train.cpp:1:
/usr/include/stdlib.h:735:12: note: candidate: int abs(int)
extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
^~~
In file included from ../include/Basic.h:4:0,
from ../include/Train.h:3,
from Train.cpp:1:
/usr/include/c++/6/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
abs(long long __x) { return __builtin_llabs (__x); }
^~~
/usr/include/c++/6/cstdlib:172:3: note: candidate: long int std::abs(long int)
abs(long __i) { return __builtin_labs(__i); }
^~~
**Train.cpp:299:54: error: call of overloaded ‘abs(float&)’ is ambiguous**
consumed = crash(crashedVehicle, abs(totalImpulse),trainDir );
^
In file included from /usr/include/c++/6/cstdlib:75:0,
from ../include/Basic.h:4,
from ../include/Train.h:3,
from Train.cpp:1:
/usr/include/stdlib.h:735:12: note: candidate: int abs(int)
extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
^~~
In file included from ../include/Basic.h:4:0,
from ../include/Train.h:3,
from Train.cpp:1:
/usr/include/c++/6/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
abs(long long __x) { return __builtin_llabs (__x); }
^~~
/usr/include/c++/6/cstdlib:172:3: note: candidate: long int std::abs(long int)
abs(long __i) { return __builtin_labs(__i); }
^~~
**Train.cpp:301:33: error: call of overloaded ‘abs(float&)’ is ambiguous**
totalImpulse -=abs(consumed);
^
In file included from /usr/include/c++/6/cstdlib:75:0,
from ../include/Basic.h:4,
from ../include/Train.h:3,
from Train.cpp:1:
/usr/include/stdlib.h:735:12: note: candidate: int abs(int)
extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
^~~
In file included from ../include/Basic.h:4:0,
from ../include/Train.h:3,
from Train.cpp:1:
/usr/include/c++/6/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
abs(long long __x) { return __builtin_llabs (__x); }
^~~
/usr/include/c++/6/cstdlib:172:3: note: candidate: long int std::abs(long int)
abs(long __i) { return __builtin_labs(__i); }
^~~
**Train.cpp:303:33: error: call of overloaded ‘abs(float&)’ is ambiguous**
totalImpulse +=abs(consumed);
^
In file included from /usr/include/c++/6/cstdlib:75:0,
from ../include/Basic.h:4,
from ../include/Train.h:3,
from Train.cpp:1:
/usr/include/stdlib.h:735:12: note: candidate: int abs(int)
extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
^~~
In file included from ../include/Basic.h:4:0,
from ../include/Train.h:3,
from Train.cpp:1:
/usr/include/c++/6/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
abs(long long __x) { return __builtin_llabs (__x); }
^~~
/usr/include/c++/6/cstdlib:172:3: note: candidate: long int std::abs(long int)
abs(long __i) { return __builtin_labs(__i); }
^~~
**Train.cpp:326:18: error: ‘log’ is not a member of ‘std’**
setSpeed(1.0/std::log(numStoppedTurns)*150);
^~~
In file included from ../include/Train.h:10:0,
from Train.cpp:1:
../include/Selector.h: In instantiation of ‘void Selector<TContainer>::selectNext() [with TContainer = std::deque<RailVehicle*>]’:
Train.cpp:96:29: required from here
../include/Selector.h:24:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(selected < container->size()-1){
~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.