|
|
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Compiling IML file problem
Compiling IML file problem [message #3526] |
Wed, 31 May 2006 10:38  |
wanzi
Messages: 1 Registered: May 2006 Location: NZ
|
Junior Member |
|
|
Hi, I just downloaded the UPP, when trying to compile the examples, it gives error saying some thing like constant begins at new line.
So I open the file, and found that for many lines, the string didn't end with the quotation mark. Presumably due to the encoding problem, I then changed the encoding in the package orgnizer from default to window-1252.
Now I could see they were correctly quoted, but the compiler still didn't recognize it, I then copied the code from TheIDE and pasted it to a new file and changed its internal encoding to window-1252, then saved it.
Finally It compiled, but all images in the apps are corrupted, I then re-examed the warning issued from the previous build, found that because the file contained the non-ascii strings, it required that for every string i need to add _T macro for it, otherwise some info may be lost.
Since there are 2000+ lines, I wanna know if there's a way to get around it.
I am using MSVC8 professional with WinXP.
Any suggestion is appreciated.
|
|
|
Re: Compiling IML file problem [message #3566 is a reply to message #3526] |
Thu, 01 June 2006 21:17   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
wanzi wrote on Wed, 31 May 2006 04:38 | Hi, I just downloaded the UPP, when trying to compile the examples, it gives error saying some thing like constant begins at new line.
So I open the file, and found that for many lines, the string didn't end with the quotation mark. Presumably due to the encoding problem, I then changed the encoding in the package orgnizer from default to window-1252.
Now I could see they were correctly quoted, but the compiler still didn't recognize it, I then copied the code from TheIDE and pasted it to a new file and changed its internal encoding to window-1252, then saved it.
Finally It compiled, but all images in the apps are corrupted, I then re-examed the warning issued from the previous build, found that because the file contained the non-ascii strings, it required that for every string i need to add _T macro for it, otherwise some info may be lost.
Since there are 2000+ lines, I wanna know if there's a way to get around it.
I am using MSVC8 professional with WinXP.
Any suggestion is appreciated.
|
Well, this is really strange, I have not experienced anything like this so far... Of course, if you change .iml encoding, it would lead to this kind of problem (because data there binary).
And yes, there is some strange problem with string encoding in MSC 8.0
Could you please check .iml files with some form of hex editor to see whether there are or not those '\"' at the end?
Mirek
|
|
|
Re: Compiling IML file problem [message #4997 is a reply to message #3566] |
Wed, 30 August 2006 05:15   |
andywang
Messages: 8 Registered: August 2006 Location: CC
|
Promising Member |
|
|
HOST Version: XP+SP2 Chinese version, Cygwin(lastest), MSC71 and MSC80(VC 2005 Express)
UPP Version: upp-win-605.exe
MSC71 - Debug/optimize PASS, optimize for speed/size FAILED
IMAGE_BEGIN(option2)
IMAGE_SCAN("")
IMAGE_SCAN("")
IMAGE_SCAN("")
line 366 - 370
IMAGE_SCAN(" Ã\11ÀÀÀ\377\377\377ÀÀÀ\377\377\377ÀÀÀ\377\377\377ÀÀÀ\377\377 \377ÀÀÀ ")
IMAGE_SCAN(" Ã\11\377\377\377ÀÀÀ\377\377\377ÀÀÀ\377\377\377ÀÀÀ\377\377\37 7¤¤¤\377\377\377 ")
IMAGE_SCAN("Ã\6ÀÀÀ\377\377\377ÀÀÀ\377\377\377ÀÀÀ\377\377\377 ‚¤¤¤\1ÀÀÀ")
IMAGE_SCAN("Ã\5\377\377\377¤¤¤\377\377\377ÀÀÀ\377\377\377ƒ¤¤¤\1\377\377\377 ")
IMAGE_SCAN("Ã\1ÀÀÀ‚¤¤¤\1\377\377\377ƒ¤¤¤\2\377\377\377ÀÀÀ ")
C:\upp\uppsrc\CtrlLib\Ctrl.iml(366) : error C2001: newline in constant
C:\upp\uppsrc\CtrlLib\Ctrl.iml(368) : error C2001: newline in constant
C:\upp\uppsrc\CtrlLib\Ctrl.iml(370) : error C2001: newline in constant
C:\upp\uppsrc\CtrlLib\Ctrl.iml(372) : error C2001: newline in constant
C:\upp\uppsrc\CtrlLib\Ctrl.iml(374) : error C2001: newline in constant
MSC80 - ALL FAILED.
----- CtrlLib ( GUI MSC8 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (1 / 9)
BLITZ: LabelBase.cpp Button.cpp Switch.cpp EditField.cpp Text.cpp LineEdit.cpp DocEdit.cpp ScrollBar.cpp HeaderCtrl.cpp ArrayCtrl.cpp DropList.cpp DropP
usher.cpp DropChoice.cpp Static.cpp Splitter.cpp SliderCtrl.cpp ColumnList.cpp Progress.cpp AKeys.cpp RichTextView.cpp RichClip.cpp Prompt.cpp Help.
cpp Bar.cpp MenuBar.cpp ToolBar.cpp ToolTip.cpp StatusBar.cpp TabCtrl.cpp TreeCtrl.cpp DlgColor.cpp ColorPopup.cpp ColorPusher.cpp FileList.cpp File
Sel.cpp Windows.cpp Win32.cpp CtrlUtil.cpp Update.cpp LNGCtrl.cpp
$blitz.cpp
C:\upp\uppsrc\CtrlLib/Ctrl.iml : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file i
n Unicode format to prevent data loss
C:\upp\uppsrc\CtrlLib/Ctrl.iml(366) : error C2001: newline in constant
C:\upp\uppsrc\CtrlLib/Ctrl.iml(368) : error C2001: newline in constant
C:\upp\uppsrc\CtrlLib/Ctrl.iml(370) : error C2001: newline in constant
C:\upp\uppsrc\CtrlLib/Ctrl.iml(372) : error C2001: newline in constant
MINGW - on cygwin ALL FAILED
(the path is strange, why D:\dev\cygwin\bin/c++.exe ? should be D:\dev\cygwin\bin\c++.exe.)
----- CtrlLib ( GUI GCC DEBUG DEBUG_FULL BLITZ WIN32 ) (1 / 9)
BLITZ: LabelBase.cpp Button.cpp Switch.cpp EditField.cpp Text.cpp LineEdit.cpp DocEdit.cpp ScrollBar.cpp HeaderCtrl.cpp ArrayCtrl.cpp DropList.cpp DropP
usher.cpp DropChoice.cpp Static.cpp Splitter.cpp SliderCtrl.cpp ColumnList.cpp Progress.cpp AKeys.cpp RichTextView.cpp RichClip.cpp Prompt.cpp Help.
cpp Bar.cpp MenuBar.cpp ToolBar.cpp ToolTip.cpp StatusBar.cpp TabCtrl.cpp TreeCtrl.cpp DlgColor.cpp ColorPopup.cpp ColorPusher.cpp FileList.cpp File
Sel.cpp Windows.cpp Win32.cpp CtrlUtil.cpp Update.cpp LNGCtrl.cpp
Error running process: ȷ
Command: D:\dev\cygwin\bin/c++.exe -c -I"C:\upp\examples" -I"C:\upp\uppsrc" -I"D:\dev\cygwin\include" -I"C:\upp\SDL-1.2.9\include" -DflagGUI -DflagGCC
-DflagDEBUG -DflagDEBUG_FULL -DflagBLITZ -DflagWIN32 -DbmYEAR=2006 -DbmMONTH=8 -DbmDAY=29 -DbmHOUR=22 -DbmMINUTE=36 -DbmSECOND=4 -g2 -static -D_DE
BUG -O0 "C:/upp/out/CtrlLib/MINGW.Debug_full.Gui/$blitz.cpp" -o "C:/upp/out/CtrlLib/MINGW.Debug_full.Gui/$blitz.o"CtrlLib.icpp
Error running process: ȷ
Command: D:\dev\cygwin\bin/c++.exe -c -I"C:\upp\examples" -I"C:\upp\uppsrc" -I"D:\dev\cygwin\include" -I"C:\upp\SDL-1.2.9\include" -DflagGUI -DflagGCC
-DflagDEBUG -DflagDEBUG_FULL -DflagBLITZ -DflagWIN32 -DbmYEAR=2006 -DbmMONTH=8 -DbmDAY=29 -DbmHOUR=22 -DbmMINUTE=36 -DbmSECOND=4 -g2 -static -D_DE
BUG -O0 -x c++ "C:\upp\uppsrc\CtrlLib\CtrlLib.icpp" -o "C:/upp/out/CtrlLib/MINGW.Debug_full.Gui/CtrlLib.o"
There were errors. (0:00.23)
PS1. When using WinHex to edit ctrl.iml, I happen to compile it again but then It passed in (MSC71 optimized for speed/size)! That may be because the WinHex lock the file and compiler can't access it and ignore it. what is the ctrl.iml for ? if it is missing, is there any problem following?
PS2. I capture the 366-370 hex version in WinHex, and I GUESS each line that has 0xC0C0C022 will cause the problems. I will track this further.( pls. see the attchament)
Andy.
-
Attachment: test.JPG
(Size: 353.75KB, Downloaded 1730 times)
[Updated on: Wed, 30 August 2006 05:23] Report message to a moderator
|
|
|
Re: Compiling IML file problem [message #4998 is a reply to message #4997] |
Wed, 30 August 2006 05:44   |
andywang
Messages: 8 Registered: August 2006 Location: CC
|
Promising Member |
|
|
I found :
http://averia.unm.edu/VisualCPPErrorMessages.html
Quote: | C2001: newline in constant
This error is usually caused by a string or character constant that is missing its closing ' or " symbol.
|
and That is because maybe in our multi-bytes system and mixed text, every byte larger than 127 may be treated as mutli-bytes(always 2-bytes) character(if it is the odd-th char in the line and the char right before it >127), so 0xC0C0C022 be treated as 0xC0C0 and 0xC022, so 0x22 (which is " ) is "lost" then VC compiler complains.
After I try add 368,370,372 a SPACE before "), these 3 lines pass. So one solution will be add an extra SPACE on each such line. Since I am brand-new to UPP, I am not sure if that is the right way.
Andy
[Updated on: Wed, 30 August 2006 05:47] Report message to a moderator
|
|
|
Re: Compiling IML file problem [message #4999 is a reply to message #4998] |
Wed, 30 August 2006 09:51   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
andywang wrote on Tue, 29 August 2006 23:44 | I found :
http://averia.unm.edu/VisualCPPErrorMessages.html
Quote: | C2001: newline in constant
This error is usually caused by a string or character constant that is missing its closing ' or " symbol.
|
and That is because maybe in our multi-bytes system and mixed text, every byte larger than 127 may be treated as mutli-bytes(always 2-bytes) character(if it is the odd-th char in the line and the char right before it >127), so 0xC0C0C022 be treated as 0xC0C0 and 0xC022, so 0x22 (which is " ) is "lost" then VC compiler complains.
After I try add 368,370,372 a SPACE before "), these 3 lines pass. So one solution will be add an extra SPACE on each such line. Since I am brand-new to UPP, I am not sure if that is the right way.
Andy
|
Hi,
yes, I have noticed this issue when working on CJK support yesterday.
Right now, I am not sure how to resolve it: Those strings are supposed to be simply accepted in "byte" form, no stupid conversions being performed.
There is #pragma setlocale("C"), which should be active (it is defs.h), but for some reason MSC seems to ignore it.
The only possible solution right now is to switch your language to something else than chinesse (e.g. with english, you should not encounter this problem).
Also, mingw works too. Errors you are reporting are unrelated to this issue. (mixing \ and / is OK). I guess your build method is not set right (I recommend downloading U++/mingw version, it contains much faster linker anyway).
Mirek
|
|
|
|
|
|
Re: Compiling IML file problem [message #5041 is a reply to message #5039] |
Thu, 31 August 2006 21:53  |
andywang
Messages: 8 Registered: August 2006 Location: CC
|
Promising Member |
|
|
No, I didn't apply the hostfix. The link leads me to the M$ support contact page not downloading. I also google but can't find where to download.
In VC71, I just patch the ctrl.iml only and no other files. (maybe only this file occurs this problem). But for safe I think any .iml file added the protecting line would be a good idea.
[Updated on: Thu, 31 August 2006 21:57] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Apr 27 15:44:03 CEST 2025
Total time taken to generate the page: 0.04075 seconds
|
|
|