My program passes a parameter that looks like this:

std::vector<myDataType> vec;
      void function(&vec);

Then the function accepts the argument like this:

void function(std::vector<myDataType>* myVec){
           ...does something
      }

Yet somehow I am getting the following error:

error C2664: 'CMyClass::WriteVectorSTL_CSV' : cannot convert parameter 1 from 'std::vector<_Ty> *__w64 ' to 'std::vector<_Ty> *'

This is on a 32-bit machine compiling with VS2005. Any ideas what is going wrong/how to fix it?

Recommended Answers

All 4 Replies

Thanks, yes. I found that too. It's just so strange. My data type just holds three values. They are: an int, a double and a long.

You don't happen to have any relation to this really cool website?

www.InTrade.com

I love prediction markets and really miss the TradeSports days.

Okay, so I changed the project properties to not detect 64-bit portability issues. Turns out it had nothing to do with __w64 because I was still getting error C2664: 'CMyClass::WriteVectorSTL_CSV' : cannot convert parameter 1 from 'std::vector<_Ty> *' to 'std::vector<_Ty> *'

This message really drove me crazy! It looked to me like it was trying to convert something that didn't need converting.

Well, here is what was wrong. I had written an overloaded function, but not declared one of the overloads in the header file. So because it used the _Ty instead of actually telling me the name of the datatype that it couldn't convert my compiler caused me lots of confusion. But, problem solved. It just took a lot longer than I had hoped for.

Sweet deal. At least you managed to figure it out!

Oh and no I have nothing to do with that website ;p

commented: thanks +1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.