I have a problem. Essentially, I need to keep a large list of whitelists inside my program, and I would like to include such a list directly - I donโt want to distribute other libraries, etc., And I donโt want to insert lines into the Win32 resource, for a number of reasons, which I donโt want to do now.
I simply included my large whitelist in my .cpp file and was presented with this error:
1>ServicesWhitelist.cpp(2807): fatal error C1091: compiler limit: string exceeds 65535 bytes in length
The string itself is approximately twice the permissible limit of VC ++. What is the best way to include such a large literal in a program?
EDIT:
I save the line as follows:
const std::wstring servicesWhitelist ( L".NETFRAMEWORK|" L"_IOMEGA_ACTIVE_DISK_SERVICE_|" L"{6080A529-897E-4629-A488-ABA0C29B635E}|" L"{834170A7-AF3B-4D34-A757-E05EB29EE96D}|" L"{85CCB53B-23D8-4E73-B1B7-9DDB71827D9B}|" L"{95808DC4-FA4A-4C74-92FE-5B863F82066B}|" L"{A7447300-8075-4B0D-83F1-3D75C8EBC623}|" L"{D31A0762-0CEB-444E-ACFF-B049A1F6FE91}|" L"{E2B953A6-195A-44F9-9BA3-3D5F4E32BB55}|" L"{EDA5F5D3-9E0F-4F4D-8A13-1D1CF469C9CC}|" L"2WIREPCP|"
EDIT2 It was used at runtime in a manner similar to this:
static const boost::wregex servicesWhitelistRegex(servicesWhitelist); std::wstring service;
c ++ long-integer literals
Billy oneal
source share