boost is unable to read ^A character - c++

I have an xml file generated by boost library (using write_xml). When I try to read it using boost's read_xml function, it gives me an error saying
< unspecified file>(20):expected <
when I open the file through vim, correctly written xml tags are ended at 19th line and it shows an additional ^A character at line 20.
This happens in Mac 10.6 xcode 3.2.2 x64 environment.
what does ^A mean?
how could I get rid of this ^A character.

Related

Eclipse RegExp Console Parsing Errors into Problems Window

Eclipse expert help needed! I have set up a makefile project to compile and link HCS12 code using the free codewarrior tools. It all seems to work well, but the only error/warning/information output I can get is to the console, with nothing being scanned from the console into the Problems window. I set up a regular expression error parser(Window -> Preferences -> C/C++ -> Build -> Settings -> Error Parsers) to scan the console for the appropriate information. If I search the console output (click in output and F) using find/replace with "regular expressions" checked, I find the warnings and errors--they just never get to the Problems tab.
I have enabled the error parser in (Project->Properties->C/C++ Build->Settings->ErrorParsers).
Somewhere I read that I need to enable this in C/C++ Makfile settings--but I cannot fine any settings which include the name "Makefile"; did I set up my project wrong??
Any suggestions or ideas on how to get my parsed errors into the problems window?
Eclipse Luna, Windows 7 professional.
It seems that the Regex parser for Eclipse (at least the older version I am currently using) assumes you start at the beginning of a line of text and end at the end of a line of text. My compiler errors were spanning multiple lines; I found a switch in the compiler which allowed it to output the errors in "microsoft format", which was then on a single line.
the new warning line looks like
.\CODE\LIBCODE\CodeLibraries\Drivers\CI2C1.C(312): WARNING C1801: Implicit parameter declaration for 'CI2C1_OnMasterBlockSent'
regex that works is now
[^"\n]\([^"(])((\d+)): WARNING C(\d+):([^\n]*)
of particular note is the [^"\n]*\ at the beginning of the regex expression, which matches all characters from the beginning of the line until the last \ is found--this is the piece I was missing. Eclipse Kepler is rather unforgiving about the regex it requires.
and we have
File $1 (just the file name--eclipse adds the path mysteriously if the file is in a code directory of the project)
Line $2 (gathers the line number of the error)
Descrioption $4 ( I ignore WARNING and the warning number, and capture the description of the error to the end of the line)
I now have a useful and somewhat more modern IDE to work with ancient code which grew from the assembly code over many years and was never parsed out into libraries or restructured into modern levels of abstraction.

C++ : File format error

While compiling c++ code using vs 2005, i'm getting following mac file format related error. I couldn't find any reference in the internet for this particular error. Can someone help me regarding this.
error C4335: Mac file format detected: please convert the source file to either DOS or UNIX format
WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
According to the MSDN:
The line termination character of the first line of a source file is Macintosh style (‘\r’) as opposed to UNIX (‘\n’) or DOS (‘\r\n’).
So just change line ending for your file. To do that, go File -> Advanced Save Options -> Set line endings to Windows.

Sublime Text 2 buiding C++ - nothing happens

Trying to build a C++ file using Sublime's console I get the following:
Traceback (most recent call last):
File "./sublime_plugin.py", line 337, in run_
File "./exec.py", line 130, in run
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0301' in position 78: ordinal not in range(128)
I already read this: Sublime text 2 build tools - nothing happens, but after fixing that one I got another error you see above.
Any hints on making this work (allow me to build and run simple C++ codes directly from ST2) would be appreciated, thanks in advance.
Have you tried this?
Sublime Text 2 encoding error with python3 build
I'm using Sublime 3 and it does build simple files (like "hello world") without any problem (using CTRL+B or CTRL+SHIFT+B). I have Windows 8.1, 64 bits.
Seems to me that you're trying to run a program that contains the ´ (acute accent) character. Either that's a mistake and you intended to write the single quote ' instead, or if that's what you wanted, then the Python interpreter does not recognise as an ASCII char (since it isn't) and thus complains.

Adding breakpoints to GDB in files with comma in path

When using GDB 7.4 or 7.5 (haven't tested older versions), is it possible to add breakpoints to files which reside in a folder path that includes commas? I've been trying to get it to work (when working on the debugger interface of Dev-C++), but GDB is interpeting my commands wrong.
I use the following command to send breakpoint commands to GDB:
// sets break at line 13 in mentioned file using filename:linenum
break "C:/Foo,Bar/main.c":13
In other words, \ is replaced by / to avoid accidental escaping and for extra safety "" is added around the filename. Should work fine right?
Well, no. For some reason GDB clips the file path and tries to execute:
break "C:/Foo":13
... and it throws a generic error:
"Error in re-setting breakpoint 1: Function "C:/Foo" not defined.
Any ideas how I can fix this? I haven't been able to find anything useful regarding commas and GDB filenames here and on Google.
You can't do that as gdb use comma to separate multiple expression, so it react as you give it two paths.

Stray /377 in xcode

I'm using xcode to do some c++ programming and all of a sudden I am receiving a "Stray /377 in program error"
I think is possibly because I recently started using a non apple wireless keyboard and I possibly put in some kind of weird key combination that created a non visible key.
I tried changing the encoding of the .cpp file to utf 8 but then when I reopen the file in xcode it comes out in chinese?
My project is very large so its not feasible to post the code for the project.
I'm using xcode 3.2.6 on osx 10.6.8
I tried opening the project in xcode 3.1.6 and got the same error.
"377" is octal for "255", or an 8-bit "-1".
Do you have one of those anywhere?
I believe XCode has a hex editor: just look for "0xff" somewhere in your recent source changes.
Octal 377 is decimal 255. It has no meaning in UTF-8, means a "latin small letter y with diaeresis" in ISO-8859-1. I think its presence in the file is probably a sign that it does not belong and can be removed without further consequences. If you agree, you can try removing all them in your entire tree like this:
find . -name '*.cpp' -exec sed -i~ 's/\o377//g' {} \;
The -i~ asks sed to make a backup copy of the files that it changes, in case you need the originals back -- or want to compare the changes with diff(1).