Please help! (Hopefully this is the right place for this post)

I want to use dynamical link to build a MFC project (VC7) . I know how to
do it in visual studio menu. (go to project->settings->general and select
"Using MFC as a Shared dll" ). But I don't know how to do it from command
line compiling

What option I should add from command line ?

Thank you so much

Re: Command line compile--how to set dynamic link? by Doug

Doug
Mon May 09 12:18:05 CDT 2005

On Mon, 9 May 2005 09:51:14 -0700, June wrote:

> Please help! (Hopefully this is the right place for this post)
>
> I want to use dynamical link to build a MFC project (VC7) . I know how to
> do it in visual studio menu. (go to project->settings->general and select
> "Using MFC as a Shared dll" ). But I don't know how to do it from command
> line compiling
>
> What option I should add from command line ?
>
> Thank you so much

For quick info on the most important options, type:

cl /?

For dynamic linking, you should use /MD (release) or /MDd (debug). For MFC,
I think you also need to add /D_AFXDLL. The easiest way to tell what the
options should be is to look at them in the IDE for a default project of
the type you want to build.

--
Doug Harrison
Microsoft MVP - Visual C++

Re: Command line compile--how to set dynamic link? by Kyle

Kyle
Mon May 09 16:43:58 CDT 2005

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxgrfcommandlineswitches.asp

--
---------------------------------------------------
Automate your software builds with Visual Build Pro
http://www.visualbuild.com/

"June" <June@discussions.microsoft.com> wrote in message
news:F5946105-411F-432B-B980-B0637D080AB1@microsoft.com...
> Please help! (Hopefully this is the right place for this post)
>
> I want to use dynamical link to build a MFC project (VC7) . I know how to
> do it in visual studio menu. (go to project->settings->general and select
> "Using MFC as a Shared dll" ). But I don't know how to do it from command
> line compiling
>
> What option I should add from command line ?
>
> Thank you so much
>



Re: Command line compile--how to set dynamic link? by June

June
Mon May 09 18:20:03 CDT 2005

One more question:

What lib file should I include if I use dynamic link to MFC (VC7)?
Is it mfc71.dll ?

"Kyle Alons" wrote:

> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxgrfcommandlineswitches.asp
>
> --
> ---------------------------------------------------
> Automate your software builds with Visual Build Pro
> http://www.visualbuild.com/
>
> "June" <June@discussions.microsoft.com> wrote in message
> news:F5946105-411F-432B-B980-B0637D080AB1@microsoft.com...
> > Please help! (Hopefully this is the right place for this post)
> >
> > I want to use dynamical link to build a MFC project (VC7) . I know how to
> > do it in visual studio menu. (go to project->settings->general and select
> > "Using MFC as a Shared dll" ). But I don't know how to do it from command
> > line compiling
> >
> > What option I should add from command line ?
> >
> > Thank you so much
> >
>
>
>

Re: Command line compile--how to set dynamic link? by Martin

Martin
Tue May 10 02:01:08 CDT 2005

Hallo June!

> What lib file should I include if I use dynamic link to MFC (VC7)?
> Is it mfc71.dll ?

You do not specify a LIB file for the MFC. If you include the MFC
headers and set the specific defines like _AFXDLL the headers will setup
some linker irectives that will search for the correct library.

--
Martin Richter [MVP] WWJD
"In C we had to code our own bugs. In C++ we can inherit them."
FAQ : http://www.mpdvc.de
Samples: http://www.codeguru.com http://www.codeproject.com

Re: Command line compile--how to set dynamic link? by rg>

rg>
Tue May 10 02:30:32 CDT 2005

Building from the command-line for VC7:
Release version:
> devenv /build release "project_file.sln"
Debug version:
> devenv /build debug "project_file.sln"

"devenv.exe" can do both, start VC7 IDE and build projects from the
command-line.


"June" <June@discussions.microsoft.com> wrote in message
news:F5946105-411F-432B-B980-B0637D080AB1@microsoft.com...
> Please help! (Hopefully this is the right place for this post)
>
> I want to use dynamical link to build a MFC project (VC7) . I know how to
> do it in visual studio menu. (go to project->settings->general and select
> "Using MFC as a Shared dll" ). But I don't know how to do it from command
> line compiling
>
> What option I should add from command line ?
>
> Thank you so much
>



Re: Command line compile--how to set dynamic link? by June

June
Tue May 10 14:20:05 CDT 2005

Hello Marin,

Thanks for your help. Just tried, If I don't define /D_AFXDLL, I will get a
link error.

June

"Martin Richter [MVP]" wrote:

> Hallo June!
>
> > What lib file should I include if I use dynamic link to MFC (VC7)?
> > Is it mfc71.dll ?
>
> You do not specify a LIB file for the MFC. If you include the MFC
> headers and set the specific defines like _AFXDLL the headers will setup
> some linker irectives that will search for the correct library.
>
> --
> Martin Richter [MVP] WWJD
> "In C we had to code our own bugs. In C++ we can inherit them."
> FAQ : http://www.mpdvc.de
> Samples: http://www.codeguru.com http://www.codeproject.com
>

Re: Command line compile--how to set dynamic link? by June

June
Tue May 10 16:04:03 CDT 2005

Thanks to all kindly help, Doug, Kyle , Martin and rg

One more question: Is it possible to link my application(a VC7 project) to
MFC lib of VC6, say MFC42.dll?

"rg" wrote:

> Building from the command-line for VC7:
> Release version:
> > devenv /build release "project_file.sln"
> Debug version:
> > devenv /build debug "project_file.sln"
>
> "devenv.exe" can do both, start VC7 IDE and build projects from the
> command-line.
>
>
> "June" <June@discussions.microsoft.com> wrote in message
> news:F5946105-411F-432B-B980-B0637D080AB1@microsoft.com...
> > Please help! (Hopefully this is the right place for this post)
> >
> > I want to use dynamical link to build a MFC project (VC7) . I know how to
> > do it in visual studio menu. (go to project->settings->general and select
> > "Using MFC as a Shared dll" ). But I don't know how to do it from command
> > line compiling
> >
> > What option I should add from command line ?
> >
> > Thank you so much
> >
>
>
>