473,509 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

visual 2008: can't find header

Hi,

Im using Visual C++ 2008, I made a header file (well, copied the
header "cat.h" from http://en.wikipedia.org/wiki/Opaque_pointer)

The only mention of cat.h I have in my script containing main() is the
line:
#include <cat.h>

I've saved the header file within the same project as the script
containing main. When compiling, i get the error message:

fatal error C1083: Cannot open include file: 'cat.h': No such file or
directory

Im incredibly new to C, and my guess is that I need to tell the
compiler to look in my project directory for headers.

Does anyone know how to do this or can advise me otherwise?

Thanks,
Adam
Oct 14 '08 #1
12 2144
On Oct 14, 8:59*pm, Adam Chapman
<adam.chap...@student.manchester.ac.ukwrote:
Hi,

Im using Visual C++ 2008, I made a header file (well, copied the
header "cat.h" fromhttp://en.wikipedia.org/wiki/Opaque_pointer)

The only mention of cat.h I have in my script containing main() is the
line:
#include <cat.h>

I've saved the header file within the same project as the script
containing main. When compiling, i get the error message:

fatal error C1083: Cannot open include file: 'cat.h': No such file or
directory

Im incredibly new to C, and my guess is that I need to tell the
compiler to look in my project directory for headers.

Does anyone know how to do this or can advise me otherwise?

Thanks,
Adam
Aha! Should have used "cat.h" rather than <cat.h>. Is this a standard
syntax for user-created headers?
Oct 14 '08 #2
Adam Chapman wrote, On 14/10/08 20:59:
Hi,

Im using Visual C++ 2008, I made a header file (well, copied the
header "cat.h" from http://en.wikipedia.org/wiki/Opaque_pointer)

The only mention of cat.h I have in my script containing main() is the
line:
#include <cat.h>
You should ony use angle brackets for include files provided by your
system, you should use double-quotes for headers you provide. I.e. try

#include "cat.h"
I've saved the header file within the same project as the script
containing main. When compiling, i get the error message:

fatal error C1083: Cannot open include file: 'cat.h': No such file or
directory

Im incredibly new to C, and my guess is that I need to tell the
compiler to look in my project directory for headers.

Does anyone know how to do this or can advise me otherwise?
For help on how to use Visual Studio you should use one of the Windows
programming groups. However my guess is that with the change above you
will get rid of the error.
--
Flash Gordon
If spamming me sent it to sm**@spam.causeway.com
If emailing me use my reply-to address
See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
Oct 14 '08 #3
Adam Chapman wrote, On 14/10/08 21:02:

<snip>
Aha! Should have used "cat.h" rather than <cat.h>. Is this a standard
syntax for user-created headers?
Yes. Quotes for user headers angle brackets for system provided headers.
--
Flash Gordon
If spamming me sent it to sm**@spam.causeway.com
If emailing me use my reply-to address
See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
Oct 14 '08 #4
Thanks guys.

Looking at the C example at http://en.wikipedia.org/wiki/Opaque_pointer
, Could you show me how to use the create_Cat function from my main
script? I'ts difficult to tell what inputs I need, most probably
because Im dumb. I think it would be something like this:

#include "cat.h"

main(void){
int smile;
smile = 1;
..... create_Cat(int smile);
}

But am not sure what to put in the place of the .... .

Oct 14 '08 #5

"Adam Chapman" <ad**********@student.manchester.ac.ukwrote in message
Thanks guys.

Looking at the C example at http://en.wikipedia.org/wiki/Opaque_pointer
, Could you show me how to use the create_Cat function from my main
script? I'ts difficult to tell what inputs I need, most probably
because Im dumb. I think it would be something like this:

#include "cat.h"

main(void){
int smile;
smile = 1;
.... create_Cat(int smile);
}

But am not sure what to put in the place of the .... .
what does create_Cat return? Can you show us the contents of cat.h ?
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Oct 14 '08 #6
what does create_Cat return? Can you show us the contents of cat.h ?
My understanding is that create_Cat creates a new variable with a data
type defied in cat.h . I want to know how to call it so I can make my
own. I plan to make a structure type which holds 2D matrix values and
dimensions.
Oct 14 '08 #7
On October 14, 2008 16:25, in comp.lang.c, Adam Chapman
(ad**********@student.manchester.ac.uk) wrote:
Thanks guys.

Looking at the C example at http://en.wikipedia.org/wiki/Opaque_pointer
, Could you show me how to use the create_Cat function from my main
script? I'ts difficult to tell what inputs I need, most probably
because Im dumb. I think it would be something like this:

#include "cat.h"

main(void){
int smile;
smile = 1;
.... create_Cat(int smile);
}

But am not sure what to put in the place of the .... .
OK. You /really/ need help learning C, don't you. Are you certain that your
name isn't "Bill Cunningham"?

1) You will need to compile the second set of logic shown on that webpage,
either as part of the source code file (officially, the "translation unit")
that your main() function is in, or as a separate source code file. If you
choose to make it a separate source code file, you will have to instruct
your linker to use the compiled functions when it links your main()
function.

2) The "cat.h" example file given on the webpage is incomplete. It provides
typedef struct cat_t *cat_handle;
which makes the typename cat_handle to be an alias to the type
"pointer to struct cat_t"
but it /does not/ define the
struct cat_t
at all. However, you can find the structure definition for cat_t in the
second example code. My recommendation would be to remove it from the
second example, and move it to the cat.h header.

3) You actually had a good start in the lines above. Assuming that you move
the cat_t structure definition to cat.h, you will need something like...

