Cvb::String is sometime std::string or std::wstring

Hi guys,

Is someone can explain to me why sometime I can get Cvb::String as std::string and sometime as std::wstring in the same computer and by upgrading or downgrading CVB installion ? I don’t understand why.

I am working on a R&D computer where I install various CVBB versions for my test.

Thanks,
Axel

Hi @AxelDosSantosDoAlto ,

look at the following file: %CVB%\Lib\C\cvb\string.hpp.

In there we define, and this holds since 7 years:

  • using String = std::wstring ; if the cmake project is given the configuration with add_definitions(-DUNICODE)
  • The only way, the String can be a std::string, is by undefining this or not being in Windows.

Given this, the difference in the definition most likely comes from your project-wise CMake definitions.

I hope this helps. If not, please come back again.

Helloo @s-woe,

Thanks for your message.

I install CVB with an executable “Full installer”, not by using CMake.

Is that a better way to use CVB in my softwares ? If so, I will dot it instead of using the full installer.

Thanks,

CMake is used to build your applications and its project related configurations, not for installing CVB. Look at a sample programs (e.g. in %CVB%\Tutorial\Image Manager\Cvb++\CppCompositeStreamHandler\CMakeLists.txt) on how to setup a build of a cvb-powered application. Inside this script you are able to define the above mentioned flag.

1 Like

Thanks for your answer !