[xsd-users] USING UTF-8 Encoding while generating XML , now need to give Support of UNICODE Characters in XML

Auti, Ajay ajay.auti at siemens.com
Thu Jan 18 01:58:02 EST 2024


Hi Team ,

Please see attached Demo Application with Configuration which gives Linking Errors .

  1.  My current Demo application throw below linking errors (I have attached this application in mail )

Build started...

1>------ Build started: Project: DemoCodeSynthesis, Configuration: Debug Win32 ------

1>Source.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification

1>Source.obj : error LNK2019: unresolved external symbol "class std::auto_ptr<class hello_t> __cdecl hello(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class xsd::cxx::tree::flags,class xsd::cxx::tree::properties<char> const &)" (?hello@@YA?AV?$auto_ptr at Vhello_t@@@std@@ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@2 at Vflags@tree at cxx@xsd@@ABV?$properties at D@567@@Z) referenced in function _main

1>D:\Study\DemoCodeSynthesis\Debug\DemoCodeSynthesis.exe : fatal error LNK1120: 1 unresolved externals

1>Done building project "DemoCodeSynthesis.vcxproj" -- FAILED.

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



Configuration :

[cid:image001.png at 01DA4A09.C2CB37B0][cid:image002.png at 01DA4A09.C2CB37B0]



[cid:image003.png at 01DA4A09.C2CB37B0]



  1.  Please help me with a number of macros have to be defined to enable wchar_t .

  *   I am using below macros :

"xsd cxx-tree --namespace-map --generate-serialization --proprietary-license --char-type wchar_t --char-encoding auto"



E.g In my application I have provide Macros with below style in .vcxproj file

<CustomBuild Include="..\CCIA\Schema\IndicationsCatalog.xsd">

      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">xsd cxx-tree --namespace-map http://www.w3.org/2000/09/xmldsig#=xmldsig --generate-serialization --proprietary-license --char-type char --char-type wchar_t --char-encoding auto ..\CCIA\Schema\IndicationsCatalog.xsd</Command>

      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">xsd schema\IndicationsCatalog.xsd</Message>

      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">IndicationsCatalog.hxx;IndicationsCatalog.cxx;%(Outputs)</Outputs>

      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">xsd cxx-tree --namespace-map http://www.w3.org/2000/09/xmldsig#=xmldsig --generate-serialization --proprietary-license --char-type char --char-type wchar_t --char-encoding auto ..\CCIA\Schema\*.xsd</Command>

      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">xsd schema\IndicationsCatalog.xsd</Message>

      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">IndicationsCatalog.hxx;IndicationsCatalog.cxx;%(Outputs)</Outputs>

      <Command Condition="'$(Configuration)|$(Platform)'=='ICS_Debug|Win32'">



Please suggest on this and please let me know in case of any information required .



Regards,

Ajay


From: Auti, Ajay (ADV D IN MO RI-PS SYS ES-ET)
Sent: Thursday, January 18, 2024 12:26 PM
To: 'xsd-users at codesynthesis.com' <xsd-users at codesynthesis.com>; 'boris at codesynthesis.com' <boris at codesynthesis.com>
Subject: RE: [xsd-users] USING UTF-8 Encoding while generating XML , now need to give Support of UNICODE Characters in XML

Hi Team ,

Please see attached Demo Application with Configuration which gives Linking Errors .

  1.  My current Demo application throw below linking errors (I have attached this application in mail )

Build started...

1>------ Build started: Project: DemoCodeSynthesis, Configuration: Debug Win32 ------

1>Source.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification

1>Source.obj : error LNK2019: unresolved external symbol "class std::auto_ptr<class hello_t> __cdecl hello(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class xsd::cxx::tree::flags,class xsd::cxx::tree::properties<char> const &)" (?hello@@YA?AV?$auto_ptr at Vhello_t@@@std@@ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@2 at Vflags@tree at cxx@xsd@@ABV?$properties at D@567@@Z) referenced in function _main