#include "cat.h"

int main(void)
{
cat_handle MyCat;

MyCat = createCat(1);

/* what ever other logic you want to use goes here */

return 0;
}
HTH
--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
Oct 14 '08 #8
On October 14, 2008 17:08, in comp.lang.c, Lew Pitcher
(lp******@teksavvy.com) wrote:
On October 14, 2008 16:25, in comp.lang.c, Adam Chapman
(ad**********@student.manchester.ac.uk) wrote:
>Thanks guys.

Looking at the C example at http://en.wikipedia.org/wiki/Opaque_pointer
[snip]
2) The "cat.h" example file given on the webpage is incomplete. It
provides
typedef struct cat_t *cat_handle;
which makes the typename cat_handle to be an alias to the type
"pointer to struct cat_t"
but it /does not/ define the
struct cat_t
at all. However, you can find the structure definition for cat_t in the
second example code. My recommendation would be to remove it from the
second example, and move it to the cat.h header.
Oops. I screwed that one up, didn't I?

The whole point of data hiding is that you don't have to do what I told you
to do. If I were on SNL in the 80's, I'd say "Never mind" (others will get
the reference), but I'm not, so I'll just apologize instead.

With the code supplied, all you have to do is....

#include "cat.h"

int main(void)
{
cat_handle MyCat;

MyCat = create_Cat(1);
/* et cetera */

return 0;
}

[snip]

