By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,918 Members | 2,294 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,918 IT Pros & Developers. It's quick & easy.

stdafx.h and highgui.h

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
"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

P: n/a

"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

P: n/a
// 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

P: n/a
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

P: n/a
"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.