Solved

Compiling in VC++ with options

Posted on 2004-08-10
11
488 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 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 163
Generic progress indicator 6 117
Best tools for Backup and restore of Wordpress site 6 57
while loop over for loop 7 115
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…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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