Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 17th, 2003, 01:10 PM
Registered User
Join Date: Jul 2003
Location: , , .
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.

Reply With Quote
  #2 (permalink)  
Old July 24th, 2003, 04:54 PM
Registered User
Join Date: Jul 2003
Location: , , .
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.

Reply With Quote
  #3 (permalink)  
Old July 26th, 2003, 02:23 PM
Registered User
Join Date: Jul 2003
Location: , , .
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.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

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

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