1>D:\Study\DemoCodeSynthesis\Debug\DemoCodeSynthesis.exe : fatal error LNK1120: 1 unresolved externals

1>Done building project "DemoCodeSynthesis.vcxproj" -- FAILED.

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



Configuration :

[cid:image001.png at 01DA4A09.C2CB37B0][cid:image002.png at 01DA4A09.C2CB37B0]



[cid:image003.png at 01DA4A09.C2CB37B0]



  1.  Please help me with a number of macros have to be defined to enable wchar_t .

  *   I am using below macros :

"xsd cxx-tree --namespace-map --generate-serialization --proprietary-license --char-type wchar_t --char-encoding auto"



E.g In my application I have provide Macros with below style in .vcxproj file

<CustomBuild Include="..\CCIA\Schema\IndicationsCatalog.xsd">

      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">xsd cxx-tree --namespace-map http://www.w3.org/2000/09/xmldsig#=xmldsig --generate-serialization --proprietary-license --char-type char --char-type wchar_t --char-encoding auto ..\CCIA\Schema\IndicationsCatalog.xsd</Command>

      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">xsd schema\IndicationsCatalog.xsd</Message>

      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">IndicationsCatalog.hxx;IndicationsCatalog.cxx;%(Outputs)</Outputs>

      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">xsd cxx-tree --namespace-map http://www.w3.org/2000/09/xmldsig#=xmldsig --generate-serialization --proprietary-license --char-type char --char-type wchar_t --char-encoding auto ..\CCIA\Schema\*.xsd</Command>

      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">xsd schema\IndicationsCatalog.xsd</Message>

      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">IndicationsCatalog.hxx;IndicationsCatalog.cxx;%(Outputs)</Outputs>

      <Command Condition="'$(Configuration)|$(Platform)'=='ICS_Debug|Win32'">



Please suggest on this and please let me know in case of any information required .



Regards,

Ajay


From: Auti, Ajay (ADV D IN MO RI-PS SYS ES-ET)
Sent: Thursday, January 18, 2024 12:20 PM
To: xsd-users at codesynthesis.com<mailto:xsd-users at codesynthesis.com>; boris at codesynthesis.com<mailto:boris at codesynthesis.com>
Subject: RE: [xsd-users] USING UTF-8 Encoding while generating XML , now need to give Support of UNICODE Characters in XML

Hi Team ,

Please see attached Demo Application with Configuration which gives Linking Errors .

  1.  My current Demo application throw below linking errors (I have attached this application in mail )

Build started...

1>------ Build started: Project: DemoCodeSynthesis, Configuration: Debug Win32 ------

1>Source.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification

1>Source.obj : error LNK2019: unresolved external symbol "class std::auto_ptr<class hello_t> __cdecl hello(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class xsd::cxx::tree::flags,class xsd::cxx::tree::properties<char> const &)" (?hello@@YA?AV?$auto_ptr at Vhello_t@@@std@@ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@2 at Vflags@tree at cxx@xsd@@ABV?$properties at D@567@@Z) referenced in function _main

1>D:\Study\DemoCodeSynthesis\Debug\DemoCodeSynthesis.exe : fatal error LNK1120: 1 unresolved externals

1>Done building project "DemoCodeSynthesis.vcxproj" -- FAILED.

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



  1.  Please help me with a number of macros have to be defined to enable wchar_t .

  *   I am using below macros :

"xsd cxx-tree --namespace-map --generate-serialization --proprietary-license --char-type wchar_t --char-encoding auto"



E.g In my application I have provide Macros with below style in .vcxproj file

