namespace mayhem

Started by
4 comments, last by Nitage 17 years, 11 months ago
right in my engine i have a class call Mesh, and im making a plugin for 3d max, which also has a class called Mesh, now i dont want to namespace up my code, so what i did was modified the 3d max header files to namespace up thier max class. Problem is, with this is doesnt seem to want to link when i go to use any methods from the 3d max mesh class :| saying the functions are unresolved. does any one know a work around for such a problem?
Advertisement
This is the reason that namespaces were created. USE THEM...

theTroll
Quote:Original post by supagu
right in my engine i have a class call Mesh, and im making a plugin for 3d max, which also has a class called Mesh, now i dont want to namespace up my code, so what i did was modified the 3d max header files to namespace up thier max class. Problem is, with this is doesnt seem to want to link when i go to use any methods from the 3d max mesh class :| saying the functions are unresolved.

does any one know a work around for such a problem?


Well... if you're into changing other people's code...

...why not put a "using" directive in their source files, too?

"using 3dmax"... or whatever you called it...

Surely within 3DMax they reference "Mesh" by the name "Mesh" and not "yournamespacename::Mesh"


Chad
my_life:          nop          jmp my_life
[ Keep track of your TDD cycle using "The Death Star" ] [ Verge Video Editor Support Forums ] [ Principles of Verg-o-nomics ] [ "t00t-orials" ]
i only have access to thier headers. i've changed all thier code from Mesh to Max::Mesh

i've wrapped thier mesh in the Max namespace, but this screws up the linker as it seems the namespace is used during linking so linker thinks its just Mesh, but i've hcnaged it to Max::Mesh
Quote:Original post by supagu
i only have access to thier headers. i've changed all thier code from Mesh to Max::Mesh

i've wrapped thier mesh in the Max namespace, but this screws up the linker as it seems the namespace is used during linking so linker thinks its just Mesh, but i've hcnaged it to Max::Mesh


Wrap your Mesh in the supagu (or whatever) namespace and access theirs as ::Mesh.
To put the 3DSMax Mesh class in a namespace, you'd have to put both the header and the source in that namespace. You don't have access to the source, so you can't do it.

This topic is closed to new replies.

Advertisement