473,395 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

c2064 problem-- namespace issue??

Jon
Hello all,

Basic question. I have a vector/matrix class I'm building, and I seem
to be getting errors such as this:

..\otherFileUsingVectorMatrixClass.cpp(182) : error C2064: term does
not evaluate to a function

the specs are such:

vec3f.h:
Vec3f
{
...
public:
...

// calculate dot product
friend float dot( const Vec3f&, const Vec3f& );
};
-------------
vec3f.cpp:
float dot( const Vec3f &a, const Vec3f &b )
{ return a[0]*b[0] + ...; }
-------------
vecMatClass.h

#include "vec2f.h"
#include "vec3f.h"
#include "vec4f.h"
#include "mat3f.h"
#include "mat4f.h"
-------------
someOtherFileUsingVectorMatrixClass.cpp:

#include "vecMatClass.h"

void Class::foo()
{
Vec3f a( 2,3,4 ), b( 5,3,2 );
const float dotP = dot( a, b );
}


Am I missing something? I'm using MSVC++ 6 and its compiler. I tried
to look up namespaces and such, and saw really old posts saying the
compiler had trouble recognizing functions in namespaces, or something
along those lines.

For a large program, is it ok to "pollute" the global namespace with
such functions as dot() (and there are 3 versions of it, for Vec2f,
Vec3f, and Vec4f)?
Thank you,
Jon
Jul 19 '05 #1
1 1853
> Hello all,

Basic question. I have a vector/matrix class I'm building, and I seem
to be getting errors such as this:

.\otherFileUsingVectorMatrixClass.cpp(182) : error C2064: term does
not evaluate to a function
What is this line?
the specs are such:

vec3f.h:
Vec3f
What is that?
{
...
public:
...

// calculate dot product
friend float dot( const Vec3f&, const Vec3f& );
}; vec3f.cpp:
float dot( const Vec3f &a, const Vec3f &b )
{ return a[0]*b[0] + ...; }

vecMatClass.h

#include "vec2f.h"
#include "vec3f.h"
#include "vec4f.h"
#include "mat3f.h"
#include "mat4f.h"
What are these?
-------------
someOtherFileUsingVectorMatrixClass.cpp:

#include "vecMatClass.h"

void Class::foo()
What is that ?
{
Vec3f a( 2,3,4 ), b( 5,3,2 );
const float dotP = dot( a, b );
}


Am I missing something?
Yes, you should post compilable code, not just try to rewrite it.
For a large program, is it ok to "pollute" the global namespace with
such functions as dot() (and there are 3 versions of it, for Vec2f,
Vec3f, and Vec4f)?


afaik, there was no namespaces in your program.
Jonathan
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jason Heyes | last post by:
There are 3 files in the project. I compiled it with VC++ 6.0 and got an unresolved external symbol error. What am I doing wrong? // Foo.cpp #include "Foo.h" using namespace foo; void f() {...
8
by: Jason Heyes | last post by:
I wrote: namespace { void f(); } void f() { std::cout << "hello world" << std::endl; } When I compile, I receive this error: unresolved external symbol "bool __cdecl `anonymous...
4
by: Richard L Rosenheim | last post by:
Here's a sample XML file (created by saving a dataset): <?xml version "1.0" standalone="yes"?> <dsData xmlns="http://tempuri.org/DataSchema.xsd"> <Configuration> </Configuration> <Data>...
1
by: AliasMrJones | last post by:
We're trying to get IBM Websphere Business Integration to talk to a .net webservice. We're using document/literal. WBI is sending a soap request that looks like this: <?xml version="1.0"...
6
by: Robert Warnestam | last post by:
I've two class libraries, where one is referencing the other. The first library looks like this; (assembly name and root name space is set to Codab.Parser) namespace Codab.Parser { public class...
0
by: Charles Leonard | last post by:
I need opinions regarding Web Service Namespace usage and/or suggestions regarding how to handle deployment. Our web service application will exist in two different domains and is likely to...
2
by: Pathogenix | last post by:
Greetings, I'm trying to fix a web service client which has been implemented in a dailywtf worthy manner. I've decided to rip all the old code out and start again from the proxy generated by...
0
by: mazdotnet | last post by:
Hi everyone, I have the following very odd problem (only happens on Windows 2003 Server and not XP) In my class I have (no namespace) class test { ... public static void method...
4
by: pc.candy | last post by:
Hi there I'm having some difficulty with transforming xml data with more than one namespace defined in the xml. I'm able to bring back some values of the xml but not others in another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.