473,383 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

stdafx.h and highgui.h

Hello world,
I am using linux and os x and tried to compile some c++ sources
(dealing with image processin).

Although many people wrote that the code worked at theirs, I got the
error that the files stdafx.h and highgui.h could not be found (os x
and linux).

How exactly do I have to set up my system in order to be able to use
these classes and what are they there for?

Thanks a lot in advance
Tim

Jun 25 '06 #1
7 4448
silversurfer wrote:
Hello world,
I am using linux and os x and tried to compile some c++ sources
(dealing with image processin).

Although many people wrote that the code worked at theirs, I got the
error that the files stdafx.h and highgui.h could not be found (os x
and linux).

How exactly do I have to set up my system in order to be able to use
these classes and what are they there for?

Thanks a lot in advance
Tim


stdafx.h is a placeholder that typically represents all of the
Windows-specific headers, so you may be out of luck on a non-Windows
platform. Take out that #include and see if you get a million more
errors. That would imply the code depends on Windows. Don't know about
the other header.

--
Scott McPhillips [VC++ MVP]

Jun 25 '06 #2
"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> schrieb im Newsbeitrag
news:o-******************************@comcast.com...
silversurfer wrote:
Hello world,
I am using linux and os x and tried to compile some c++ sources
(dealing with image processin).

Although many people wrote that the code worked at theirs, I got the
error that the files stdafx.h and highgui.h could not be found (os x
and linux).

How exactly do I have to set up my system in order to be able to use
these classes and what are they there for?

Thanks a lot in advance
Tim


stdafx.h is a placeholder that typically represents all of the
Windows-specific headers, so you may be out of luck on a non-Windows
platform. Take out that #include and see if you get a million more
errors. That would imply the code depends on Windows. Don't know about
the other header.

--
Scott McPhillips [VC++ MVP]


highgui.h: Look at : http://opencvlibrary.sourceforge.net/
stdafx.h: see above. To be more precise:
stdafx.h is used for "MFC"-Programming (Microsoft Foundation Classes).
That is the old Windows GUI Library before WTL and nowadays .NET .
You don't have these headers in Unix or OS X.
You'll need one of the more expensive versions of MS Visual Studio 2005 (for
Win, of course).

Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
Jun 25 '06 #3

"Jens Marder" <fc**********@yahoo.com> wrote in message
news:44**********@x-privat.org...
stdafx.h is used for "MFC"-Programming (Microsoft Foundation Classes).
That is the old Windows GUI Library before WTL and nowadays .NET .


Eh? stdafx.h is used for precompiled headers. Regardless of MFC/WTL/ect.

In stdafx.h one will place the header files that is often used in ones
program.
Lets say you include the same file in each of your source files (.cpp) then
the compiler will compile the header file each time it compiles a source
file. To save time you can add your includes like windows.h in stdafx.h and
it will be "precompiled" so the compiler do not have to do this each time.

In vc7 and above the precompiled headers is supported so far i know. And you
do not need to use the feature.

If you have a compiler that do not support this, you can still use the
stdafx.h file. It will just not be precompiled, but compiled each time its
included in a source file.

//eric
Jun 26 '06 #4
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
^^^ Thats the comment VC7 inserts in top of stdafx.h

//eric
Jun 26 '06 #5
Eric Jensen wrote:

"Jens Marder" <fc**********@yahoo.com> wrote in message
news:44**********@x-privat.org...
stdafx.h is used for "MFC"-Programming (Microsoft Foundation Classes).
That is the old Windows GUI Library before WTL and nowadays .NET .


Eh? stdafx.h is used for precompiled headers. Regardless of MFC/WTL/ect.

In stdafx.h one will place the header files that is often used in ones
program.
Lets say you include the same file in each of your source files (.cpp)
then the compiler will compile the header file each time it compiles a
source file. To save time you can add your includes like windows.h in
stdafx.h and it will be "precompiled" so the compiler do not have to do
this each time.

In vc7 and above the precompiled headers is supported so far i know. And
you do not need to use the feature.

If you have a compiler that do not support this, you can still use the
stdafx.h file. It will just not be precompiled, but compiled each time its
included in a source file.


Yes, and in this case, it will have the opposite effect. The compilation
will become much slower, because _all_ the headers #included there will
always be compiled, even those that the current translation unit doesn't
need.

Jun 26 '06 #6
"Eric Jensen" <er**@no.spam.com> schrieb im Newsbeitrag
news:44***********************@dread11.news.tele.d k...

"Jens Marder" <fc**********@yahoo.com> wrote in message
news:44**********@x-privat.org...
stdafx.h is used for "MFC"-Programming (Microsoft Foundation Classes).
That is the old Windows GUI Library before WTL and nowadays .NET .


Eh? stdafx.h is used for precompiled headers. Regardless of MFC/WTL/ect.

In stdafx.h one will place the header files that is often used in ones
program.
Lets say you include the same file in each of your source files (.cpp)
then the compiler will compile the header file each time it compiles a
source file. To save time you can add your includes like windows.h in
stdafx.h and it will be "precompiled" so the compiler do not have to do
this each time.

In vc7 and above the precompiled headers is supported so far i know. And
you do not need to use the feature.

If you have a compiler that do not support this, you can still use the
stdafx.h file. It will just not be precompiled, but compiled each time its
included in a source file.

//eric

Really ?? See, for example:
http://en.wikipedia.org/wiki/Stdafx.h

Especially the end of the wikipedia entry.

Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
Jun 26 '06 #7
Really ?? See, for example:
http://en.wikipedia.org/wiki/Stdafx.h

Especially the end of the wikipedia entry.


Yes really. I readed the link wich says whats already written here.

Regarding the end of the wiki entry: "AFX was the original abbreviation for
the Microsoft Foundation Classes (MFC)."

Wich means that "AFX" was the original "short" for MFC. It does not state
that stdafx.h is for MFC only or simular.
However, your post made it sound like stdaxf.h was only intended for MFC,
wich its not.

If you lookup precompiled headers in the msdn library, it does not state
anything about MFC.

//eric
Jun 26 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Darren | last post by:
I just want do some console C++ programs. Do I still need this wield header"stdafx.h"? Thanks
2
by: Tommy Vercetti | last post by:
All C++ files in VC++ must start with #include "stdafx.h" Did anyone ever figure out why? Other C++ compilers have precompiler mechanisms that don't need source code modifications to function....
3
by: Egbert Nierop \(MVP for IIS\) | last post by:
Thanks in advance for answering this question.
3
by: Peter Oliphant | last post by:
I know that 'stdafx.h' has to do with pre-compiled headers. However, it seem weird that it is a required 'include' in any CPP file, especially since the file itself has no code in it! I know...
2
by: Lloyd Dupont | last post by:
Do you have any link about StdAfx? Apparently anything which written before #include "StdAfx.h" is ignored! Why the default empty project created by the wizard put it in to the .cpp file...
16
by: Chris Shearer Cooper | last post by:
In our Visual Studio 2005 application, we have several of our application's H files that are #included into stdafx.h. What is odd, is that when we change those application H files, VS2005...
2
by: Bob Altman | last post by:
Ok, I've wondered about this for a long time: Where does the name "StdAfx" come from? TIA - Bob
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.