I Would Like The Pyramids Alot More If They Were Tetrahedrons

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

BoomerD

No Lifer
Feb 26, 2006
65,997
14,398
146
I doubt the OP can count high enough to verify a tetrahedron.
 
Last edited:

Chaotic42

Lifer
Jun 15, 2001
34,599
1,758
126
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
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.
 
  • Like
Reactions: Ken g6

lxskllr

No Lifer
Nov 30, 2004
59,551
10,056
126
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.
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.
 

IronWing

No Lifer
Jul 20, 2001
72,404
32,985
136
You want tetrahedrons, lots of tetrahedrons? Get you a handful of sand. Silica is tetrahedrons all the way down.
 
  • Wow
Reactions: brianmanahan

brianmanahan

Lifer
Sep 2, 2006
24,598
5,996
136
i'd be cool with a huge tetrahedron stone structure

someone would finally be doing something different for once
 

lxskllr

No Lifer
Nov 30, 2004
59,551
10,056
126
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...

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
 

Chaotic42

Lifer
Jun 15, 2001
34,599
1,758
126
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
1752558564978.png
 

lxskllr

No Lifer
Nov 30, 2004
59,551
10,056
126
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)
 
Last edited:

Chaotic42

Lifer
Jun 15, 2001
34,599
1,758
126
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)
Today I learned GCC stands for GNU Compiler Collection.

Anyway, g++ should be the C++ compiler for gcc, but you can pass -lstdc++ to gcc and it should work.
 
  • Like
Reactions: lxskllr

Red Squirrel

No Lifer
May 24, 2003
70,239
13,614
126
www.anyf.ca
I always use g++ myself. It will work even for plain C I believe. One thing I need to learn one day is the whole automake system... I always just make a bash script that runs g++ with all appropriate parameters but it's not really the proper way.