Re: class wizard / conditional compilation

From: Ajay Kalra (ajaykalra_at_yahoo.com)
Date: 01/10/05

  • Next message: AliR: "Re: Multiple Timers"
    Date: 10 Jan 2005 13:36:59 -0800
    
    

    #include "Winawsvr.h" //

    Of course you need the above line if you want to access types in that
    file or other files included in above file.

    You need *.cpp in you *project* if you want to compile the code in that
    file. These two are different things. You are confusing project and
    class browser. You will add .cpp files to the project. If you dont add
    these to the project, these will not get compiled. If you want to
    compile the files, you must add these to the project.

    The problem I addressed was different; it simply showed how to access
    various versions of one file(same name) in your project. You still need
    this.

    -----------
    Ajay Kalra
    ajaykalra@yahoo.com

    Lisa Pearlson wrote:
    > I am using VS6 and I have included the directories.
    > Under Project Settings, I choose the C/C++ tab and under category
    > "Preprocessor" I can enter "Additional include directories:" .. this
    > automatically includes the /I in the compiler params.
    >
    > But this isn't working at all.
    >
    > My directory structure is like this:
    >
    > <project directory>\<main files>
    > <project directory>\pca\9.2\awrem32.cpp/h
    > <project directory>\pca\10.5\awrem32.cpp/h
    >
    > I need awrem32.cpp/h for some function calls in MainFrm.cpp
    > So
    >
    > MainFrm.cpp:
    >
    > #include "stdafx.h"
    > #include "HTMap.h"
    > #include "MainFrm.h"
    > #include <Atlbase.h> //CRegKey
    >
    > #include "Winawsvr.h" // <--- this must be included
    >
    > If I don't include the line above, I get a bunch of undelcared
    identifier
    > errors since those are defined in the awrem32.h file.
    > When I include "awrem32.h", without telling inside the project
    settings
    > where this file can be found (additional include directories), I get
    not
    > found error, but when I do add these settings per configuration, it
    seems to
    > work, but fails at linking stage.
    >
    > The issue is still, do I or do I not add "awrem32.h" and .cpp files
    to the
    > class browser or not. I wish I could include it per project setting..
    in
    > other words, I can include different files for different project
    settings.
    > Without that, it just doesn't seem to link, because it doesn't
    compile,
    > because it isn't known by the class wizard.
    > So I get link errors.
    >
    > So I do believe I must do my
    >
    > #include "awrem32.h"
    >
    > But since that file is not in the root of the project directory but
    in a sub
    > directory, I tell each project settings where to look for that file..
    but to
    > actually get it to compile, and link, it needs to show up in the
    class
    > wizard. ;-(
    > I can't get this to work.. should be so simple.
    >
    > Lisa
    >
    > "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
    > news:1105388740.033016.93970@f14g2000cwb.googlegroups.com...
    > > Include path is the /I option. You can specify the include paths
    for
    > > each project under properties of the project. In VS7, You can get
    to
    > > properties by right clicking on the project and clicking
    properties..
    > > It is under Properties::C/C++::General. It appears on top as
    Additional
    > > Include Directories. Do this for all the configurations. Also
    remember
    > > to take of the hard coded path from your file.
    > >
    > > --------------
    > > Ajay Kalra
    > > ajaykalra@yahoo.com
    > >
    > > Lisa Pearlson wrote:
    > > > Thanks, that's what I did.. I just can't find the place to add
    the
    > > > additional include paths.
    > > > Anyway, does this mean I should not have to import the file into
    > > class
    > > > wizard? (and so it does not show up in the class browser in the
    left)
    > > ?
    > > >
    > > > Lisa
    > > >
    > > > "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
    > > > news:1105382934.908509.158340@c13g2000cwb.googlegroups.com...
    > > > > Since file name is same for all configurations, you could
    simply
    > > change
    > > > > the Include path for each of the configurations. Remove the
    > > hardcoded
    > > > > path from the file and put that path as an include path. Create
    6
    > > > > configurations (debug/release) and define include path for each
    > > > > (debug/release will have the same path).
    > > > >
    > > > > -------
    > > > > Ajay Kalra
    > > > > ajaykalra@yahoo.com
    > > > >
    > > > >
    > > > > Lisa Pearlson wrote:
    > > > > > Hi,
    > > > > >
    > > > > > I need something like this:
    > > > > >
    > > > > > #if defined(_PCA92_)
    > > > > > #include "pca\\9.2\\Winawsvr.h"
    > > > > > #elif defined(_PCA105_)
    > > > > > #include "pca\\10.5\\Winawsvr.h"
    > > > > > #elif defined(_PCA115_)
    > > > > > #include "pca\\11.5\\Winawsvr.h"
    > > > > > #endif
    > > > > >
    > > > > > The defines I control by setting up different release mode
    files,
    > > > > just like
    > > > > > with Debug and Release versions, eg:
    > > > > > . Release - PCA92
    > > > > > . Release - PCA105
    > > > > > . Release - PCA115
    > > > > >
    > > > > > I can then select this from the drop down menu to compile the
    > > right
    > > > > version.
    > > > > >
    > > > > > However, the files can not be compiled unless they are
    imported
    > > into
    > > > > the
    > > > > > class wizard.
    > > > > > Since the file names are all the same, and all class
    definitions
    > > > > inside of
    > > > > > them, I can not include these 3 versions of files into the
    class
    > > > > wizard
    > > > > > simultaneously.
    > > > > >
    > > > > > I do not want to rename the files if possible, and do not
    want to
    > > > > include
    > > > > > all 3 files in 1 manually and seperate them with the #ifdef
    > > > > statements,
    > > > > > because these external files may change and I don't want to
    do
    > > any
    > > > > manual
    > > > > > stuff with them, only replace the files or add new versions.
    > > > > >
    > > > > > Can this be done?
    > > > > >
    > > > > > Lisa
    > > > >
    > >


  • Next message: AliR: "Re: Multiple Timers"

    Relevant Pages

    • Re: Cpp Considered Harmful
      ... >> means of doing some of the things the CPP is currently used for. ... > syntax of #include for the language specified libraries. ... believe it would be trickier in C++ than in Java to accomplish what I'm ... there is often a need to compile a class before it can be ...
      (comp.lang.cpp)
    • How to invoke to other applications from c files and compile shared library from .cpp files?
      ... 1)I'm writing an application in C. ... 2)Does the application i want to invoke from my code, ... to compile it using cc (and rename the .cpp files to .C files)? ...
      (comp.unix.aix)
    • A little guidance please
      ... I have successfully built both Gentoo and Rock from scratch apart from Rock ... I have managed to install FreeBSD and boot into it and have to say this does ... to specify the cpu settings for the compile? ... Reading the handbook it says copy the settings from /etc/defaults/make.conf ...
      (comp.unix.bsd.freebsd.misc)
    • Re: A little guidance please
      ... > I have successfully built both Gentoo and Rock from scratch apart from ... > to specify the cpu settings for the compile? ... > Reading the handbook it says copy the settings from ... > I did not do the cvsup as I have sources instaled from my minimal install ...
      (comp.unix.bsd.freebsd.misc)
    • Re: class wizard / conditional compilation
      ... It seems I have to add all 3 versions, and then for each configuration, ... which is very hard from within project settings).. ... > compile the files, you must add these to the project. ... > Lisa Pearlson wrote: ...
      (microsoft.public.vc.mfc)