Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 17th, 2003, 01:10 PM
Registered User
Join Date: Jul 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

Old July 24th, 2003, 04:54 PM
Registered User
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

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.

Old July 26th, 2003, 02:23 PM
Registered User
Join Date: Jul 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

Thanx Decha,

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Precompiled Usercontrols ramki16 ASP.NET 2.0 Professional 0 April 9th, 2008 04:21 AM
Can we extend the precompiled & deployed applicati amolchikurte ASP.NET 2.0 Professional 1 August 23rd, 2007 09:28 AM
Publishing - Precompiled updatable site timType3 Visual Studio 2005 0 August 14th, 2006 09:31 AM
using com obj in asp.net Asteroid ASP.NET 1.0 and 1.1 Basics 2 September 27th, 2004 08:48 AM
Vector.contains(Object obj) jacob J2EE 2 January 10th, 2004 02:34 PM

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