Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » U++ does not appear to like playing nice with the Boost algorithm string library?
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 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
ptkacz wrote on Sat, 04 April 2020 03:07
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


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
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to determine if U++ is being utilized...
Next Topic: Things we want from Linux/FreeBSD release archives
Goto Forum:
  


Current Time: Wed Aug 13 12:06:14 CEST 2025

Total time taken to generate the page: 0.07241 seconds