Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8544679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:37:07+00:00 2026-06-11T12:37:07+00:00

I am pretty new to C++, and I am having an error with the

  • 0

I am pretty new to C++, and I am having an error with the CL_String8 function in ClanLib.

When I try to compile:

CL_String now() {
    CL_DateTime now = CL_DateTime::get_current_local_time();
    return CL_String8(now.get_hour()) + " " + CL_String8(now.get_minutes()) + " " + CL_String8(now.get_seconds());
}

I get this error (repeated 3 times):

src/utils.cpp: In function ‘CL_String now()’:
src/utils.cpp:15:34: error: call of overloaded ‘CL_String8(unsigned char)’ is ambiguous
src/utils.cpp:15:34: note: candidates are:
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:74:2: note: CL_String8::CL_String8(const wchar_t*) <near match>
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:74:2: note:   no known conversion for argument 1 from ‘unsigned char’ to ‘const wchar_t*’
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:63:2: note: CL_String8::CL_String8(const char*) <near match>
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:63:2: note:   no known conversion for argument 1 from ‘unsigned char’ to ‘const char*’
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:55:2: note: CL_String8::CL_String8(const CL_String8&) <near match>
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:55:2: note:   no known conversion for argument 1 from ‘unsigned char’ to ‘const CL_String8&’
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:50:2: note: CL_String8::CL_String8(const string&) <near match>
/usr/include/ClanLib-2.3/ClanLib/Core/Text/string8.h:50:2: note:   no known conversion for argument 1 from ‘unsigned char’ to ‘const string& {aka const std::basic_string<char>&}’

How can I define which one of the functions I want to use?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:37:08+00:00Added an answer on June 11, 2026 at 12:37 pm

    ClanLib has a formatting function you can use to avoid low-level C formatting code:

    CL_DateTime now = CL_DateTime::get_current_local_time();
    return cl_format("%1 %2 %3", now.get_hour(), now.get_minutes(), now.get_seconds());
    

    cl_format accepts most basic types automatically.

    Secondly, CL_DateTime has a to_long_time_string() that returns the time as hh:mm:ss, so you could use that unless you need your specific formatting:

    return now.to_long_time_string();
    

    Third, there is no need to use CL_String8 directly. Depending on unicode compilation settings CL_String will either use CL_String8 or CL_String16 internally. CL_String8 is not something you need to use explicitly in your code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im pretty new in grails.. im having a little problem right now on validation
I'm pretty new to c++ and I'm having a problem debugging a linker error.
I'm pretty new to JavaScript and I'm having trouble with some of the properties
I'm pretty new to python (couple weeks into it) and I'm having some trouble
I'm pretty new to the Android scene and I'm having troubles creating an UI
I'm pretty new to Backbone and Marionette and am having a tough time getting
I am pretty new to both Dreamweaver and Coldfusion, and I am having a
I'm pretty new to FPGA and Verilog, but I'm having a problem getting my
Iv'e pretty new to C# ATM and I seem to be having trouble with
Please excuse me as I'm pretty new to using .htaccess, and am having a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.