<CustomBuild Include="..\CCIA\Schema\IndicationsCatalog.xsd">

      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">xsd cxx-tree --namespace-map http://www.w3.org/2000/09/xmldsig#=xmldsig --generate-serialization --proprietary-license --char-type char --char-type wchar_t --char-encoding auto ..\CCIA\Schema\IndicationsCatalog.xsd</Command>

      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">xsd schema\IndicationsCatalog.xsd</Message>

      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">IndicationsCatalog.hxx;IndicationsCatalog.cxx;%(Outputs)</Outputs>

      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">xsd cxx-tree --namespace-map http://www.w3.org/2000/09/xmldsig#=xmldsig --generate-serialization --proprietary-license --char-type char --char-type wchar_t --char-encoding auto ..\CCIA\Schema\*.xsd</Command>

      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">xsd schema\IndicationsCatalog.xsd</Message>

      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">IndicationsCatalog.hxx;IndicationsCatalog.cxx;%(Outputs)</Outputs>

      <Command Condition="'$(Configuration)|$(Platform)'=='ICS_Debug|Win32'">



Please suggest on this and please let me know in case of any information required .



Regards,

Ajay


From: Auti, Ajay (ADV D IN MO RI-PS SYS ES-ET)
Sent: Wednesday, January 10, 2024 12:25 PM
To: xsd-users at codesynthesis.com<mailto:xsd-users at codesynthesis.com>; boris at codesynthesis.com<mailto:boris at codesynthesis.com>
Subject: RE: [xsd-users] USING UTF-8 Encoding while generating XML , now need to give Support of UNICODE Characters in XML


Hi Team , I am try to run Hello example as you suggested.

  1.  Found lots of linking errors please check below attached image .

  *   Visual studio Empty project with (libxerces-c-3.2.4+2-x86_64-windows10-msvc17.6) and (libxsd-4.2.0-windows) versions

[cid:image004.png at 01DA4A09.C2CB37B0]



  1.  Please help me with a number of macros have to be defined to enable wchar_t .

  *   I am using below macros :

"xsd cxx-tree --namespace-map --generate-serialization --proprietary-license --char-type wchar_t --char-encoding auto"



Can you please mentioned me defined macrosto enable wchar_t



Thanks ,

Ajay



-----Original Message-----
From: Boris Kolpackov <boris at codesynthesis.com<mailto:boris at codesynthesis.com>>
Sent: Thursday, January 4, 2024 7:42 PM
To: Auti, Ajay (ADV D IN MO RI-PS SYS ES-ET) <ajay.auti at siemens.com<mailto:ajay.auti at siemens.com>>
Cc: xsd-users at codesynthesis.com<mailto:xsd-users at codesynthesis.com>
Subject: Re: [xsd-users] USING UTF-8 Encoding while generating XML , now need to give Support of UNICODE Characters in XML



Auti, Ajay <ajay.auti at siemens.com<mailto:ajay.auti at siemens.com>> writes:



> To Support this , I had tried to change --char-type char to

> --char-type wchar_t  type It changed my .cxx and .hxx files to wchar_t

> but my Code Synthesis library included files are not supporting

> wchar_t type.



They support both char and wchar_t but for wchar_t a number of macros have to be defined to enable it. These macros are automatically defined by the generated code before including the relevant libxsd headers so if you don't include any of them directly, everything should work.



I suggest that you work out these issues using a simple examples, say the `hello` example from the xsd-examples package. Change it to use wchar_t and see if you still get errors that you get in your application. If not, then the issue is most likely in your application code.



See also:



https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcodesynthesis.com%2Fprojects%2Fxsd%2Fdocumentation%2Fcxx%2Ftree%2Fguide%2F%233.2&data=05%7C02%7Cajay.auti%40siemens.com%7Cbcc67c7cd2d1497cdd8808dc0d2f1c38%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C638399743214202390%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ck8DiT4TI2%2Bh0pocXALtvJ%2F7dQbepQhB3nVJnYVi8Dc%3D&reserved=0<https://codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#3.2>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 167903 bytes
Desc: image001.png
Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20240118/a580fc36/image001-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 145060 bytes
Desc: image002.png
Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20240118/a580fc36/image002-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 75585 bytes
Desc: image003.png
Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20240118/a580fc36/image003-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 201912 bytes
Desc: image004.png
Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20240118/a580fc36/image004-0001.png


More information about the xsd-users mailing list