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 » U++ Library support » U++ Library : Other (not classified elsewhere) » How to compile a upp program in MS Visual Studio?
How to compile a upp program in MS Visual Studio? [message #7843] Thu, 25 January 2007 20:45 Go to next message
yoco is currently offline  yoco
Messages: 25
Registered: June 2006
Location: Taiwan
Promising Member
I use TheIDE to develop my upp program for 8 months.
I think TheIDE is very good.
But I'm very curious about how to compile a upp program in Visual Studio.
I'vd tried for a while, but the compiler just report 3xxx errors Laughing (OMG!!)
So.. how to compile a simple upp program in VS?

Thanks ^^

A simple upp program like this...
#include <CtrlLib/CtrlLib.h>
using namespace Upp;

struct MyAppWindow : TopWindow {
    Button button;
    void Click() { PromptOK("You have clicked the button!"); }
    typedef MyAppWindow CLASSNAME;

    MyAppWindow() {
        Title("My application with button");
        Add(button.LeftPos(10, 100).TopPos(10, 30));
        button.SetLabel("Click me!");
        button <<= THISBACK(Click);
    }
};
 
GUI_APP_MAIN
{
    MyAppWindow app;
    app.Run();
}
Re: How to compile a upp program in MS Visual Studio? [message #7845 is a reply to message #7843] Thu, 25 January 2007 21:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Search the forum, there was a discussion thread about this.

BTW, it would be nice if somebody maintained VS2005 .libs for at least major releases. Should not be so hard...

Mirek
Re: How to compile a upp program in MS Visual Studio? [message #7851 is a reply to message #7845] Fri, 26 January 2007 07:16 Go to previous messageGo to next message
yoco is currently offline  yoco
Messages: 25
Registered: June 2006
Location: Taiwan
Promising Member
Thank you, after search the forums, I found this thread.
http://www.ultimatepp.org/forum/index.php?t=msg&goto=511 7&&srch=Visual+C%2B%2B#msg_5117

But the link of this sample VS project zip file is invalid now.
Is there are other threads about this topic?
Thank you very much ^^

And, what need to do to maintain the VS2005 release?
I'd like to see what can I do for you ^_^
Re: How to compile a upp program in MS Visual Studio? [message #7873 is a reply to message #7851] Sun, 28 January 2007 07:44 Go to previous messageGo to next message
okigan is currently offline  okigan
Messages: 16
Registered: March 2006
Promising Member
I did maintain it for a bit, but it managed to get out of sync Neutral


Assuming there is a reignited interest (ok, humor me here), and I recreate the sln/vcproj -- how about checking them into the tree?

Okigan
Re: How to compile a upp program in MS Visual Studio? [message #7875 is a reply to message #7873] Sun, 28 January 2007 08:39 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I do not see much sense in keeping them in the main tree. E.g. we do not keep makefiles there as well, Bas recreates makefiles for each release.

But you could be uploading them to sf.net. Major release uploads would be enough.

It would be also nice to have .lib version...

Mirek
Re: How to compile a upp program in MS Visual Studio? [message #8042 is a reply to message #7875] Mon, 05 February 2007 18:57 Go to previous messageGo to next message
okigan is currently offline  okigan
Messages: 16
Registered: March 2006
Promising Member
Ok, I have the solution up and almost running (btw. there still
a number of files that are dead since 605 release).

I have problem with library init code which sits in the *.icpp
files (why the need for separate extention?). For example the
png/bmp lugins do not get loaded... what gives?

-okigan
Re: How to compile a upp program in MS Visual Studio? [message #8045 is a reply to message #8042] Mon, 05 February 2007 20:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
okigan wrote on Mon, 05 February 2007 12:57


I have problem with library init code which sits in the *.icpp
files (why the need for separate extention?). For example the
png/bmp lugins do not get loaded... what gives?
-okigan


Well, .icpp solved an interesting problem:

Global variables have to be constructed before program starts. This can be used to put initialization code into constructors of dymmt empty variables. So far so good.

Anyway, U++ packages are compiled into .lib files so that linker can eliminate unreferenced = unused .obj (in release mode) files. Unfortunately, files with initialization are quite often unreferenced, because it is the initialization that binds them with the rest of library (e.g. raster encoder/decoder plugins register image format). Means linker kicks them out of project.

.icpp is the solution to this poblem as it tells build system to always link in the object file.

Mirek
Re: How to compile a upp program in MS Visual Studio? [message #8050 is a reply to message #8045] Mon, 05 February 2007 21:29 Go to previous messageGo to next message
okigan is currently offline  okigan
Messages: 16
Registered: March 2006
Promising Member
Mirek,

yeah, found some message that mentions that "*.icpp files are
forced to be compiled into the project".

I see the problem (had to resolve this on a number of projects
though no perfect solution came up).

So the *.icpp through kind of a monkey wrench into configuring
of the client projects. I like the ability of VS to just
specify which projects are dependencies and it resolves linker
options automatically…


I did a bit better than adding the *.icpp files into the client
project as the dependency can be solved at the liker level: ex.
BmpReg.obj is placed into $(OutDir) and added as input for the
linker. At least this way the client does not have to know how
to compile the plugins.

Another way is to make a DLL instead of lib which will make one
rather big file instead of current method which allows linker
to cherry pick func/classes whether they are used or not.

So any input on how to make this easier to configure client
project is welcome.
Re: How to compile a upp program in MS Visual Studio? [message #8099 is a reply to message #8050] Wed, 07 February 2007 11:03 Go to previous messageGo to next message
okigan is currently offline  okigan
Messages: 16
Registered: March 2006
Promising Member
Here's VC8 sln/vcproj files for the current svn snapshot.
Just untar to top upp directory and open upp.sln.

All neatly organized in upp spirit and covers a couple of
samples to get you started...

Mirek I'd upload the libs, but they are more like 8MB
(compare to sln archive ~8KB).

-Okigan
Re: How to compile a upp program in MS Visual Studio? [message #8118 is a reply to message #8099] Sat, 10 February 2007 16:07 Go to previous messageGo to next message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
Can someone repost this file? the link is broken.
Re: How to compile a upp program in MS Visual Studio? [message #8121 is a reply to message #8118] Sun, 11 February 2007 09:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Works OK for me.

Mirek
Re: How to compile a upp program in MS Visual Studio? [message #8166 is a reply to message #8121] Tue, 13 February 2007 20:44 Go to previous message
okigan is currently offline  okigan
Messages: 16
Registered: March 2006
Promising Member
Works for me. You might be behind a proxy.
Previous Topic: Not really sure where to put this: How to compile U++ library as a DLL?
Next Topic: Excel to CVS convertion
Goto Forum:
  


Current Time: Fri Apr 19 00:53:29 CEST 2024

Total time taken to generate the page: 0.02935 seconds