Discussion:
Support for building against MFC and Windows Forms?
(too old to reply)
Warren Young
2010-05-18 23:36:54 UTC
Permalink
My Bakefile based project is mostly portable, but there are two Visual
C++ specific example programs that go along with it to demonstrate how
you use my library with MFC and C++/CLI (Windows Forms).

Currently I have separate *.vcproj and *.sln files for these examples,
but this has a number of problems. It would be far better if I could
bring everything into a single common build system. The problem is that
I can't see how to get Bakefile to generate *.vcproj files with MFC or
C++/CLI options enabled.

The MFC case is probably simple. There seems to be two changes needed.
One is that UseOfMFC="0" needs to change to 2. The other I haven't
figured out yet -- I get some weird error about not finding WinMain from
the linker. It's probably another build setting I haven't found yet.

The C++/CLI case may be harder, since it's an entirely different build
environment. Currently, my users have to rebuild my library with CLR
support before they can link it to the C++/CLI example. Even assuming
we can figure out how to get Bakefile to generate *.vcproj that will
build a Windows Forms based program, I guess I'll have to figure out how
to get it to also build my library twice, once with CLR support turned
on, the second time with it turned off.
Vaclav Slavik
2010-05-21 16:53:30 UTC
Permalink
Hi,
Post by Warren Young
bring everything into a single common build system. The problem is that
I can't see how to get Bakefile to generate *.vcproj files with MFC or
C++/CLI options enabled.
You'll have to extend Bakefile to do that.
Post by Warren Young
The MFC case is probably simple. There seems to be two changes needed.
One is that UseOfMFC="0" needs to change to 2.
Yes, this should be pretty simply with some <msvc-use-mfc> flag...
Post by Warren Young
The C++/CLI case may be harder, since it's an entirely different build
environment. Currently, my users have to rebuild my library with CLR
support before they can link it to the C++/CLI example. Even assuming
we can figure out how to get Bakefile to generate *.vcproj that will
build a Windows Forms based program, I guess I'll have to figure out how
to get it to also build my library twice, once with CLR support turned
on, the second time with it turned off.
I'd expect the CompileAsManaged property to be per-configuration, so you
could just have one config to compile as native, one as managed... Am I
missing something?

Vaclav

Loading...