Csound Csound-dev Csound-tekno Search About

Problem Compiling Csound with MS Visual C++ 5.0 Learning Ed.

Date1998-06-26 02:22
FromHans Mikelson
SubjectProblem Compiling Csound with MS Visual C++ 5.0 Learning Ed.
Hi,

I'm trying to learn some MS Windows programming and to start to start with I
thought I would try to compile Csound (I also want to implement some new
opcodes).  The program first wanted to create a new project file which
seemed to go OK.  Then it had trouble finding things until I moved the files
up to d:\csound\.  Now it compiles OK but when it is time to link I get the
following error:

Linking...
LINK : fatal error LNK1104: cannot open file "nafxcw.lib"
Error executing link.exe.

When I search for this in help the help file it says:

Object-code libraries for MFC use the following naming conventions. The
library names have the form
uAFXcWd.LIB
where the letters shown in italic lowercase are placeholders for specifiers
whose meanings are shown in the table Library Naming Conventions below:
etc...
NAFXCW.LIB
 Release version

Note If you need to build a library version, see the Readme.Txt file in the
\MFC\Src directory. This file describes using the supplied makefile with
NMake.

Searching the CD for this file I find:

To build a library in a particular configuration, use the NMAKE tool
and the makefile which is in this directory.  The following arguments
can be given to NMAKE to successfully build a specific library variant.
  NMAKE {DEBUG=[0|1]} {BROWSE=[0|1]} {BROWSEONLY={0|1} \
  {CODEVIEW=[0|1|2]} {OBJ=path} \
  {PLATFORM=INTEL|ALPHA|MIPS|PPC|M68K|MPPC} \
  {UNICODE=[0|1]} \
  {OPT=}
Previous versions of MFC supported MODEL and TARGET options to control the
memory model and to support DOS/CONSOLE mode targetting. These options are
no longer supported (your Win32 console application can still be linked to
the GUI MFC library, NAFXCW[D].LIB).

Now there doesn't seem to be any makefile in this directory.

Anyone have any idee-ers?

Bu-Bye,
Hans Mikelson




Date1998-06-26 18:20
FromReid Sweatman
SubjectRE: Problem Compiling Csound with MS Visual C++ 5.0 Learning Ed.
> I'm trying to learn some MS Windows programming and to start to
> start with I
> thought I would try to compile Csound (I also want to implement some new
> opcodes).  The program first wanted to create a new project file which
> seemed to go OK.  Then it had trouble finding things until I
> moved the files
> up to d:\csound\.  Now it compiles OK but when it is time to link
> I get the
> following error:
>
> Linking...
> LINK : fatal error LNK1104: cannot open file "nafxcw.lib"
> Error executing link.exe.
>
> When I search for this in help the help file it says:
>
> Object-code libraries for MFC use the following naming conventions. The
> library names have the form
> uAFXcWd.LIB
> where the letters shown in italic lowercase are placeholders for
> specifiers
> whose meanings are shown in the table Library Naming Conventions below:
> etc...
> NAFXCW.LIB
>  Release version
>
> Note If you need to build a library version, see the Readme.Txt
> file in the
> \MFC\Src directory. This file describes using the supplied makefile with
> NMake.
>
> Searching the CD for this file I find:
>
> To build a library in a particular configuration, use the NMAKE tool
> and the makefile which is in this directory.  The following arguments
> can be given to NMAKE to successfully build a specific library variant.
>   NMAKE {DEBUG=[0|1]} {BROWSE=[0|1]} {BROWSEONLY={0|1} \
>   {CODEVIEW=[0|1|2]} {OBJ=path} \
>   {PLATFORM=INTEL|ALPHA|MIPS|PPC|M68K|MPPC} \
>   {UNICODE=[0|1]} \
>   {OPT=}
> Previous versions of MFC supported MODEL and TARGET options to control the
> memory model and to support DOS/CONSOLE mode targetting. These options are
> no longer supported (your Win32 console application can still be linked to
> the GUI MFC library, NAFXCW[D].LIB).
>
> Now there doesn't seem to be any makefile in this directory.

First of all, it sounds like you've let the app wizard default to its
default build type, which is to build a MFC app.  You probably don't want to
do that, since (as I recall from the last time I looked at CSound's code,
admittedly a couple of years ago ), CSound is what Windows considers a
"console" application.  So go back into the app wizard and generate a new
project, making sure to select that type of project.  Second, you may have
to go into the project settings dialog after you've done that and add a
couple of new paths, to make sure the compiler can find everything.  The key
thing is to make sure you actually tell the project that its files are where
you really put them when you first created the project.  (That dialog in the
app wizard can be a bit misleading, because it tends to insert one extra
directory level that you didn't expect when it creates things; experiment
with it in a dummy directory to see exactly what it's going to do).

Finally, I don't think you'll get that error message about NAFXCWx.LIB if
you do all that (the key point to note is that the "AFX" buried in the
filename means that the lib is associated with the application class in the
MFC library.  You probably don't want to mess with that, as it would mean
doing a complete port to the Windows environment, a messy job, unless you're
already an accomplished Windows and MFC programmer.)  Hope this helps.

Reid Sweatman
Programmer/Audio Engineer