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 » Cannot Compile TheIDE with MSVC12
Re: Cannot Compile TheIDE with MSVC12 [message #44220 is a reply to message #44215] Wed, 28 January 2015 20:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Silvan wrote on Tue, 27 January 2015 10:15
mirek wrote on Mon, 26 January 2015 15:09
Silvan wrote on Sun, 25 January 2015 18:49
No aid about Intel compiler, and I did not find any solution.
Well that is not really important,so I bypass this for now and start with the second point:
try to compile theIDE under VC2008.



Have you tried 'recommended' path?

http://www.ultimatepp.org/app$ide$install$en-us.html

Mirek


Well,
the directory structure of the MSVC compiler and Intel compiler is different from that 'recommended'.
That does not do any problem to che MSVC compiler and I suppose that also che Intel compiler is not
affected by this, becouse there is no error about things not found.
When I try to compile TheIDE the first error is that:


'recommended' is to download Win7 SDK and let TheIDE autosetup everything. See the link above.

We are supporting later SDKs and are able to use compilers provided with Visual Studio, but that is sometimes quirky.
Re: Cannot Compile TheIDE with MSVC12 [message #44221 is a reply to message #44216] Wed, 28 January 2015 20:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Silvan wrote on Tue, 27 January 2015 11:42
What are icpp files?


Well, but now you have a new project, using U++ with Visual Studio, are you? Smile

OK. Well, the .icpp is a problem there, one that init files are trying to solve.

The idea is this: We want some code to be 'autoregistered'. E.g. Draw module contains general interface for loading raster graphics. Then we have a module that loads particular image format, say 'tiff'. Now we want, when we add this module to the project, to get registered with Draw module, so that we can use "LoadImageDetectFormat" sort of function. And we want that to happen without calling some "RegisterTiffWithDraw" in main, we want to happend that automagically.

To that end, we are using global constructors (actually, we have a nice macros INIT_BLOCK/EXIT_BLOCKS that create a piece of code that gets run at the start and at the end of code. Those macros are implemented using C++ global constructors/destructors). But here comes the problem: All this only works when object file is linked into final .exe. And when we are building .lib, linker excludes object files that are not referenced from the rest of code. Unfortunately, that usually includes our registration code. Means that with usual building rules, global constructor/destructor trick does not work.

That is why we have invented ".icpp". This is like regular .cpp, but has guaranteed to be included in final binary - U++ build system understands this extension and takes appropriate steps to ensure that. Problem solved (as long as you are using theide or umk), problem created for Visual Studio...

'init' files are attempt to solve this issue.

Consider plugin/tif. It contains registration .icpp:

#include "tif.h"

NAMESPACE_UPP

INITBLOCK {
	StreamRaster::Register<TIFRaster>();
}

END_UPP_NAMESPACE


And then autogenerated (by theide) 'plugin/tif/init':

#ifndef _plugin_tif_icpp_init_stub
#define _plugin_tif_icpp_init_stub
#include "plugin\jpg/init"
#define BLITZ_INDEX__ F06a388f1e84b680d94787428bf67e5bb
#include "tifreg.icpp"
#undef BLITZ_INDEX__
#endif


As you can see, this code includes .icpp files, but also includes 'plugin/jpg/init'. That is because plugin/tif uses plugin/tiff (has it as 'uses' dependency). Now the idea how is this going to help with Visual Studio is that you can build everything as usual, only building .cpp, and in your main.cpp file, you would include all "init" files of directly dependent packages, like

main.cpp
#include <CtrlLib/CtrlLib.h>
#include <Something/Something.h>

// This part is only for visual studio:
#include <CtrlLib/init>
#include <Something/init>
// Includes in fact whole cpp files, thus must be include only in single .cpp file


Now, that is the nice theory, but AFAIK, nobody really tried this in practice... Be first! Smile

Mirek
Re: Cannot Compile TheIDE with MSVC12 [message #44222 is a reply to message #44221] Thu, 29 January 2015 09:30 Go to previous messageGo to next message
Silvan is currently offline  Silvan
Messages: 56
Registered: December 2014
Location: Trento (IT)
Member
mirek wrote on Wed, 28 January 2015 20:25

Now, that is the nice theory, but AFAIK, nobody really tried this in practice... Be first! Smile

Mirek


Well, if I understant correctly, icpp files are normal cpp file that need to be linked even if the are not referenced.
TheIDE understant it and do what is necessary to do that, but MSVC is not aware, so init file are created for this purpose. Is it okey?

For the intel compiler problem.
Well me and Microsoft are not good friends, so I don't what to istall the SDK (it do a mess...) and I managed to estract the files theIDE needs from a normal MSVC12 installation.
I made a directory with all needed and I tested both 32/64 compiling and debuging. And it rocks.
Now the problem arises with the INTEL compiler and it seems related to some .h files. I have no missing file error.

Silvan
Re: Cannot Compile TheIDE with MSVC12 [message #44231 is a reply to message #43986] Mon, 02 February 2015 15:47 Go to previous messageGo to next message
Silvan is currently offline  Silvan
Messages: 56
Registered: December 2014
Location: Trento (IT)
Member
Package: plugin/png
File: pngupp.cpp


#ifdef flagWIN32
#include <plugin/png/lib/png.h>
#else
#include <png.h>
#endif

#include <Draw/Draw.h>
#include "png.h"


is flagWIN32 declared somewhere?
which png.h I should use under MSVC?
Re: Cannot Compile TheIDE with MSVC12 [message #44234 is a reply to message #43986] Tue, 03 February 2015 10:56 Go to previous message
Silvan is currently offline  Silvan
Messages: 56
Registered: December 2014
Location: Trento (IT)
Member
While triing to do a solution under MSVC2008 with all the source code of TheIDE with init file included,
I find out that in MSVC we can create "Custom Build Process" where we can specify Command Line, Outputs and Additional Dependencies.
I suppose that the right way to create a compatiple solution in MSVC in to create a custom build for icpp file.
For now I go on with normal include..
Previous Topic: TheIDE precompiled headers: again
Next Topic: valgrind problem, heap-leak debugging
Goto Forum:
  


Current Time: Fri Mar 29 06:47:02 CET 2024

Total time taken to generate the page: 0.01216 seconds