Solved

Compiling in VC++ with options

Posted on 2004-08-10
11
499 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 250 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 250 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.

751 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