Community
cancel
Showing results for 
Search instead for 
Did you mean: 
michael_green
Beginner
224 Views

_wtof identifier not found

Hi All,

I'm new to this stuff but ...

What could cause "'_wtof': identifier not found" when there is no problem with _wtoi ?

Many thanks
Mike
0 Kudos
5 Replies
ILevi1
Valued Contributor I
224 Views

_wtof is defined in stdlib.h and also in wchar.h just like _wtoi. What Visual Studio version are you using? Can you compile successfully with MSVC compiler? Can you post a sample code?
michael_green
Beginner
224 Views

Thanks for reply. I'm using Visual Studio 2005and I'm building a SmartDevice project (Windows CE). The following is the complete code for a console application demonstrating the problem. As is stands it compiles, but if I uncomment the reference to _wtof it does not.

// wtoftest.cpp : Defines the entry point for the console application.

//

#include "stdafx.h"

#include

#include

#include

int _tmain(int argc, _TCHAR* argv[])

{

wchar_t spi[8] = L"3.14159";

wchar_t sint[9] = L"12345678";

double pi;

int i;

//pi = _wtof(spi);

i = _wtoi(sint);

return 0;

}

Many thanks for any insights.
Mike

ILevi1
Valued Contributor I
224 Views

You did not answer whether it compiles with Microsoft compiler?

Also, what version of Intel compiler do you use?

The following code:
[cpp]#include 
#include 
#include 

int wmain(int argc, wchar_t *argv[])
{
	wchar_t spi[8] = L"3.14159";
	wchar_t sint[9] = L"12345678";
	double pi;
	int i;

	pi = _wtof(spi);
	i = _wtoi(sint);

	return 0;
}
[/cpp]
Compiles just fine with Intel Compiler 12.0.4.147 (this is the latest version, part of Parallel Composer 2011 Update 4).
michael_green
Beginner
224 Views

My version of C++ according to my Visual Studio About dialog is:

Microsoft Visual C++ 2005 77626-009-0000007-41162

so no, it does not compile with Microsoft C++. However, I have discovered that if I create a simple console application for Win32 the code compiles fine. The problem seems to have something to do with the fact that I am targetting a Smart Device (with Windows CE, not Windows XP).

Many thanks
Mike
ILevi1
Valued Contributor I
224 Views

A quick Google search reveals the following:

There's no such function as _wtof. What you can do is to convert the UNICODE character to ANSI and use atof instead.

Good luck!
Reply