p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Visual C++ (http://p2p.wrox.com/forumdisplay.php?f=88)
-   -   How to Use Precompiled OBJ (http://p2p.wrox.com/showthread.php?t=1787)

johan_yo July 17th, 2003 01:10 PM

How to Use Precompiled OBJ
I'm creating one of the biggest project I have undertaken N I'm a newbie, so I need lots of help. Because it's so big, I break it down into multiple parts (multiple projects, 1 DSP for 1 DSW), which I call utilities.
Now I want to use a "Utility", eg MyCustomStringCls, in another project. I have compiled N tested the "utility" so I have the OBJ file already.

Now here are my Q:
1. When I want to use an utility (eg MyCustomStringCls), in VC++, do I need to "Add To Project > Files" the MyCustomStringCls.h and the .CPP?

2. I want to call include with Angle bracket instead of DoubleQuote, do I just need to "Settings > C/C++ tab > Preprocessor" and add the path to "Additional Include directories" ?
I have done this, but everytime I add new method, which returns MyCustomStringCls object, in my new class, VC++ always add new #include with double quote. I'm fighting with it by manually delete that new include.
eg. For the new class, I want to have:
    #include <MyCustomStringCls.h>
    BUT, VC++ always add this:
    #include "..\Prj_MyCustomStringCls\MyCustomStringCls.h"

3. Every time I compile my new Project, it creates the MyCustomStringCls.OBJ and puts it in my new project folder. How do I tell VC++ compiler to skip creating OBJ for particular .H .CPP? And how do I tell linker to use the OBJ from MyCustomStringCls project folder?

Hope I don't confuse anybody. Please Help.


dechja July 24th, 2003 04:54 PM

1. Yes you would need to include both .H and .CPP , Or you might create your utility project as a DLL and then you would need to include .H and .LIB instead to the new project.
2. No, if you want to use Angle bracket you would need to define the include directory in Option, Directories, and Include Files.
3. You would need to take the MyCustomStringCls.CPP from the new project out and go to Project, Settting and Link tab and add MyCustomomStringCls.obj that you already complied into the Object/library moudles.

I think, this would help.

johan_yo July 26th, 2003 02:23 PM

Thanx Decha,

I have successfully tried 2 things:
1. Make .LIB
2. Use precompiled .OBJ following decha's procedure.


All times are GMT -4. The time now is 07:24 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.