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 (OMG!!)
So.. how to compile a simple upp program in VS?
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?
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.
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.