Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » MSC8 compile error "Button Example"
MSC8 compile error "Button Example" [message #3976] Wed, 12 July 2006 14:19 Go to next message
yoco is currently offline  yoco
Messages: 25
Registered: June 2006
Location: Taiwan
Promising Member
Enviroment:
  • OS: Windows XP SP2
  • Compiler: MS VC++ 2005 Express (MSC8)
  • Library: Windows 32 Plateform SDK installed
  • UPP ver.: 606 dev4
  • File: Ctrl.iml

Error message:
Button.cpp
C:\upp\uppsrc\CtrlLib/Ctrl.iml : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\upp\uppsrc\CtrlLib/Ctrl.iml(2) : error C2001: newline in constant
C:\upp\uppsrc\CtrlLib/Ctrl.iml(3) : error C2001: newline in constant
(and the following 100 same lines...)


I had done and checked Setup->Automaitc setup,
All directory are correct,
and I had also installed Win32SDK.
What should I do now Smile?

Thank you very much.
(Chameleon is cool!)
Re: MSC8 compile error "Button Example" [message #3989 is a reply to message #3976] Thu, 13 July 2006 18:14 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
yoco wrote on Wed, 12 July 2006 08:19

Enviroment:
  • OS: Windows XP SP2
  • Compiler: MS VC++ 2005 Express (MSC8)
  • Library: Windows 32 Plateform SDK installed
  • UPP ver.: 606 dev4
  • File: Ctrl.iml

Error message:
Button.cpp
C:\upp\uppsrc\CtrlLib/Ctrl.iml : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\upp\uppsrc\CtrlLib/Ctrl.iml(2) : error C2001: newline in constant
C:\upp\uppsrc\CtrlLib/Ctrl.iml(3) : error C2001: newline in constant
(and the following 100 same lines...)


I had done and checked Setup->Automaitc setup,
All directory are correct,
and I had also installed Win32SDK.
What should I do now Smile?

Thank you very much.
(Chameleon is cool!)



Unfortunately, this is a "feature" of MSC8 - it fails this way if you are using some codepage in XP. It has some related troubles with strings as well and frankly, I am not sure what to do with that.

Well, there is one thing - there will be new .iml format using straight numbers instead of strings...

Mirek
Re: MSC8 compile error "Button Example" [message #4003 is a reply to message #3989] Fri, 14 July 2006 14:44 Go to previous messageGo to next message
yoco is currently offline  yoco
Messages: 25
Registered: June 2006
Location: Taiwan
Promising Member
I solved this problem.

The problem caused by the default charset in Taiwan is Big-5 (similar with iso-8895-1).

In far-east country, their words are more than 255,
far more than a byte can represent,
so sometimes they hava to combine two bytes to represent one words.

In this charset,
If the ASCII of a char is smaller than 127, it will treate as a normal ANSI char.
If the ASCII of a char is bigger than 128, it will be combined with the next char to represent one far-east word.


A segment of the Ctrl.iml file
In standerd ANSI, it looks like this


IMAGE_SCAN("Õ\1\0¤¤‚\0\377\377\2ÀÀÀ\0\0\0Ö")
IMAGE_SCAN("Ô\1\0¤¤„\0\377\377\3ÀÀÀ\0\0\0¤¤¤Ô")
IMAGE_SCAN("Ô\1\0¤¤…\0\377\377\1\0\0\0‚¤¤¤Ó")
IMAGE_SCAN("Ó\1\0¤¤†\0\377\377\2ÀÀÀ\0\0\0‚¤¤¤Ò")



but in Big-5 charset, it is...


IMAGE_SCAN("惝1\0¤¤倦0\377\377\2擬餐0\0\0?)
IMAGE_SCAN("偅1\0¤¤浅0\377\377\3擬餐0\0\0¤¤¤?)
IMAGE_SCAN("偅1\0¤¤诉0\377\377\1\0\0\0?¤¤?)
IMAGE_SCAN("罡1\0¤¤赅0\377\377\2擬餐0\0\0?¤¤?)


The second qoute which to close the string literal,
was been combined with the previous byte to present one fareast word,
cause of the prevouis byte is bigger than 128.
Since there are no qoute to close the string literal,
so it raised a C2001 compile error in MS VC++.

I had wrote a simple program to translate the original .iml file to a new one,
by replace byte bigger than 128 to OCT string literal form.
Recompile, and everything is fine. Smile

I hope this may be helpful to you.

PS. the simple program.
int main( int args, char* argv[] )
{
	string fn = argv[1] ;
	ifstream fin ( fn.c_str() ,ios_base::binary ) ;
	if ( !fin ) { cout << fn << " not exist!" << endl ; return 0 ;}

	string cmd( "copy" ) ;
	cmd = cmd + " " + fn + " " + fn + ".bak" ;
	system ( cmd.c_str() ) ;

	fin.close() ;
	fin.open( (fn+".bak").c_str() ) ;

	ofstream fout(fn.c_str()) ;

	char buf [5] = "\\" ;
	unsigned char ch ;
	while ( fin.get((char&)ch) ) {
		if ( ch<128 ) {	fout.put(ch) ; } 
		else {
			buf[1] = '0' + ch/64 ;
			buf[2] = '0' + (ch%64)/8 ;
			buf[3] = '0' + ch%8 ;
			fout << buf ;
		}
	}

}

Re: MSC8 compile error "Button Example" [message #4004 is a reply to message #4003] Fri, 14 July 2006 14:58 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes, I am actually aware of this trouble. The MSC8 problem is that there is

#pragma setlocale("C")

in Core/defs.h (so that it gets included everywhere), which should be supported by MSC, but unfortunately something is wrong in the compiler....

In fact, there is little trouble with .iml files - next version can and will change format so that this does not matter.

However, the real troubles comes with translation files - it would be rather unfortunate if they would not be editable directly...

Mirek
Previous Topic: Why is Release mode Non-Blitz?
Next Topic: compilation problem in DrawX11.cpp
Goto Forum:
  


Current Time: Tue Apr 16 12:18:54 CEST 2024

Total time taken to generate the page: 0.02325 seconds