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

Tinyxml produces 50 compiler errors in my application

kiseitai2
Hi,

I'm in a Windows Vista machine and, when I try to compile my program's code, I get compiler errors that are not related to my app. I'm using Code::Blocks 10.05 with the MinGW (gcc) compiler set. The application I'm doing is a simple game engine (mostly for fun and learning). However, I'm using tinyxml to create a basic xml class so I can have externally generated data, such as texture locations, in my final engine. I don't know how to approach this problem. Thank you!


Here's the log:

C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|55|error: syntax error before "TiXmlString"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|56|error: syntax error before '{' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|62|error: syntax error before "npos"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|62|warning: data definition has no type or storage class|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|66|error: syntax error before ':' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|71|error: syntax error before '&' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|74|error: syntax error before '(' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|74|error: conflicting types for 'memcpy'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|74|error: conflicting types for 'memcpy'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|74|error: syntax error before '.' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|78|error: syntax error before ':' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|81|error: syntax error before '(' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|81|error: syntax error before ')' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|85|error: syntax error before "size_type"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|88|error: syntax error before '(' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|88|error: syntax error before ')' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h||In function `c_str':|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|128|error: syntax error before '{' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|197|error: syntax error before '&' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|215|error: syntax error before '}' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|217|error: syntax error before "sz"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|227|error: syntax error before "intsNeeded"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|250|error: storage class specified for parameter `Rep'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|250|error: syntax error before "nullrep_"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|255|error: syntax error before "operator"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|92|error: parameter `TIXML_MAJOR_VERSION' is initialized|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|93|error: parameter `TIXML_MINOR_VERSION' is initialized|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|94|error: parameter `TIXML_PATCH_VERSION' is initialized|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|101|error: syntax error before "TiXmlCursor"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|101|warning: no semicolon at end of struct or union|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|106|error: syntax error before '}' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|159|warning: enum defined inside parms|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|159|warning: empty declaration|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|168|warning: enum defined inside parms|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|168|warning: empty declaration|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|170|error: syntax error before "TIXML_DEFAULT_ENCODING"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|221|error: syntax error before "condense"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|221|error: storage class specified for parameter `SetCondenseWhiteSpace'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|262|error: syntax error before '&' token|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|262|error: storage class specified for parameter `EncodeString'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|284|warning: enum defined inside parms|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|284|warning: empty declaration|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|286|error: syntax error before "protected"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|290|error: storage class specified for parameter `bool'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|290|error: redefinition of parameter 'bool'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinystr.h|255|error: previous definition of 'bool' was here|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|290|error: syntax error before "IsWhiteSpace"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|316|error: syntax error before "TiXmlString"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|320|error: storage class specified for parameter `ReadText'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|323|error: syntax error before "TiXmlEncoding"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|323|error: storage class specified for parameter `GetEntity'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|327|error: syntax error before "TiXmlEncoding"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|328|error: storage class specified for parameter `GetChar'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|371|error: storage class specified for parameter `errorString'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|373|error: syntax error before "TiXmlCursor"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|380|error: syntax error before "TiXmlEncoding"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|380|error: storage class specified for parameter `IsAlpha'|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|381|error: syntax error before "TiXmlEncoding"|
C:\Users\Kiseitai2\Documents\Dev-Cpp Projects\Engine_Eureka\tinyxml.h|381|error: storage class specified for parameter `IsAlphaNum'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 8 warnings ===|
Jul 24 '12 #1

✓ answered by kiseitai2

I solved the problem. I gotta face-palm for this. The issue was that, since I originally created the project as an empty project, the compiler used was defined by the source code's file extension. That is totally fine until you allow Code::Blocks to save your files with the C file extension (.c) instead of C++'s extension (.cpp). That was triggering the C compiler instead of the C++ compiler. Sorry for wasting your time.

5 2809
weaknessforcats
9,208 Expert Mod 8TB
In tinystr.h at line 55 the compiler got into trouble.

The actual error is there or at some point earlier.

Look around TiXmlString.

