I am trying to make a square pipe of a square curve.

Every time I make a square pipe I get a cross-section of a pipe as a rectangle.

Switching the curve shape to 2D got me the desired result but as soon as I applied the transformation operations I got the error “Rotation/Location can’t apply to a 2D curve”.

All I want is to get a square cross-section of a pipe using curves.

The answer is it already is square. The little square still has a square shape, but its placed a 45 degree at the corners of larger final shape. ( turn on wireframe to have a look)

So the walls look smaller because,if you look through a square that stands in front of you at a 45 degree angle it no longer looks square.

So you want the extruded wall to look square you have have to scale your small square along the x axis to be sqrt(2) = 1.4142. But thats just true for 45 degree angled extrusions.

Not sure what you mean with this, but if you work with 2D curves instead you can use simply use menu → object → convert → to mesh

you are right, it creates a rectangle because (as Debuk says) it is using the corner as the profile on the flat, but if you change the angle of the Rail of your sweep it pops into a square. Excuse the messy shape, it just to show what I’m saying.