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++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Project questions...
Project questions... [message #451] Wed, 04 January 2006 00:06 Go to next message
ChrisSE is currently offline  ChrisSE
Messages: 5
Registered: January 2006
Promising Member
1. Where can I set preprocessor symbols?

2. Where can I set libraries to link with?

3. Is there a clear way to CLOSE the current package? I also find it frustrating that there is no File -> New option.

4. Are there templates available for creating a Win32 DLL or static library? DevC++ has a really nice interface for creating new projects. I wish Ultimate++ had this interface.

Thanks,
Chris
Re: Project questions... [message #452 is a reply to message #451] Wed, 04 January 2006 05:30 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
ChrisSE wrote on Tue, 03 January 2006 18:06

1. Where can I set preprocessor symbols?

2. Where can I set libraries to link with?

3. Is there a clear way to CLOSE the current package? I also find it frustrating that there is no File -> New option.

4. Are there templates available for creating a Win32 DLL or static library? DevC++ has a really nice interface for creating new projects. I wish Ultimate++ had this interface.

Thanks,
Chris


AFAIK,

1,2 Options for compiler, linker etc. you can set in
"Package Organizer"
accessing:
a)submenu from Project or
b) the 2'nd icon to the right from "Build mode" drop list.
then
after selecting your required files set your flags/options

For examples explore different existing packages.

3. If you start to work with a new existing package ("Set Main Package" from "File" menu), Ultimate++ removes the previous package from its "compiling scope".
And you can close all the files

except one active (I usually select one from a newly opened package to close the rest)

with Ctrl-Shift-U (or "Close all file tabs" from "File" menu)

My tip: I open several instances of Ultimate++ if I need samples (to use Ultimate++ as file viewer).

regarding New (File). At the begining it was unusual for me too...
But after some time I even forgot about it. In Ultimate++ you need less files in your projects and you can use other already existing packages as ready "bricks". I'd say it teaches more block-structural thinking than tree-of-files-and-classes. It's a bit unusual to change some programming habits.
But in the nearest future, I expect, the interface becomes even much more better. Smile

4. About templates I expect the other guys can tell more...

Just one remark that, IMHO, Code::Blocks has much better interface than Dev++.



[Updated on: Wed, 04 January 2006 07:56]

Report message to a moderator

Re: Project questions... [message #453 is a reply to message #451] Wed, 04 January 2006 05:31 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member

Quote:

1. Where can I set preprocessor symbols?



There are two ways, apart from in source files.

Firstly you should download the zip files I posted yesterday in the documentation section of this forum, regarding packages and assemblies and read the two pdfs which explain how to use packages and what build configurations and build flags are.

You can either use a build flag name that you add to a build configuration, or you can add /D (or -D for GCC) options in the package organizer "compiler options".
The difference between these two ways is that using a build flag will
1. prefix the build flag with "flag" e.g. a name of DEBUG becomes flagDEBUG as a #defined name you can use in source code
2. Using a build flag means the name becomes part of the folder name where the target executable will be located - useful for identifying how the .exe was built and saves having to copy the .exe before rebuilding if you want to keep multiple exe's of different build types.

You can mix the two methods so that a build flag is used to select a particular set of compiler options - you enter the build flag name in the "When" column in the package organizer.

If you use build flags you might want to make them "dotted" (precede the name with a dot character (.) in the build configurations (main package configurations) dialog) so that they don't propagate to all dependent packages and create large number of different intermediate files.


Quote:

2. Where can I set libraries to link with?


In the package organizer. Try the template below and see what the package organizer shows, or else open an existing package such as HelloWorld example, then bring up the package organizer and select the CtrlCore package. You will see it adds comctl32 libs etc for WIN32 build.

Quote:

3. Is there a clear way to CLOSE the current package? I also find it frustrating that there is no File -> New option.



No. TheIDE requires you to always have a package open - it's called the "main package". TheIDE requires a package and assembly always "open". If you want to use it just as an editor you could create a "dummy" assembly called e.g. WorkSpaces and a package called WKSP1 or something - you could use that package to "remember" a set of files if you wanted, even though you never build the package.

You don't really need to close a package.

The "set main package" option on the file menu brings up a dialog that allows you to create a new package or assembly. This same dialog allows you to select a "package template" when creating a new package - the same functionality as DEVCPP or Visual Studio, but U++ allows you to create your own project templates as well (see below).

Quote:

4. Are there templates available for creating a Win32 DLL or static library? DevC++ has a really nice interface for creating new projects. I wish Ultimate++ had this interface.



Yep. In the "select main package" dialog mentioned above. There isn't one for a DLL yet but I've had a stab at creating one below. Copy the code into Win32Dll.upt file in the root U++ installation directory and you should see a new dll option in the list of project templates in the select main package dialog.

It might not be quite right - e.g. it might need a /MT option for the compiler.

I've never created one of these before - I just inspected the existing .upt files I could find in upp directory and compared them with what you see in the select main package dialog.
A line that starts with "option" becomes a checkbox in the select main package dialog. A line that starts with @@ creates a new file. <:?mt:> tests for whether the Multithreaded checkbox is checked.

Graeme




template "Win32 DLL project (no U++)" main;

option "Multithreaded" mt;



@@<:PACKAGE:>.h
#ifndef guard_<:PACKAGE:>_<:PACKAGE:>_h
#define guard_<:PACKAGE:>_<:PACKAGE:>_h

#define DllImport extern "C" __declspec( dllimport )
#define DllExport extern "C" __declspec( dllexport )

//#if BUILDING_DLL
//# define DLLIMPORT __declspec (dllexport)
//#else /* Not BUILDING_DLL */
//# define DLLIMPORT __declspec (dllimport)
//#endif /* Not BUILDING_DLL */


#endif
// guard_<:PACKAGE:>_<:PACKAGE:>_h

@@<:PACKAGE:>.cpp
#include <windows.h>
#include "<:PACKAGE:>.h"

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    return TRUE;
}