Fix only the first error then rebuild. Often later errors are the result of previous errors and go away when the previous error is fixed.
Jul 25 '12 #2
Thanks! I'm gonna take a closer look around there. It concerns me , however, that I never changed any part of the original source code. I was expecting it to compile since I trust MinGW and the work of the tinyxml community. Thanks again!
Jul 25 '12 #3
weaknessforcats
9,208 Expert Mod 8TB
It may be that tinystr.h needs you to include some other header before it is included. Or, it may be you need a build flag set.

You could post the code around the tinystr.h include and then the first 55 lines of tinystr.h. We could take a peek
Jul 25 '12 #4
I took a look at the tinyxml code and it seems the problem has to do with a macro, which defines a type used in the code. Now, I'm terrible with macros. In fact, I only know how to recognize them, but I try to stay away from them. Here's the code snippet before line 55 that may be causing the syntax error:
Expand|Select|Wrap|Line Numbers
  1. #ifndef TIXML_USE_STL
  2.  
  3. #ifndef TIXML_STRING_INCLUDED
  4. #define TIXML_STRING_INCLUDED
  5.  
  6. #include <assert.h>
  7. #include <string.h>
  8.  
  9. /*    The support for explicit isn't that universal, and it isn't really
  10.     required - it is used to check that the TiXmlString class isn't incorrectly
  11.     used. Be nice to old compilers and macro it here:
  12. */
  13. #if defined(_MSC_VER) && (_MSC_VER >= 1200 )
  14.     // Microsoft visual studio, version 6 and higher.
  15.     #define TIXML_EXPLICIT explicit
  16. #elif defined(__GNUC__) && (__GNUC__ >= 3 )
  17.     // GCC version 3 and higher.s
  18.     #define TIXML_EXPLICIT explicit
  19. #else
  20.     #define TIXML_EXPLICIT
  21. #endif
  22.  
I tried changing the elif part to if or else if and both gave errors. I also know that the source came with a Makefile and a Visual Studio solution file (.sln), so the Makefile may have any extra flags I am not aware. I will compare Code::Blocks's Makefile to tinyxml's and merge any flags tomorrow. Finally, I don't include tinystr.h into my code, but it is implemented by tinyxml.cpp/ tinyxml.h. Thanks and good night.
Jul 25 '12 #5
I solved the problem. I gotta face-palm for this. The issue was that, since I originally created the project as an empty project, the compiler used was defined by the source code's file extension. That is totally fine until you allow Code::Blocks to save your files with the C file extension (.c) instead of C++'s extension (.cpp). That was triggering the C compiler instead of the C++ compiler. Sorry for wasting your time.
Jul 25 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: jon morgan | last post by:
Hi, I get random errors raised when compiling a multi-project application. For example the compiler will claim that a class has no constructor when it does. If I replace the first line of the...
8
by: jon morgan | last post by:
OK, I'm going to be brave. There is a bug in VS.Net 1.1 that causes random compiler errors. I have raised this issue in posts at least three time in the past couple of months without attracting...
1
by: Hafeez | last post by:
I am having real trouble compiling this code http://www.cs.wisc.edu/~vganti/birchcode/codeHier/AttrProj.tgz The attachment shows errors when compiled using the current version of g++ in a...
1
by: lucho | last post by:
Hi everyone, I have the same problem as described under Q316317 (http://support.microsoft.com/default.aspx?scid=kb;en- us;316317) ie a compiler error saying c:\Program Files\Microsoft Visual...
0
by: Charles Law | last post by:
I thought I would pass this on, as I have oft' seen this problem reported, with no solution. The problem is that in a solution containing several projects, the compiler will sometimes report a...
2
by: Just Me | last post by:
I beleive it is because I have some projects in more than one solution that I develope the following type of errors. Can anyone tell me how to avoid this or what to do when it happens? Thanks...
3
by: Richard | last post by:
I have created a Windows service which performs various functions including setting variables in other application objects. When the service runs under Local System account the functionality all...
2
by: Samuel R. Neff | last post by:
Within the past few weeks we've been getting a lot of compiler errors in two classes when no errors actually exist. The error always reports as Name '_stepResizeRelocator' is not declared. ...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.