--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
Oct 14 '08 #9
On Tue, 14 Oct 2008 17:08:33 -0400, Lew Pitcher wrote:
On October 14, 2008 16:25, in comp.lang.c, Adam Chapman
(ad**********@student.manchester.ac.uk) wrote:
>http://en.wikipedia.org/wiki/Opaque_pointer
2) The "cat.h" example file given on the webpage is incomplete. It
provides
typedef struct cat_t *cat_handle;
which makes the typename cat_handle to be an alias to the type
"pointer to struct cat_t"
but it /does not/ define the
struct cat_t
at all.
The idea is to not expose the definition of struct cat_t, because the
calling code doesn't need it.
However, you can find the structure definition for cat_t in the
second example code. My recommendation would be to remove it from the
second example, and move it to the cat.h header.
My recommendation would be to leave it in its current place.
Oct 14 '08 #10
Adam Chapman wrote:
>
Im using Visual C++ 2008, I made a header file (well, copied the
header "cat.h" from http://en.wikipedia.org/wiki/Opaque_pointer)

The only mention of cat.h I have in my script containing main()
is the line:
#include <cat.h>
That line searches only the area that holds system headers. cat.h
is not a system header, it is something of yours, so use:

#include "cat.h"

Note the quote markers.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Oct 14 '08 #11
On Tue, 14 Oct 2008 18:36:13 -0400, CBFalconer wrote:
Adam Chapman wrote:
>>
Im using Visual C++ 2008, I made a header file (well, copied the
header "cat.h" from http://en.wikipedia.org/wiki/Opaque_pointer)

The only mention of cat.h I have in my script containing main()
is the line:
#include <cat.h>

That line searches only the area that holds system headers. cat.h
is not a system header, it is something of yours, so use:

#include "cat.h"

Note the quote markers.
Gosh, CB, your politeness reminds me of your better nature.

For the OP, will you go out and find a good newsgroup where this is
topical? (A good one)

Please repost when you succeed.
--
Richard Milhous Nixon

The very ink with which all history is written is merely fluid prejudice.
~~ Mark Twain
Oct 15 '08 #12
Richard Nixon wrote:
CBFalconer wrote:
>Adam Chapman wrote:
>>Im using Visual C++ 2008, I made a header file (well, copied the
header "cat.h" from http://en.wikipedia.org/wiki/Opaque_pointer)

The only mention of cat.h I have in my script containing main()
is the line:
#include <cat.h>

That line searches only the area that holds system headers. cat.h
is not a system header, it is something of yours, so use:

#include "cat.h"

Note the quote markers.

Gosh, CB, your politeness reminds me of your better nature.

For the OP, will you go out and find a good newsgroup where this is
topical? (A good one)
Well done. You have trolled yourself into the PLONK bin. Bye.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Oct 16 '08 #13

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

Similar topics

6
6151
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
2
2653
by: =?Utf-8?B?SmFzb24gQS4gSmVuc2Vu?= | last post by:
I have a MSDN Subscription expiring this month but really need Visual Studio 2008 when it comes out. I called customer service to find out but they don't know. They seemed to think it was a...
58
3176
by: Jon Skeet [C# MVP] | last post by:
Just in case people had missed it, Visual Studio 2008 is now available for download for MSDN subscribers, and the Express editions are also out: http://www.microsoft.com/express/download/ --...
5
378
by: shapper | last post by:
Hello, Does anyone knows what is the difference between Microsoft Visual Studio 2008 Team Foundation Server and Microsoft Visual Studio 2008 Professional? Thanks, Miguel
3
3094
by: =?Utf-8?B?Rmxhc2hwcm8=?= | last post by:
i have googled this question but cannot find an answer. i'm running windows vista and i'm using Visual Basic Express 2008. i know the build event button SHOULD be in under the compile tag but i...
1
1674
by: Jim Langston | last post by:
I'm trying to compile some source code to interface LUA into C++. When I compile in MSVC++ Express 2008, however, I get the error (among others): ....\luastate.h(129) : error C2027: use of...
4
1752
by: lichaoir | last post by:
Can I develop asp.net 1.1 application in visual studio 2008? I've tried to find .net framework 1.1 in the project's properties window, but I can't find it! Please help! Thanks for your...
2
3382
by: Cramer | last post by:
So, what is the relationship between Visual Studio and Visual Web Developer. I find a lot of documentation on MSDN that presents Visual Web Developer as it's own stand-alone product (which I'd...
3
10488
by: Johnson | last post by:
I'm not sure if this is an IIS 5.1 issue or ASP.NET issue, or Visual Studio 2008 issue -- thus posting to 3 groups. Please don't be offended. The problem I'm encountering is that Visual Studio...
0
7233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.