Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Compiling in VC++ with options

Posted on 2004-08-10
11
Medium Priority
?
521 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
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Integration Management Part 2
Suggested Courses

963 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