Solved

Compiling in VC++ with options

Posted on 2004-08-10
11
450 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
Comment Utility
>>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
Comment Utility
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
Comment Utility
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
 
LVL 86

Expert Comment

by:jkr
Comment Utility
>> 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:NGInterfaceInc
Comment Utility
>>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
Comment Utility
>>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
Comment Utility
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
Comment Utility
>>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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Handling string inputs in C/Linux 23 167
WinWaitActive parameters 12 31
sum67 challenge 35 88
modThree challenge 4 64
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now