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]Deleted layout controls still cause errors in compile. How? 8183 MinGW (Strange problems building a CodeProject U++ tutorial, MingW & Windows)
[SOLVED]Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44280] Thu, 19 February 2015 17:20 Go to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Maybe this is because I'm new to U++, but I have successfully built & compiled numerous GUI example projects, and simple ones I created.

Using this tutorial http:// www.codeproject.com/Articles/15163/Getting-Started-With-Ulti mate?msg=5005237 I initially created the project as instructed (named SimpleDemo),(with layout controls only) with no compile/build errors. But after adding the full specified code things blew up.

The big problem is, after I deleted all new controls from the layout and code to backtrack, the compiler continued to list the controls and numerous errors.
Could this be a settings issue? Should I be able to delete objects? Then I ran the full original complete project package as downloaded and it too had endless errors.

U++ then uninstalled & re-installed, all examples compile & build perfect again.

I must also say, I can be compiling included examples such as Days or HomeBudget and executing perfectly, but after I try to compile the SimpleDemo example, it breaks U++ build. U++ then will Not build/compile any of the included examples without immediate Errors again, no files created.

Compile report attached.
Any advice appreciated.



  • Attachment: errorsGUI.txt
    (Size: 13.32KB, Downloaded 253 times)


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...

[Updated on: Sat, 21 February 2015 17:56]

Report message to a moderator

