|
|
Home » Developing U++ » U++ Developers corner » U++ does not appear to like playing nice with the Boost algorithm string library?
U++ does not appear to like playing nice with the Boost algorithm string library? [message #53457] |
Sat, 04 April 2020 03:07 |
ptkacz
Messages: 89 Registered: March 2017
|
Member |
|
|
When I compile the following (console application) code in U++:
#include <iostream>
#include <string>
#include <iostream>
using namespace std;
#include <Core/Core.h>
using namespace Upp;
#include <boost/algorithm/string.hpp>
CONSOLE_APP_MAIN
{
std::string str = " Lots of filler space ";
boost::algorithm::trim(str);
std::cout<<"\""<< str <<"\""<<std::endl;
}
the following error is resulting:
----- Core ( GCC DEBUG SHARED DEBUG_FULL BLITZ POSIX LINUX ) (1 / 2)
----- BoostStringTest ( MAIN GCC DEBUG SHARED DEBUG_FULL BLITZ POSIX LINUX ) (2 / 2)
BoostStringTest.cpp
In file included from /home/ptkacz/upp/uppsrc/Core/i18n.h:17:0,
from /home/ptkacz/upp/uppsrc/Core/Core.h:337,
from /home/ptkacz/MyApps/BoostStringTest/BoostStringTest.cpp:6:
/usr/include/boost/core/ref.hpp: In constructor 'boost::reference_wrapper<T>::reference_wrapper(T&)':
/home/ptkacz/upp/uppsrc/Core/t_.h:9:24: error: class 'boost::reference_wrapper<T>' does not have any field named 't_GetLngString'
#define t_(x) t_GetLngString(x)
^
BoostStringTest: 1 file(s) built in (0:01.55), 1551 msecs / file, duration = 1551 msecs
There were errors. (0:01.55)
I do know that U++ has it's only string utility functions, but was attempting to make use of code brought in from another application that I'm working on. Independently of any existing code, I wrote a simple C++ application in Code::Blocks, the code compiles and runs as expected.
Peter
|
|
|
Re: U++ does not appear to like playing nice with the Boost algorithm string library? [message #53460 is a reply to message #53457] |
Sat, 04 April 2020 10:18 |
|
mirek
Messages: 14059 Registered: November 2005
|
Ultimate Member |
|
|
ptkacz wrote on Sat, 04 April 2020 03:07When I compile the following (console application) code in U++:
#include <iostream>
#include <string>
#include <iostream>
using namespace std;
#include <Core/Core.h>
using namespace Upp;
#include <boost/algorithm/string.hpp>
CONSOLE_APP_MAIN
{
std::string str = " Lots of filler space ";
boost::algorithm::trim(str);
std::cout<<"\""<< str <<"\""<<std::endl;
}
the following error is resulting:
----- Core ( GCC DEBUG SHARED DEBUG_FULL BLITZ POSIX LINUX ) (1 / 2)
----- BoostStringTest ( MAIN GCC DEBUG SHARED DEBUG_FULL BLITZ POSIX LINUX ) (2 / 2)
BoostStringTest.cpp
In file included from /home/ptkacz/upp/uppsrc/Core/i18n.h:17:0,
from /home/ptkacz/upp/uppsrc/Core/Core.h:337,
from /home/ptkacz/MyApps/BoostStringTest/BoostStringTest.cpp:6:
/usr/include/boost/core/ref.hpp: In constructor 'boost::reference_wrapper<T>::reference_wrapper(T&)':
/home/ptkacz/upp/uppsrc/Core/t_.h:9:24: error: class 'boost::reference_wrapper<T>' does not have any field named 't_GetLngString'
#define t_(x) t_GetLngString(x)
^
BoostStringTest: 1 file(s) built in (0:01.55), 1551 msecs / file, duration = 1551 msecs
There were errors. (0:01.55)
I do know that U++ has it's only string utility functions, but was attempting to make use of code brought in from another application that I'm working on. Independently of any existing code, I wrote a simple C++ application in Code::Blocks, the code compiles and runs as expected.
Peter
Well, this looks like simple nameclash. Try
#undef t_
after #include <Core/Core.h>.
t_ is used to designate localized strings that are subject to language translation.
Maybe it does not have to be macro, then this would be solved by namespaces. Will try...
Mirek
|
|
|
|
|
Goto Forum:
Current Time: Sun Oct 13 04:03:21 CEST 2024
Total time taken to generate the page: 0.02560 seconds
|
|
|