@@<:PACKAGE:>.upp
library(WIN32) "kernel32 user32 advapi32 shell32 winmm";

target(!NEVER) "<:PACKAGE:>.dll";

link(!GCC) "/DLL";

file
	<:PACKAGE:>.h,
	<:PACKAGE:>.cpp;

mainconfig
	"" = "MSC71 <:?mt:>MT<:.:>";

Re: Project questions... [message #454 is a reply to message #453] Wed, 04 January 2006 05:37 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
I was 1 min faster Smile
Re: Project questions... [message #455 is a reply to message #454] Wed, 04 January 2006 05:42 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
Quote:

I was 1 min faster Smile



I had a lot of typing to do Smile

BTW if that 2MB pdf I posted is a nuisance, it can probably be deleted in a few days e.g. hopefully the next snapshot will have the new info linked from the help index page.

Graeme
Re: Project questions... [message #457 is a reply to message #455] Wed, 04 January 2006 07:50 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
gprentice wrote on Tue, 03 January 2006 23:42



BTW if that 2MB pdf I posted is a nuisance, it can probably be deleted in a few days e.g. hopefully the next snapshot will have the new info linked from the help index page.

Graeme



don't worry for now. Unless you are going to put another 100 or I will have some free time... Smile

Arijus
Re: Project questions... [message #462 is a reply to message #451] Wed, 04 January 2006 10:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
ChrisSE wrote on Tue, 03 January 2006 18:06


4. Are there templates available for creating a Win32 DLL or static library? DevC++ has a really nice interface for creating new projects. I wish Ultimate++ had this interface.



Just checked DevC++ templates. Well, it is true that DLL template is now missing in the U++ (something to fix - anybody willing to contribute it?).

However, as for template system itself, TheIDE's does not look as good (no nice icons Smile, but is way more powerful - it allows you to set various options when creating project and shows you files it is going create (based on actual options).

Or is there something about DevC++ templates I am missing?

Mirek
Re: Project questions... [message #463 is a reply to message #462] Wed, 04 January 2006 11:11 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Ok, here goes DLL template....

Put it to the directory where your "theide.exe" is.

I have just tested that it compiles, but did not tested .dll file. Please, report whether this works as expected....

Mirek
  • Attachment: Win32dll.upt
    (Size: 0.83KB, Downloaded 1704 times)
Re: Project questions... [message #475 is a reply to message #451] Wed, 04 January 2006 16:45 Go to previous messageGo to next message
ChrisSE is currently offline  ChrisSE
Messages: 5
Registered: January 2006
Promising Member
Thanks for the thorough responses!

I think I missed the compiler options, since they are in a tabular format, with "When" as the first column.

Can someone give me an example of what I would enter for "When"?

Let's say I want to add a library named "libutil.a".
What would I add for "When" and "Additional libraries"?
(? -lutil)

I tried adding "-lutil" and expected an error since this library does not exist, but I didn't get an error.

Are there examples in any documentation?

Thanks,
Chris
Re: Project questions... [message #476 is a reply to message #463] Wed, 04 January 2006 16:53 Go to previous messageGo to next message
ChrisSE is currently offline  ChrisSE
Messages: 5
Registered: January 2006
Promising Member
luzr wrote on Wed, 04 January 2006 05:11

Ok, here goes DLL template....

Put it to the directory where your "theide.exe" is.

I have just tested that it compiles, but did not tested .dll file. Please, report whether this works as expected....

Mirek



Thanks Mirek. I saved the .upt file and I can create a project from it. I will have to test it later, but it looks great!

Thanks,
Chris
Re: Project questions... [message #477 is a reply to message #475] Wed, 04 January 2006 17:47 Go to previous messageGo to next message
ChrisSE is currently offline  ChrisSE
Messages: 5
Registered: January 2006
Promising Member
ChrisSE wrote on Wed, 04 January 2006 10:45

Thanks for the thorough responses!

I think I missed the compiler options, since they are in a tabular format, with "When" as the first column.

Can someone give me an example of what I would enter for "When"?

Let's say I want to add a library named "libutil.a".
What would I add for "When" and "Additional libraries"?
(? -lutil)

I tried adding "-lutil" and expected an error since this library does not exist, but I didn't get an error.

Are there examples in any documentation?

Thanks,
Chris


Ok, I see example with CtrlCore, where When is WIN32 or LINUX, so this setting appears to control the target platform. And the libraries are simply listed (e.g. advapi32 comdlg32 comctl32).

Chris
Re: Project questions... [message #479 is a reply to message #475] Wed, 04 January 2006 17:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
ChrisSE wrote on Wed, 04 January 2006 10:45


Can someone give me an example of what I would enter for "When"?

Let's say I want to add a library named "libutil.a".
What would I add for "When" and "Additional libraries"?
(? -lutil)



Well, "when" makes project compile with different platform / compiler.

E.g. in you case:

When: "GCC LINUX"
Additional library: "util"

Actually, for library, you can use "libutil.a" as well - GCC builder undestands both Smile

Mirek
Re: Project questions... [message #481 is a reply to message #479] Wed, 04 January 2006 18:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
...the set of build flags provided by TheIDE is here:

http://upp.sourceforge.net/app$ide$Flags$en-us.html
Re: Project questions... [message #9500 is a reply to message #453] Sat, 12 May 2007 14:56 Go to previous message
waxblood is currently offline  waxblood
Messages: 95
Registered: January 2007
Member
gprentice
Quote:


You can either use a build flag name that you add to a build configuration, or you can add /D (or -D for GCC) options in the package organizer "compiler options" .




I don't understand well the Add/remove flags option in Package Manager - it appears to be not documented in http://www.ultimatepp.org/app$ide$ConfiguringPackagesAssembl ies$en-us.html , Package build settings .

Is it used to feed symbols to preprocessor? Or I have to do as underlined above? I've made some tries, but it seems nothing is passed to the program. In fact I don't know even what to do to remove flags.

If it works as in the underlined text, I think anyway it would be more clear to allow the user to add a row like "Preprocessor symbol(s)" in Package Manager, this way it could be compiler-independent, too. At present I had to search this page to understand a little the difference between build flags (with 'flag' prefix) and 'normal' preprocessor symbols.


Ciao,
David

[Updated on: Sat, 12 May 2007 15:33]

Report message to a moderator

Previous Topic: Compile Error with Upp 705 Dev1
Next Topic: App dosn't start anymore
Goto Forum:
  


Current Time: Thu Apr 25 20:58:11 CEST 2024

Total time taken to generate the page: 0.05640 seconds