Re: Deleted layout controls still cause errors in compile. How? [message #44283 is a reply to message #44280] Fri, 20 February 2015 08:25 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Edward

Welcome to the Forum.

If possible please zip and upload a simple sample with all files (full package folder) to help you better. I think you have different problems.

Best regards
Koldo


Best regards
Iñaki
Re: Deleted layout controls still cause errors in compile. How? 8183 [message #44285 is a reply to message #44280] Fri, 20 February 2015 15:28 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Please find project folder attached for the SimpleDemo.

(this demo redefined the term "killer app" for me this week.)



My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...
Re: Deleted layout controls still cause errors in compile. How? 8183 [message #44287 is a reply to message #44285] Fri, 20 February 2015 18:02 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Edward,

Your problem is easy to solve Wink You will need to use "namespace Upp".

SimplyDemo.h:
#ifndef _SimpleDemo_SimpleDemo_h
#define _SimpleDemo_SimpleDemo_h

#include <CtrlLib/CtrlLib.h>

NAMESPACE_UPP // <- Remember to start "namespacing" ;) before LAYOUTFILE

#define LAYOUTFILE <SimpleDemo/SimpleDemo.lay>
#include <CtrlCore/lay.h>

class SimpleDemo : public WithSimpleDemoLayout<TopWindow> {
	void AddItem();
public:
	typedef SimpleDemo CLASSNAME;
	SimpleDemo();
};

END_UPP_NAMESPACE

#endif


Comment: Remember not to use "using namespace Upp" in your header file. Macro NAMESPACE_UPP equals "namespace Upp {" and "END_UPP_NAMESPACE" equals "}".

SimplyDemo.cpp:
#include "SimpleDemo.h"

using namespace Upp; // <- We want to use Upp components.

SimpleDemo::SimpleDemo()
{
	CtrlLayout(*this, "Shopping List");
	Sizeable().Zoomable();
	arrList.AddColumn("Item");	// Add a column titled "Item"
	arrList.Removing();			// Gives us a right-click menu to delete rows
	btnAdd <<= THISBACK(AddItem);	// Uses a callback to link the button to the function
}

void SimpleDemo::AddItem()
{
	arrList.Add(~strItem);	// The ~ operator calls the object's GetData() function
	strItem <<= Null;		// Manually clear the item
}

GUI_APP_MAIN
{
	SimpleDemo().Run();
}


Here you will need to use "using namespace Upp", because you are using Upp components here. Event "GUI_APP_MAIN" macro is in Upp namespace.

Sincerely,
Klugier
Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44289 is a reply to message #44280] Fri, 20 February 2015 18:13 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Klugier

Did you load and test the SimpleDemo package?

I corrected the using namespace Upp;
Still not building here.
See the Build report attached.


  • Attachment: SD_build.txt
    (Size: 31.12KB, Downloaded 344 times)


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...

[Updated on: Fri, 20 February 2015 18:59]

Report message to a moderator

Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44290 is a reply to message #44289] Fri, 20 February 2015 18:38 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Edward,

For me it clearly compile. I use Kubuntu 14.04 with GCC.

Quote:

C:\upp\uppsrc\firstGUI\main.cpp: In function 'void GuiMainFn_()':
C:\upp\uppsrc\firstGUI\main.cpp:10:16: error: 'class firstGUI' has no member named 'Run'
firstGUI().Run();

I do not see "firstGUI" class in your project? Did you put "using namespace Upp;" in your .cpp file?

In main function you have something like that:
GUI_APP_MAIN
{
	SimpleDemo().Run();
}


P.S.
I have uploaded fixed package.

Sincerely,
Klugier
Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44291 is a reply to message #44280] Fri, 20 February 2015 19:38 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Quote:
I do not see "firstGUI" class in your project? Did you put "using namespace Upp;" in your .cpp file?

Yes. See lower.

Klugier

I am testing build on your updated project.

For some reason my Builds are taking over 30 minutes time.
They were much faster previously.

Please check back to this message for updates.
-----------------
Results
"Fatal error: SimpleDemo/SimpleDemo.lay: No such file or directory"

Build message results attached.


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...

[Updated on: Fri, 20 February 2015 19:56]

Report message to a moderator

Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44292 is a reply to message #44291] Fri, 20 February 2015 21:22 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Edward,

It is hard to say what is wrong. For me the code of this package seems to be OK. On my OS (Kubuntu 14.04 - GNU/Linux - GCC 4.8 ) it compiles perfectly. So, semantic is definitely OK.

Quote:

For some reason my Builds are taking over 30 minutes time.
They were much faster previously.

Yes, because it compiles all U++ packages. Previously you had only errors (Compilation process was not started).

Maybe it is compiler related problem. Did you try to use TheIDE with Visual Studio? Don't take my wrong I have never used GCC or MinGW with U++ on Windows. So I am definitely not expert in this area. Maybe someone else will know.

At the end I would like to enclose my version (which is probably the same as previous). You can also try "Rebuild all" options (Bomb on toolbar).

Sincerely,
Klugier

[Updated on: Fri, 20 February 2015 21:36]

Report message to a moderator

Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44293 is a reply to message #44292] Fri, 20 February 2015 22:24 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Edward

I have tested Klugier last package and it seems perfect. I have tested in Windows 7, VS2010 without problems.


Best regards
Iñaki
Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44294 is a reply to message #44280] Fri, 20 February 2015 22:43 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
So the problem may be with the MinGW I'm using?

This really worries me, it seems to be a rare anomaly. Hopefully someone (or a U++ developer) using Windows will MingW with U++ respond.

I will be more than happy to make a funding donation if I can get these issues resolved, and know U++ is reliable. I'm trying to avoid Microsoft VS products because will be moving to Linux with UU+. My application will reside on Linux box later then too.

I must get to work ASAP on converting a 2002 VB6 healthcare application to C++.


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...

[Updated on: Sat, 21 February 2015 00:34]

Report message to a moderator

Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44295 is a reply to message #44294] Fri, 20 February 2015 23:41 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Edward

Your package compiles and runs without problems with MinGW 4.9.

What MinGW version are you using?


Best regards
Iñaki
Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44296 is a reply to message #44280] Sat, 21 February 2015 00:41 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Are you using MinGW 4.9 on Windows?

MinGW Version,
Looking at the MinGW Installation Manager, looks like I have mingw32-gcc 4.8.1-4, mingw32-gcc-g++ 4.8.1-4, & mingw32-gdb 7.6.1-1.


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...

[Updated on: Sat, 21 February 2015 00:49]

Report message to a moderator

Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44297 is a reply to message #44296] Sat, 21 February 2015 00:51 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Edward

After reading your compiler output maybe the problem is much simpler.

In file included from C:\MyApps\newSimpleDemo\SimpleDemo\SimpleDemo.h:9:0,
                 from C:\MyApps\newSimpleDemo\SimpleDemo\main.cpp:1:
C:\upp\uppsrc/CtrlCore/lay.h:8:20: fatal error: SimpleDemo/SimpleDemo.lay: No such file or directory


Maybe in SimpleDemo.h you would have to add "newSimpleDemo" in #define:

#define LAYOUTFILE <newSimpleDemo/SimpleDemo/SimpleDemo.lay>



Best regards
Iñaki
Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44298 is a reply to message #44280] Sat, 21 February 2015 01:19 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
The LAYOUT file is already defined in SimpleDemo.h.
Line 6.

Adding it again caused a duplicate declaration error.


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...
Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44299 is a reply to message #44298] Sat, 21 February 2015 01:27 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

It seems that Koldo is right. It should look like this (in your case, I don't know why you created this directory):

SimplyDemo.h
#ifndef _SimpleDemo_SimpleDemo_h
#define _SimpleDemo_SimpleDemo_h

#include <CtrlLib/CtrlLib.h>

NAMESPACE_UPP

#define LAYOUTFILE <newSimpleDemo/SimpleDemo/SimpleDemo.lay>
#include <CtrlCore/lay.h>

class SimpleDemo : public WithSimpleDemoLayout<TopWindow> {
	void AddItem();
public:
	typedef SimpleDemo CLASSNAME;
	SimpleDemo();
};

END_UPP_NAMESPACE

#endif



Council for the future. You shouldn't put two directories in your project tree. It can led to problems.

So the tree should look like this:
- MyApps
    - SimplyDemo
        - SimpleDemo.h
        - etc.


Insted of:
- MyApps
    - SimplyDemo
        - newSimpleDemo
           - SimpleDemo.h
           - etc.


Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Sat, 21 February 2015 01:27]

Report message to a moderator

Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44300 is a reply to message #44280] Sat, 21 February 2015 01:44 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Using new: #define LAYOUTFILE <newSimpleDemo/SimpleDemo/SimpleDemo.lay> from above,
Produced the following error.

----- SimpleDemo ( GUI MAIN GCC DEBUG DEBUG_FULL WIN32 ) (9 / 9)
main.cpp
In file included from C:\upp\examples\SimpleDemo\SimpleDemo.h:7:0,
from C:\upp\examples\SimpleDemo\main.cpp:1:
C:\upp\uppsrc/CtrlCore/lay.h:8:20: fatal error: newSimpleDemo/SimpleDemo/SimpleDemo.lay: No such file or directory
#include LAYOUTFILE
^
compilation terminated.
SimpleDemo: 1 file(s) built in (0:01.96), 1968 msecs / file, duration = 2063 msecs

There were errors. (0:06.21)
--------------
Using the original produced the below error:

----- plugin/png ( GUI GCC DEBUG DEBUG_FULL WIN32 ) (8 / 9)
----- SimpleDemo ( GUI MAIN GCC DEBUG DEBUG_FULL WIN32 ) (9 / 9)
main.cpp
In file included from C:\upp\examples\SimpleDemo\SimpleDemo.h:7:0,
from C:\upp\examples\SimpleDemo\main.cpp:1:
C:\upp\uppsrc/CtrlCore/lay.h:8:20: fatal error: SimpleDemo/SimpleDemo/SimpleDemo.lay: No such file or directory
#include LAYOUTFILE
^
compilation terminated.
SimpleDemo: 1 file(s) built in (0:02.09), 2094 msecs / file, duration = 2157 msecs

There were errors. (0:04.35)



My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...
Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44302 is a reply to message #44300] Sat, 21 February 2015 09:28 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Edward

Please in SimplyDemo.h just change

#define LAYOUTFILE <newSimpleDemo/SimpleDemo/SimpleDemo.lay>


with

#define LAYOUTFILE "C:/upp/examples/SimpleDemo/SimpleDemo.lay"


Best regards
Iñaki
Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44306 is a reply to message #44280] Sat, 21 February 2015 17:56 Go to previous messageGo to next message
Edward is currently offline  Edward
Messages: 34
Registered: February 2015
Location: United States
Member
Solved!!!

See my post @:
http://www.ultimatepp.org/forums/index.php?t=msg&goto=44 301&#msg_44301

I began keying in suspected code line by one and building after each.
Syntax examples in the HomeBudget example helped.

Thanks koldo, klugier.

Latest project folder attached.


My mission is to find a powerful(Non MS) C++ IDE w/GUI to marry and spend the rest of my life with...

[Updated on: Sat, 21 February 2015 18:00]

Report message to a moderator

Re: Deleted layout controls still cause errors in compile. How? 8183 MinGW [message #44314 is a reply to message #44306] Sat, 21 February 2015 23:03 Go to previous message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Smile

Best regards
Iñaki
Previous Topic: [SOLVED]Control property syntax (ArrayCtrl, Button), IDE syntax guide unclear to me
Next Topic: No forward declaration.
Goto Forum:
  


Current Time: Fri Apr 19 18:53:33 CEST 2024

Total time taken to generate the page: 0.14254 seconds