|
|
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Project questions...
Project questions... [message #451] |
Wed, 04 January 2006 00:06 |
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 |
|
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.
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 |
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 #9500 is a reply to message #453] |
Sat, 12 May 2007 14:56 |
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
|
|
|
Goto Forum:
Current Time: Thu Apr 25 20:58:11 CEST 2024
Total time taken to generate the page: 0.05640 seconds
|
|
|