Pregunta

I'm struggling to get TinyXML working in my Visual C++ Project.

I'm trying to create a Windows Mobile 5.0/CE application reading a XML configuration file. I use the Pocket PC 2003(ARMV4) architecture in a MFC Smart Project base on dialog boxes. Even in a blank project, just trying to compile the library, it gives me the same result and I don't understand why.

I added these six files in my project :

- tinyxml.h
- tinystr.h
- tinyxml.cpp
- tinystr.cpp
- tinyxmlerror.cpp
- tinyxmlparser.cpp

And it gives me this when compiling :

tinyxml.cpp
..\..\tinyxml_2_6_2\tinyxml\tinyxml.cpp(44) : error C3861: 'fopen_s' : identificateur introuvable
..\..\tinyxml_2_6_2\tinyxml\tinyxml.cpp(116) : error C3861: '_snprintf_s' : identificateur introuvable
..\..\tinyxml_2_6_2\tinyxml\tinyxml.cpp(1239) : error C3861: 'sscanf_s' : identificateur introuvable
..\..\tinyxml_2_6_2\tinyxml\tinyxml.cpp(1246) : error C3861: 'sscanf_s' : identificateur introuvable
..\..\tinyxml_2_6_2\tinyxml\tinyxml.cpp(1255) : error C3861: '_snprintf_s' : identificateur introuvable
..\..\tinyxml_2_6_2\tinyxml\tinyxml.cpp(1266) : error C3861: '_snprintf_s' : identificateur introuvable

identificateur introuvable can be translated as identifier not found.

Does anyone know why ?

Thanks !

¿Fue útil?

Solución

I finally solved my problem. I had the same issue with other libaries like PugiXML.

Actually, it was caused by the declaration of the function quoted previously :

fopen_s
_snprintf_s
sscanf_s

It seems that Windows Mobile architecture can't deal with them. They were declared in the code according to Visual Studio's version :

#if !defined(_MSC_VER) || _MSC_VER >= 1300
    declaration (fopen_s, sscanf_s ...)
#else
    other declaration

By changing the condition of the declaration (for example MSC_VER to 4000), the library declared other functions that allowed me to recompile properly. It's now working on Windows Mobile.

Hope this will help !

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top