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 » Developing U++ » U++ Developers corner » Quick and dirty solution to .icpp problem...
Quick and dirty solution to .icpp problem... [message #11362] Sun, 09 September 2007 23:55 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, as it seem the "I do not like theide, give me a .lib" topic has returned once again, here is the simple dirty proposal how to solve the problem:

I am willing to add to each .icpp file a dummy empty registration routine. E.g. into CtrlLib.icpp, I would insert

void InitializeCtrlLib() {}


This way, you can call this in GUI_APP_MAIN when building outside theide.


Mirek
Re: Quick and dirty solution to .icpp problem... [message #11386 is a reply to message #11362] Mon, 10 September 2007 19:44 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
luzr wrote on Sun, 09 September 2007 17:55


This way, you can call this in GUI_APP_MAIN when building outside theide.



Could you please also make copies of icpp files with cpp extensions, so, they can be compiled with MSVS without extra-troubles?


Regards,
Novo
Re: Quick and dirty solution to .icpp problem... [message #11387 is a reply to message #11386] Mon, 10 September 2007 19:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
That does not seem to be so trivial (duplicate definition)...

Would not it be possible to simply rename .icpp files as .cpp?

Alternatively, maybe supply .cpp files that #include .icpp?
Re: Quick and dirty solution to .icpp problem... [message #11388 is a reply to message #11387] Mon, 10 September 2007 19:53 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
luzr wrote on Mon, 10 September 2007 13:50


Alternatively, maybe supply .cpp files that #include .icpp?


That would be perfect.


Regards,
Novo
Re: Quick and dirty solution to .icpp problem... [message #11389 is a reply to message #11362] Mon, 10 September 2007 20:01 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
IMHO some calls like "SetSkin(ChHostSkin)" shouldn't be a part of the plugin system. You have to call them anyway. In case of database drivers it is okay to register plugins.


Regards,
Novo
Re: Quick and dirty solution to .icpp problem... [message #11647 is a reply to message #11388] Thu, 20 September 2007 14:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Mon, 10 September 2007 13:53

luzr wrote on Mon, 10 September 2007 13:50


Alternatively, maybe supply .cpp files that #include .icpp?


That would be perfect.


Well, further thinking about the issue, I think we will need flagUPP_LIB, right? Smile

Novo, I think we should start a new thread in "releases" and together with Sergei find a good way how to finally release U++ as library.

Mirek
Re: Quick and dirty solution to .icpp problem... [message #12265 is a reply to message #11386] Mon, 22 October 2007 17:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Mon, 10 September 2007 13:44

luzr wrote on Sun, 09 September 2007 17:55


This way, you can call this in GUI_APP_MAIN when building outside theide.



Could you please also make copies of icpp files with cpp extensions, so, they can be compiled with MSVS without extra-troubles?



OK, one more idea (as I am a bit lazy to do things manually :):

What about placing "init" file into all packages that just includes all .icpp?

That way, you would be in Win32 required to do:

Quote:


#include <CtrlLib/init>
#include <Core/init>



etc... which does not really look bad IMO...

Mirek
Re: Quick and dirty solution to .icpp problem... [message #12311 is a reply to message #12265] Wed, 24 October 2007 14:42 Go to previous messageGo to next message
sergei is currently offline  sergei
Messages: 94
Registered: September 2007
Member
Is there a bullet-proof way to check whether icpp was correctly included? Since I think I got it to work both in Lib and SCU.

Lib - I made a folder full of cpps, each only includes a single source file from U++ source - this makes it trivial to add all to project and build. There are also cpps that include icpps.

SCU - icpps, like cpps, are included into the package file when package is used.
Re: Quick and dirty solution to .icpp problem... [message #12312 is a reply to message #12311] Wed, 24 October 2007 15:11 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
sergei wrote on Wed, 24 October 2007 08:42

Is there a bullet-proof way to check whether icpp was correctly included?



Not really. Usually, some things just stop to work....

Mirek
Re: Quick and dirty solution to .icpp problem... [message #12398 is a reply to message #12312] Sat, 27 October 2007 18:04 Go to previous messageGo to next message
sergei is currently offline  sergei
Messages: 94
Registered: September 2007
Member
luzr wrote on Wed, 24 October 2007 15:11

sergei wrote on Wed, 24 October 2007 08:42

Is there a bullet-proof way to check whether icpp was correctly included?



Not really. Usually, some things just stop to work....

Mirek


Stumbled upon a way. Chameleon didn't work when I've built UWord using U++ in a Lib (everything ugly gray) - which most likely means icpps don't work now...

P.S. MSVC8 simply denies building U++ with /O2 (outside TheIDE). Unless I always use manual commandline with all optimization options (excluding /Og), it hangs/crashes on linkage. And with these options I have a larger EXE Confused - 1.8 MB vs 1.3MB in TheIDE + O2 vs 1.4MB in TheIDE with same options (that's even weirder - simply using a lib adds 0.4MB?).
Re: Quick and dirty solution to .icpp problem... [message #12399 is a reply to message #12398] Sat, 27 October 2007 18:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
sergei wrote on Sat, 27 October 2007 12:04

luzr wrote on Wed, 24 October 2007 15:11

sergei wrote on Wed, 24 October 2007 08:42

Is there a bullet-proof way to check whether icpp was correctly included?



Not really. Usually, some things just stop to work....

Mirek


Stumbled upon a way. Chameleon didn't work when I've built UWord using U++ in a Lib (everything ugly gray) - which most likely means icpps don't work now...



Yes.

Quote:


P.S. MSVC8 simply denies building U++ with /O2 (outside TheIDE). Unless I always use manual commandline with all optimization options (excluding /Og), it hangs/crashes on linkage. And with these options I have a larger EXE Confused - 1.8 MB vs 1.3MB in TheIDE + O2 vs 1.4MB in TheIDE with same options (that's even weirder - simply using a lib adds 0.4MB?).



With SCU?

Mirek
Re: Quick and dirty solution to .icpp problem... [message #12401 is a reply to message #12399] Sat, 27 October 2007 19:04 Go to previous messageGo to next message
sergei is currently offline  sergei
Messages: 94
Registered: September 2007
Member
luzr wrote on Sat, 27 October 2007 18:27



Quote:


P.S. MSVC8 simply denies building U++ with /O2 (outside TheIDE). Unless I always use manual commandline with all optimization options (excluding /Og), it hangs/crashes on linkage. And with these options I have a larger EXE Confused - 1.8 MB vs 1.3MB in TheIDE + O2 vs 1.4MB in TheIDE with same options (that's even weirder - simply using a lib adds 0.4MB?).



With SCU?

Mirek



No, Lib (you didn't answer my post regarding SCU so I paused it for a while). I tried different combinations (Lib with O2, program with manual, reverse, etc.), but results are the same - unless both Lib and the program that uses it are built without O2 (e.g. no optimizations at all or custom optimizations), linker either hangs (usually when using custom in the program and O2 in Lib) or crashes (when using O2 in program). Building release with custom optimizations in both works, but as I said, I get larger EXE (even larger than in TheIDE if I replace O2 with custom optimizations there).

While 0.4-0.5MB aren't that significant, that's quite annyoing since I don't see a decent reason for such increase.
Re: Quick and dirty solution to .icpp problem... [message #12402 is a reply to message #12401] Sat, 27 October 2007 19:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
sergei wrote on Sat, 27 October 2007 13:04

luzr wrote on Sat, 27 October 2007 18:27



Quote:


P.S. MSVC8 simply denies building U++ with /O2 (outside TheIDE). Unless I always use manual commandline with all optimization options (excluding /Og), it hangs/crashes on linkage. And with these options I have a larger EXE Confused - 1.8 MB vs 1.3MB in TheIDE + O2 vs 1.4MB in TheIDE with same options (that's even weirder - simply using a lib adds 0.4MB?).



With SCU?

Mirek



No, Lib (you didn't answer my post regarding SCU so I paused it for a while).



I might have lost the track... How did you got the lib?

Quote:


I tried different combinations (Lib with O2, program with manual, reverse, etc.), but results are the same - unless both Lib and the program that uses it are built without O2 (e.g. no optimizations at all or custom optimizations), linker either hangs (usually when using custom in the program and O2 in Lib) or crashes (when using O2 in program). Building release with custom optimizations in both works, but as I said, I get larger EXE (even larger than in TheIDE if I replace O2 with custom optimizations there).

While 0.4-0.5MB aren't that significant, that's quite annyoing since I don't see a decent reason for such increase.



Really strange.

Mirek
Re: Quick and dirty solution to .icpp problem... [message #12406 is a reply to message #12402] Sat, 27 October 2007 21:53 Go to previous messageGo to next message
sergei is currently offline  sergei
Messages: 94
Registered: September 2007
Member
Lib works (almost, I only now noticed icpps weren't handled well, but I can fix that). pkggen wasn't used only for SCU, it also made a folder like the one attached. Add all files in the folder to a project (not a difficult task with most IDEs - select all and add to project), then build - voila, a Lib. Of course, you first have to add uppsrc to include folders, add winmm.lib mpr.lib etc. to linker, and then:
MSVC - replace O2 with commandline optimization in release
MinGW - add Core/Core.h as precompiled header
About 2 minutes work, then hit build - around 15 mins. debug + release in MSVC.

Strange thing is the MS linker bug, since AFAIK only some package combinations trigger it (I think without RichEdit it might've worked for UWord). But I don't feel like investigating MS bugs now.
  • Attachment: UppLib.zip
    (Size: 41.60KB, Downloaded 301 times)
Re: Quick and dirty solution to .icpp problem... [message #12410 is a reply to message #12406] Sun, 28 October 2007 02:55 Go to previous messageGo to next message
sergei is currently offline  sergei
Messages: 94
Registered: September 2007
Member
Update: fixed icpps, Chameleon works, size went up - 2.0MB, got no clue why...

I'm attaching what I'm using, and a demo (UWord) project, maybe someone could guess what's up with the EXE size.

Instructions (MSVC):
0) Extract files into uppsrc folder, and add it to compiler's include path.
1) Create an empty lib project.
2) Add all files in UppLib folder to project (VS UI might become unresponsive for a while, just wait).
3) Change code generation to multi-threaded debug in debug, multi-threaded in release.
4) In release, set optimizations to custom, and add to compiler command line: /GS- /Ob2 /Gs /GF /Gy /Oi /Ot /Oy
5) Build library and copy to MSVC's lib directory.
6) Create a Win32 empty GUI project for UWord.
7) Add UWord.cpp, UppBase.cpp, UppBase.h from UWord folder to project.
8) Repeat 3 and 4 for this project.
9) Add winmm.lib mpr.lib to linker, and also debug and release libs to debug and release respectively.
10) Build, examine EXE size and program functionality.

  • Attachment: ULib.zip
    (Size: 71.73KB, Downloaded 323 times)
Re: Quick and dirty solution to .icpp problem... [message #12644 is a reply to message #12410] Mon, 12 November 2007 07:15 Go to previous messageGo to next message
okigan is currently offline  okigan
Messages: 16
Registered: March 2006
Promising Member
bump
Re: Quick and dirty solution to .icpp problem... [message #12647 is a reply to message #12410] Mon, 12 November 2007 10:08 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
sergei wrote on Sat, 27 October 2007 21:55

Update: fixed icpps, Chameleon works, size went up - 2.0MB, got no clue why...

I'm attaching what I'm using, and a demo (UWord) project, maybe someone could guess what's up with the EXE size.

Instructions (MSVC):
0) Extract files into uppsrc folder, and add it to compiler's include path.
1) Create an empty lib project.
2) Add all files in UppLib folder to project (VS UI might become unresponsive for a while, just wait).
3) Change code generation to multi-threaded debug in debug, multi-threaded in release.
4) In release, set optimizations to custom, and add to compiler command line: /GS- /Ob2 /Gs /GF /Gy /Oi /Ot /Oy
5) Build library and copy to MSVC's lib directory.
6) Create a Win32 empty GUI project for UWord.
7) Add UWord.cpp, UppBase.cpp, UppBase.h from UWord folder to project.
Cool Repeat 3 and 4 for this project.
9) Add winmm.lib mpr.lib to linker, and also debug and release libs to debug and release respectively.
10) Build, examine EXE size and program functionality.




Thanks.

Mirek
Previous Topic: Core chat... (reference counted pointers etc.)
Next Topic: SVN plan...
Goto Forum:
  


Current Time: Sun Apr 28 00:49:23 CEST 2024

Total time taken to generate the page: 0.03049 seconds