Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Compiling in VC++ with options

Posted on 2004-08-10
11
Medium Priority
?
513 Views
Last Modified: 2013-11-20
Hi,
   How do I compile a set of programs in Visual C++ 6.0 with "options"? In the following page:

http://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc15.22

it says I need to compile the code with -DWITH_SOAPDEFS_H option. How do I do this? Also, how does one sort through the dependencies in a complex C++ program?

Any help is appreciated. :-)
0
Comment
Question by:NGInterfaceInc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
11 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 1000 total points
ID: 11764111
>>it says I need to compile the code with -DWITH_SOAPDEFS_H option. How do I do this?

Go to your project settings, choose the C++ tab, switch to "Proprocessor"and add "WITH_SOAPDEFS_H" to the "Preprocessor definitions" field.
0
 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 1000 total points
ID: 11765729
When using precompiled header file stdafx.h you may alternatively put a

#define WITH_SOAPDEFS_H

statement above all #include statements.

>> Also, how does one sort through the dependencies in a complex C++ program?

I assume you are talking of header file dependencies rather than project dependencies?

There are two general rules about header files:

1. Any header file must protect itself from beeing included twice, e. g. a file myheader.h starts with

#ifndef MYHEADER_H
#define MYHEADER_H

and the last statement of the file is

#endif // MYHEADER_H


2. Any source file (h-file or cpp-file) MUST include all header files it needs.

Then, the order of #include statements is a minor problem as there is no include file that needs some definitions from a previous include file but has all includes needed itself.

Regards, Alex



0
 

Author Comment

by:NGInterfaceInc
ID: 11766982
okay, i've tried what was suggested. it doesn't compile for some reason...getting lots of errors like:

error C2872: 'ostream' : ambiguous symbol

(same for cout and istream. Any ideas what is wrong?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 86

Expert Comment

by:jkr
ID: 11767105
>> okay, i've tried what was suggested

What have you tried?

>>error C2872: 'ostream' : ambiguous symbol

I assume your code uses both 'ostream' and 'ostream.h'
0
 

Author Comment

by:NGInterfaceInc
ID: 11767134
>>What have you tried?

I did this:

>> Go to your project settings, choose the C++ tab, switch to "Proprocessor"and add "WITH_SOAPDEFS_H" to the "Preprocessor definitions" field.

There are thousands of lines of code in the WSDL generated C++ files...how do I find which include is causing this problem?

Thanks...
0
 
LVL 86

Expert Comment

by:jkr
ID: 11767230
>>how do I find which include is causing this problem?

Visual Studio has the option "Find in Files..." (under the 'Edit' menu), try this to locate which files use these header files.
0
 
LVL 86

Expert Comment

by:jkr
ID: 11767276
Just a moment - since these files are generated, is there an option to change the usage of these header files and re-generate them?
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 11769935
>>how do I find which include is causing this problem?

You have two files where you may start the search:

First, the cpp file that got compiled (you see it in the 'Build' tab of the output window).
Second, the header file that has the compile error.

I share jkr's suggestion that there is a mix between old stream header files (e. g. #include <iostream.h>) and standard stream headers (#include <iostream>).  It is most likely that the cpp file includes some old stream headers and the header files have new stream headers or vice versa.

1. Check alle #include statements of the cpp file (or post it here). (When moving the mouse cursor
    to the file name of a #include statement , you may right-click and select 'Open Document ".....h").
2. Try to find all include files between the cpp file and the header file that has the compile error.
    (the 'Find in Files' may help you with this)
3. Check for old and new stream header files beeing included and post the results of your query.

Good luck,

Alex




0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question