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 » Community » Newbie corner » [SOLVED] Added my own .h file, struggling to use the String type (After moving some code into my own translation unit, I can't seem to #include <String> correctly)
[SOLVED] Added my own .h file, struggling to use the String type [message #52533] Sun, 20 October 2019 22:35 Go to next message
xrysf03 is currently offline  xrysf03
Messages: 43
Registered: November 2018
Location: CZ
Member
Dear everyone,

this looks like a noob issue...
I've created something simple in U++, using TheIDE and MinGW as a compiler. As long as I use the String type in the project's main translation unit, I'm fine.
At some point down the road, I've moved some of my code into a new .cpp file and a new .h file in the same project and directory. Trying to create a separate translation unit - a local library if you will. If I #include <String>, I'm getting "error: 'String' does not name a type" . I've tried putting "using namespace Upp;" on top of the file, I've tried qualifying the String in variable declarations as Upp::String... none of that helps (the compiler even says that the Upp namespace doesn't exist). I'm not very fluent in the namespaces and this is probably something pretty simple... Any help would be welcome.

Actually I've just found out that if I #include <Core/String.h>, I get rid of the "String undeclared" error message, but instead I get a waterfall of complaints about WChar, 'byte' and 'force_inline' etc. not being declared (messages coming from String.h). I'm puzzled... Is there some upper-level header file that I should #include in the first place?

Frank Rysanek

[Updated on: Fri, 25 October 2019 07:54]

Report message to a moderator

Re: Added my own .h file, struggling to use the String type [message #52534 is a reply to message #52533] Sun, 20 October 2019 23:46 Go to previous messageGo to next message
xrysf03 is currently offline  xrysf03
Messages: 43
Registered: November 2018
Location: CZ
Member
Okay, so I assume the sweet secret is:

#include <CtrlLib/CtrlLib.h>
using namespace Upp;


at the top of my own .H file...

Frank
Re: Added my own .h file, struggling to use the String type [message #52536 is a reply to message #52534] Mon, 21 October 2019 11:23 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hi Frank

Do not worry. Even after some years working with U++, sometimes I forget some .h.
Lots of times I do not begin with empty files, but from previous files.

Anyway, comparing with other environments, in my opinion, U++ is simple and nice with the programmer.


Best regards
IƱaki

[Updated on: Mon, 21 October 2019 11:23]

Report message to a moderator

Re: Added my own .h file, struggling to use the String type [message #52545 is a reply to message #52536] Mon, 21 October 2019 23:50 Go to previous message
xrysf03 is currently offline  xrysf03
Messages: 43
Registered: November 2018
Location: CZ
Member
@koldo: thanks for your warm, reassuring response Smile I'm a noob, I need to find my way around and about. Overall U++ feels stable and to the point, I like it. I cannot say I have enough time to play with it, but as this is a hobby project, there are no deadlines to rush me and haunt me.
Previous Topic: Questions on the editor and hotkeys. And yet.
Next Topic: [solved] U++ TheIDE integrated debugging tutorial ?
Goto Forum:
  


Current Time: Thu Apr 18 07:57:50 CEST 2024

Total time taken to generate the page: 0.01342 seconds