473,586 Members | 2,495 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 2161
On Oct 14, 8:59*pm, Adam Chapman
<adam.chap...@s tudent.manchest er.ac.ukwrote:
Hi,

Im using Visual C++ 2008, I made a header file (well, copied the
header "cat.h" fromhttp://en.wikipedia.or g/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.cause way.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.cause way.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**********@s tudent.manchest er.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**********@s tudent.manchest er.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 "translatio n 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******@teksa vvy.com) wrote:
On October 14, 2008 16:25, in comp.lang.c, Adam Chapman
(ad**********@s tudent.manchest er.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**********@s tudent.manchest er.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

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

Similar topics

6
6168
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 itself. Everything you need is available at no costs (except download hassle and installation time). Once your system is set up properly its just a matter...
2
2668
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 possibility but couldn't say for sure. Does anyone know if Visual Studio 2008 will come with the MSDN subscription or would it be better to let the...
58
3211
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/ -- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet World class .NET training in the UK:...
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
3104
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 can't find it. i'm used to Visual Basic 2005, so some help would be appriciated. i need to find the build events tag because i'm creating a screen...
1
1678
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 undefined type 'cpplua::LuaFunction' ....\luastate.h(63) : see declaration of 'cpplua::LuaFunction' So I'm trying to track this down. I see that...
4
1756
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 discussion and answer!
2
3388
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 expect of the Express editions), but apparently there are NON Express versions of Visual Web Developer. Is Visual Web Developer only built-in to...
3
10500
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 closes unexpectedly and without any error message being displayed, or error messages written to the system logs. Visual Studio closes when I attempt...
0
7841
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7965
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3838
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
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 we have to send another system
0
1184
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.