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 » using namespace Upp; causes errors
using namespace Upp; causes errors [message #37413] Mon, 01 October 2012 22:26 Go to next message
Mircode is currently offline  Mircode
Messages: 17
Registered: September 2012
Promising Member
Hi!

Actually I only want to create labeled buttons with a custom background color. The only way to this seems to be chameleon, though I do not know whether this is something I have to install or just the example files that can be found here:

http://ultimatepp.org/redmine/projects/upp/repository/show/t ags/n-2011-15/reference/Chameleon

I downloaded and tried to compile, getting a load of errors. The first few being:

C:\eigene dateien\c-gefrickel\chameleon\main.cpp:3: error: expected namespace-name before ';' token
C:\eigene dateien\c-gefrickel\chameleon\main.cpp:3: error: `<type error>' is not a namespace

Also the simple helloworld project yields the same:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

GUI_APP_MAIN {
    PromptOK("Hello world");
}


Am I missing something here? Where is this Upp namespace supposed to be defined? (I ran a windows search for files containing "namespace Upp" in the uppsrc folder and found nothing)(I am using windows, by the way).

Thanks in advance!

Greetings,
Mirko
Re: using namespace Upp; causes errors [message #37414 is a reply to message #37413] Mon, 01 October 2012 22:36 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
In your main .cpp file under your #includes and any other namespace/s

using namespace std;
using namespace Upp;

Look at any of the examples, AFAIK they all have:
using namespace Upp;

Look through the examples as there might be one that does something similar to what your trying to do.

Look at the code for /reference/Chameleon to see what it has.

Do a search in the forum.
A google search "Upp buttons" might bring something up also.

[Updated on: Mon, 01 October 2012 22:46]

Report message to a moderator

Re: using namespace Upp; causes errors [message #37415 is a reply to message #37413] Mon, 01 October 2012 22:39 Go to previous messageGo to next message
Mircode is currently offline  Mircode
Messages: 17
Registered: September 2012
Promising Member
This is where the namespace has to be used. I wanted to know where it is defined.

I think that this http://www.ultimatepp.org/forum/index.php?t=msg&goto=722 5& means that my version of U++ is a little outdated and has no namespace Upp yet. Thats because I followed this tutorial: http://www.codeproject.com/Articles/15163/Getting-Started-Wi th-Ultimate

I will update and test again.
Re: using namespace Upp; causes errors [message #37416 is a reply to message #37413] Mon, 01 October 2012 22:52 Go to previous messageGo to next message
Mircode is currently offline  Mircode
Messages: 17
Registered: September 2012
Promising Member
Works now. Smile
Re: using namespace Upp; causes errors [message #37417 is a reply to message #37413] Tue, 02 October 2012 07:09 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Mirko,

I believe that the one and only problem you had was that you installed only the Chameleon example, but not the other folders (judging by the paths). For U++ to work you have to have all the nests available (i.e. for reference examples the reference and uppsrc folders) or at least all used packages.

Best regards,
Honza
Previous Topic: HOW TO DETECT TROJANS IN U++ [FEATURE REQUEST]
Next Topic: Field for misc. control information?
Goto Forum:
  


Current Time: Thu Mar 28 16:49:14 CET 2024

Total time taken to generate the page: 0.03666 seconds