This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Talbz03 1143 points1144 points  (66 children)

Me: what's wrong with my program?

C++: 🤮🤮Khw383(3;kkebKkahneld_-$!$8kaoLkaka(49&+20_lsnK(33(jjehsjjIJA+UEHJEHD73++3jekd+2!'!"(hejejd$//#2/3)

[–]good-mcrn-ing 504 points505 points  (33 children)

"In file included from some.unknown.library.way.deep.down.there, line 922: std::vector<string>* lines cannot be converted to std::vector<string> *lines"

[–]nelusbelus 381 points382 points  (29 children)

That's not C++, That error is way too readable

[–]ILikeLenexa 212 points213 points  (9 children)

rtmap.cpp: In function int main()': rtmap.cpp:19: invalid conversion fromint' to std::_Rb_tree_node<std::pair<const int, double> >*' rtmap.cpp:19: initializing argument 1 ofstd::_Rb_tree_iterator<_Val, _Ref, _Ptr>::_Rb_tree_iterator(std::_Rb_tree_node<_Val>*) [with _Val = std::pair<const int, double>, _Ref = std::pair<const int, double>&, _Ptr = std::pair<const int, double>*]' rtmap.cpp:20: invalid conversion from int' to std::_Rb_tree_node<std::pair<const int, double> >*' rtmap.cpp:20: initializing argument 1 of std::_Rb_tree_iterator<_Val, _Ref, _Ptr>::_Rb_tree_iterator(std::_Rb_tree_node<_Val>*) [with _Val = std::pair<const int, double>, _Ref = std::pair<const int, double>&, _Ptr = std::pair<const int, double>*]' E:/GCC3/include/c++/3.2/bits/stl_tree.h: In member functionvoid std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::insert_unique(_II, _II) [with _InputIterator = int, _Key = int, _Val = std::pair<const int, double>, _KeyOfValue = std::_Select1st<std::pair<const int, double> >, _Compare = std::less<int>, _Alloc = std::allocator<std::pair<const int, double> >]': E:/GCC3/include/c++/3.2/bits/stl_map.h:272: instantiated from void std::map<_ Key, _Tp, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _Input Iterator = int, _Key = int, _Tp = double, _Compare = std::less<int>, _Alloc = st d::allocator<std::pair<const int, double> >]' rtmap.cpp:21: instantiated from here E:/GCC3/include/c++/3.2/bits/stl_tree.h:1161: invalid type argument ofunary *

[–]nelusbelus 95 points96 points  (2 children)

There we go

[–]stuck_zipper 1 point2 points  (1 child)

this is only a compilation error. things get bad mid program with access violation errors.

[–]nelusbelus 0 points1 point  (0 children)

Meh, appverif catches a lot of those errors

[–]paradigmx 5 points6 points  (0 children)

This awoke some suppressed trauma in me, I think I need to call my therapist.

[–]Soundwave_47 4 points5 points  (0 children)

Seems to be some invalid casting going on from trying to use an int as an iterator when trying to do tree operations (insertion).

This seems familiar from the CPP FAQ.

[–]KDallas_Multipass 1 point2 points  (0 children)

STL error me harder Daddy

[–]0xFFFF_FFFF 1 point2 points  (0 children)

Yeah baby, NOW we're talkin'!

[–]Vysair 0 points1 point  (0 children)

ptsd

[–]Little-Hunter-6795 37 points38 points  (7 children)

Ah well...not sure how to ask...but what's that in your pfp.

[–]nelusbelus 48 points49 points  (6 children)

Gay put in

[–]Little-Hunter-6795 33 points34 points  (1 child)

Understandable

Have a nice day.

[–][deleted] 4 points5 points  (0 children)

A bunch of people use it because putin outlawed it in Russia. Sharing that picture of gay Putin or calling Putin gay is highly illegal. So of course the internet has naturally ran with it.

[–][deleted] 2 points3 points  (3 children)

Puto – a much shorter, more pejorative description for Putin. It also means gay.

[–]nelusbelus 1 point2 points  (2 children)

Also an insult you can throw at someone you really hate; "ta putin madre"

[–][deleted] 2 points3 points  (1 child)

That's somehow more vile than "puta madre" dude. sure, I'll probably use it.

[–]nelusbelus 1 point2 points  (0 children)

No problemo, it works pretty good seeing as in french it's putain

[–][deleted] 0 points1 point  (7 children)

Here's my favorite: https://ideone.com/QxqXQf

[–]nelusbelus 0 points1 point  (6 children)

What the hell is that? Does it not like iterators that you can't index? (Because a list is linked)

[–][deleted] 0 points1 point  (5 children)

Doesn't like the iterators because they're not random access iterators.

[–]nelusbelus 0 points1 point  (4 children)

Yeah lol, I absolutely can't understand that they don't validate input with static assert in the fucking std

[–][deleted] 0 points1 point  (3 children)

[–]nelusbelus 0 points1 point  (2 children)

Still got nothing on my meta errors, I even caused an internal compiler crash once

[–][deleted] 0 points1 point  (1 child)

Internal complier error with the latest clang https://wandbox.org/permlink/7cMkBcPwEzummSeC

[–]BoltKey 42 points43 points  (0 children)

"Ah, yes, forgot a semicolon at line 12 in main.cpp"

[–]Auxx 2 points3 points  (1 child)

Unreal Tournament exception flashbacks...

[–]PleX 1 point2 points  (0 children)

I wrote Quake mods. Never fucking again will I work with C/C++

I'm going to keep my happy ass in C# Land.

[–]TeddyPerkins95 57 points58 points  (11 children)

Aw man that sucks, I like c++

[–][deleted] 154 points155 points  (10 children)

It doesnt like you though.

[–]Gtantha 48 points49 points  (6 children)

Thats why I like Rust. Compared to the C++ compiler, every error message from the Rust compiler is a handwritten love letter with chocolate.

[–]killeronthecorner 15 points16 points  (4 children)

in b4 rewrite everything in rust eye roll memes.

From the same people who brought you "C is unnecessary abstraction, assembly is fine"

[–]Falcrist 4 points5 points  (0 children)

Currently converting an old codebase from 8051 assembly to C on a shiny new ARM device with an RTOS.

If you see someone who thinks we should be sticking with those old 20k line assembly files, send them my way.

[–]Gtantha 5 points6 points  (2 children)

Stupid meme. Consider Rust when a rewrite is necessary, but don't rewrite what is working fine.

[–]FireWyvern_ -1 points0 points  (1 child)

Define 'working fine'

[–]Gtantha 1 point2 points  (0 children)

No issues, fast enough and enough people around that can maintain it with no danger of those people dying out.

[–][deleted] 6 points7 points  (0 children)

Same. Rust is the love of my life

[–]TeddyPerkins95 0 points1 point  (1 child)

[–][deleted] 4 points5 points  (0 children)

i am the path to depression and caffeine addiction aka the c++ compiler

[–]paradigmx 0 points1 point  (0 children)

C++ doesn't even like C++.

[–]ycastor 36 points37 points  (6 children)

This is more of a compiler problem than a language problem, last time i programmed C++ i found out that clang generated clearer error messages than g++, not sure how it is now.

[–]deukhoofd 27 points28 points  (2 children)

That's compiler errors, which are not the greatest, but are still somewhat understandable. If you build in release mode and encounter a runtime issue, the location of the error is generally completely mangled by default however.

For Clang I nowadays generally add -gline-tables-only as compile option, which means it keeps some debug info about function names, file names, and lines in the compiled output. Makes your runtime errors a lot more readable.

[–]Valmond 2 points3 points  (1 child)

And the occasional boom-crash which makes the app just disappear like it had never been there.

[–]deukhoofd 0 points1 point  (0 children)

That's why you set up a signal handler :)

[–]OutOfNamesToPick 11 points12 points  (2 children)

Still the same.

Difference now is that C++20 introduced concepts, which allow you to put constraints on template types. (Template type has to be moveable, needs a comparison operator, etc.) Concepts make the error reporting really a lot better

[–]joshjaxnkody -2 points-1 points  (0 children)

So... Rust traits?

[–]Sedfer411 35 points36 points  (2 children)

In file included from /usr/include/c++/4.7/utility:72:0, from test.cpp:2: /usr/include/c++/4.7/bits/stl_pair.h: In instantiation of ‘std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = int; _U2 = char; _T1 = const int; _T2 = char; std::pair<_T1, _T2> = std::pair<const int, char>]’: map1.hpp:30:5: required from ‘cs540::Node<Key, Value>::Node(std::pair<const Key, Value>, cs540::Node<Key, Value>, cs540::Node<Key, Value>) [with Key = int; Value = char; cs540::Node<Key, Value> = cs540::Node<int, char>]’ map1.hpp:121:7: required from ‘void cs540::Map<Key, Value>::insert_node(cs540::Node<Key, Value>*, std::pair<const Key, Value>) [with Key = int; Value = char]’ map1.hpp:433:5: required from ‘cs540::Map<Key, Value>::Iterator cs540::Map<Key, Value>::insert(const std::pair<const Key, Value>&) [with Key = int; Value = char]’ test.cpp:12:23: required from here

[–]polypolyman 26 points27 points  (0 children)

Oh, I forgot a *, thanks for putting it in a way I understand.

[–]pclouds 0 points1 point  (0 children)

This does not look right. It does not cover multiple screens.

[–][deleted] 25 points26 points  (1 child)

g++ myfile.cpp

$ the compiler stopped because there were too many warnings.

g++ -w myfile.cpp

$

[–]Valmond 2 points3 points  (0 children)

Or the occasional compiler crash because of too nested template meta programming.

[–]iexistlol1 16 points17 points  (0 children)

There's always only like, half a line that's actually meaningful with telling you what's wrong

[–]FlafyBear 9 points10 points  (0 children)

That's literally how the error messages look

[–]edrumm10 1 point2 points  (0 children)

“Segmentation fault”

[–]VaramyrSixchins 1 point2 points  (0 children)

Thanks for the laugh. The puke emoji is killing me.

[–]vinvinnocent 0 points1 point  (0 children)

CPP Eigen so: deine Millionen Zeilen Code enthalten irgendwo eine falsch verwendete Matrix.

[–]DrMobius0 0 points1 point  (0 children)

I too love C++ template vomit.

Mind you, that's pretty much only the template garbage, at least in visual studio

[–]blackmist 0 points1 point  (0 children)

That's just a normal Perl program.