It's a C++ file, not C.Code:tuxj@debian:~/temp/ConvertedMusic$ cc triangle.c triangle triangle.c:3:10: fatal error: iostream: No such file or directory 3 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
I don't program. Fix it
Internet said that was the compiler and extension to use. I also tried gcc with the same results. Me knowing nothing, I'm guessing <iostream> and <array> are subroutines expected in the same build directory, but weren't there.It's a C++ file, not C.
Speaking of ChatGPT being horrible, the GF wanted to do an extraction of salicylic acid (aspirin precursor) from willow bark because she's a witchy nerd. We decided to use ChatGPT to see how good it was at chemistry. It added an unnecessary step and then left one out. It also skipped something in its unnecessary step which would have yielded toxic gasses and a potentially explosive mixture (albeit on a small scale).
Careful what you ask them to do.
Ok, maybe I misread or something. This is what I get with a .cc extension, and using gcc...It's a C++ file, not C.
Speaking of ChatGPT being horrible, the GF wanted to do an extraction of salicylic acid (aspirin precursor) from willow bark because she's a witchy nerd. We decided to use ChatGPT to see how good it was at chemistry. It added an unnecessary step and then left one out. It also skipped something in its unnecessary step which would have yielded toxic gasses and a potentially explosive mixture (albeit on a small scale).
Careful what you ask them to do.
tuxj@debian:~/temp/ConvertedMusic$ gcc ./t.cc -o t
/usr/bin/ld: /tmp/ccTEQ9NK.o: warning: relocation against `_ZSt4cout' in read-only section `.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]'
/usr/bin/ld: /tmp/ccTEQ9NK.o: in function `__static_initialization_and_destruction_0(int, int)':
t.cc:(.text+0x4f): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: t.cc:(.text+0x6a): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /tmp/ccTEQ9NK.o: in function `Tetrahedron::printVertices()':
t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x26): undefined reference to `std::cout'
/usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x2e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x3e): undefined reference to `std::ostream::operator<<(int)'
/usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x53): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x79): undefined reference to `std::ostream::operator<<(float)'
/usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x8e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0xb5): undefined reference to `std::ostream::operator<<(float)'
/usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0xca): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0xf1): undefined reference to `std::ostream::operator<<(float)'
/usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x106): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
Ok, maybe I misread or something. This is what I get with a .cc extension, and using gcc...
Code:tuxj@debian:~/temp/ConvertedMusic$ gcc ./t.cc -o t /usr/bin/ld: /tmp/ccTEQ9NK.o: warning: relocation against `_ZSt4cout' in read-only section `.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]' /usr/bin/ld: /tmp/ccTEQ9NK.o: in function `__static_initialization_and_destruction_0(int, int)': t.cc:(.text+0x4f): undefined reference to `std::ios_base::Init::Init()' /usr/bin/ld: t.cc:(.text+0x6a): undefined reference to `std::ios_base::Init::~Init()' /usr/bin/ld: /tmp/ccTEQ9NK.o: in function `Tetrahedron::printVertices()': t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x26): undefined reference to `std::cout' /usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x2e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x3e): undefined reference to `std::ostream::operator<<(int)' /usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x53): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x79): undefined reference to `std::ostream::operator<<(float)' /usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x8e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0xb5): undefined reference to `std::ostream::operator<<(float)' /usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0xca): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0xf1): undefined reference to `std::ostream::operator<<(float)' /usr/bin/ld: t.cc:(.text._ZN11Tetrahedron13printVerticesEv[_ZN11Tetrahedron13printVerticesEv]+0x106): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /usr/bin/ld: warning: creating DT_TEXTREL in a PIE collect2: error: ld returned 1 exit status
tuxj@debian:~/temp/ConvertedMusic$ g++ ./t.cc -o t
tuxj@debian:~/temp/ConvertedMusic$ t
bash: t: command not found
tuxj@debian:~/temp/ConvertedMusic$ ./t
Vertex 0: (1, 1, 1)
Vertex 1: (-1, -1, 1)
Vertex 2: (-1, 1, -1)
Vertex 3: (1, -1, -1)
Today I learned GCC stands for GNU Compiler Collection.gcc compiles c++. I've done it before. Someone on another forum was trying to teach me c++, but I got bored and quit. I did do a couple 'hello world+' programs though.
edit:
Ok, g++ worked. Near as I can remember, gcc should've worked also. Lame ass program though.
Code:tuxj@debian:~/temp/ConvertedMusic$ g++ ./t.cc -o t tuxj@debian:~/temp/ConvertedMusic$ t bash: t: command not found tuxj@debian:~/temp/ConvertedMusic$ ./t Vertex 0: (1, 1, 1) Vertex 1: (-1, -1, 1) Vertex 2: (-1, 1, -1) Vertex 3: (1, -1, -1)
Where is he going to get triangular Nvidia paper?You should make a papier-mache tetrahedron.
Print it at the library, duh. They've probably got paper cutters there too.Where is he going to get triangular Nvidia paper?
Hey, we've mostly stayed on the topic of tetrahedrons and tetrahedron accessories!I do enjoy these random streams of consciousness.