473,383 Members | 1,958 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,383 software developers and data experts.

compiling with VC++

I am trying to build an executable out of source code that supposedly
compiles and is complete but i keep getting errors like the following:

error C2664: cannot convert parameter 2 from
'std::vector<_Ty>::iterator' to 'void *'
with
[
_Ty=pseudoplot
]
Looks to me like something is wrong with the code, but there shouldn't
be. Does anyone know if there is a way to fix this in the compiler
setting/environment.

Thanks,
T
Jul 22 '05 #1
2 1151
T-Money wrote:
I am trying to build an executable out of source code that supposedly
compiles and is complete but i keep getting errors like the following:

error C2664: cannot convert parameter 2 from
'std::vector<_Ty>::iterator' to 'void *'
with
[
_Ty=pseudoplot
]
Looks to me like something is wrong with the code, but there shouldn't
be. Does anyone know if there is a way to fix this in the compiler
setting/environment.


Not in this newsgroup. Try microsoft.public.vc.ide_general or any
other suitable microsoft.public.vc.* newsgroup.

If it's actually a problem with the code, we could try helping you,
but you need to follow the recommendations in the FAQ 5.8.

Victor
Jul 22 '05 #2
On Tue, 17 Aug 2004 12:01:22 -0700, T-Money wrote:
I am trying to build an executable out of source code that supposedly
compiles and is complete but i keep getting errors like the following:

error C2664: cannot convert parameter 2 from
'std::vector<_Ty>::iterator' to 'void *'
with
[
_Ty=pseudoplot
]
Looks to me like something is wrong with the code, but there shouldn't
be.
That code must be written under the assumption that vector::iterator is a
typedef of T* (or convertible to T*). The implementation you are using
probably defines vector::iterator as a class.

For example this works with g++ 2.95:

#include <vector>
#include <iostream>

using namespace std;

void foo(int * i)
{
cout << *i << '\n';
}

int main()
{
vector<int> v;
v.push_back(42);
foo(v.begin());
}
Does anyone know if there is a way to fix this in the compiler
setting/environment.


You can rename functions like foo and call them through new functions:

// Renamed
void foo_impl(int * i)
{
cout << *i << '\n';
}

// Uses the address of the object
void foo(vector<int>::iterator iter)
{
return foo_impl(&(*iter));
}

Ali
Jul 22 '05 #3

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

Similar topics

0
by: Martin Bless | last post by:
I need to access a MSSQL database (MS-Sql, not MySQL!)and would very much like to use mssql-0.09.tar.gz which is available from http://www.object-craft.com.au/projects/mssql/download.html ...
5
by: Lars Schouw | last post by:
I have downloaded the newest boos release. I am havng problems building boost using the intel C++ 8.0 compiler. It looks as if bjam can't fine the icl.exe compiler executable itself. This file is...
1
by: Omid Hodjati | last post by:
Hi All, I have an old unmanaged code written in C++ 6.0. This is a time critcal, CPU bound application. I have deciede migrate this application to managed world and VC++ 7.0. The first step was...
0
by: Joakim | last post by:
Hi, my VC.NET 2003 IDE hangs for hours when compiling my ATL7-project. It seams to compile fine and starts linking. This look OK to. But right before the component registration ("Performing...
6
by: Joe Piscapo | last post by:
Hello, When I compile my program in Visual Studio it does not work for every input, some numbers make it crash. But compiling in gcc works for those numbers that made it crash in Visual Studio. ...
0
by: Yadnesh | last post by:
I have a C++ Legacy code application that I had compiled on VC 6.0 and deployed to customer. The application created crash dump using MiniDumpWriteDump() when unhandled exception occurs. For...
1
by: Michel | last post by:
In VC++ from Visual Studio 2005 the following occurs: If I try to compile anyting, even a newly created empty MFC application with 1 empty dialog, I get the following 2 errors: Compiling......
2
by: john.placais | last post by:
Hello generous helper! I am trying to figure out how to port my code from 32-bit VC++ 6.0 to unmanaged C++ 64-bit VS2005. I have found the preprocessor definition changes and the linker changes,...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
1
by: jon2211 | last post by:
I tried to compile some code with #include <shellapi.h. I am linking shell32.lib. I am not trying to use ShellExecute() but right now just getting the code to compile with the header file an...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.