473,785 Members | 3,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

including a lib header file

Hi
is it right to have a line like
#include <path/to/header.hfor a library on my system, in my header
file and use some functions provided by this library in the
implementation file (file.cpp) inside a class with out declaring those
functions in the class declaration in the header file?

thanks
Jul 22 '06
11 2812
Howard Gardner wrote:
mlimber wrote:
Gary Wessle wrote:
It is a linker error, and it appears that you are not linking all the
libraries you need to build this program. However, this is not a C++
*language* question (the topic of this forum). You should ask on
newsgroup that deals with your development platform or the library in
question. See this FAQ for what is on-topic here and for some ideas of
where else you could ask:

He's struggling through the standard C++ interface to a library:
includes and links. It *is* a c++ language issue.
I grant that there is more gray area than FAQ 5.9 allows when read
strictly (and you'll see that I respond to questions here accordingly),
but ISTM that he's dealing with how to use a third-party library in a
particular development environment. That's no more a C++ language
question than, say, how to statically link an MFC app on Windows.
The answer is the same for every library/compiler combination in the
known universe: "The linker is missing library files. RTF compiler M to
learn what library files are and how to link them, then RTF library M to
learn which files you need for this library." Even if he were to find a
group dedicated to using this library with this compiler, the answer is
still "RTFMs."
The OP should ask his question in a newsgroup or other forum dedicated
either to his development environment (UNIX and/or gcc) or to the
third-party library in question to get that answer (or a more helpful
one, such as "Add -lgslcblas -lm to your link line because ..."). The
fact that the minimal answer is always RTM doesn't mean that this is
the appropriate place for him to receive that answer, and the OP's
follow-up question to your answer seems to illustrate that answering
non-topical questions encourages more of the same.

Cheers! --M

Jul 23 '06 #11
mlimber wrote:
Howard Gardner wrote:
>mlimber wrote:
>>Gary Wessle wrote:
It is a linker error, and it appears that you are not linking all the
libraries you need to build this program. However, this is not a C++
*language* question (the topic of this forum). You should ask on
newsgroup that deals with your development platform or the library in
question. See this FAQ for what is on-topic here and for some ideas of
where else you could ask:
He's struggling through the standard C++ interface to a library:
includes and links. It *is* a c++ language issue.

I grant that there is more gray area than FAQ 5.9 allows when read
strictly (and you'll see that I respond to questions here accordingly),
but ISTM that he's dealing with how to use a third-party library in a
particular development environment. That's no more a C++ language
question than, say, how to statically link an MFC app on Windows.
>The answer is the same for every library/compiler combination in the
known universe: "The linker is missing library files. RTF compiler M to
learn what library files are and how to link them, then RTF library M to
learn which files you need for this library." Even if he were to find a
group dedicated to using this library with this compiler, the answer is
still "RTFMs."

The OP should ask his question in a newsgroup or other forum dedicated
either to his development environment (UNIX and/or gcc) or to the
third-party library in question to get that answer (or a more helpful
one, such as "Add -lgslcblas -lm to your link line because ..."). The
fact that the minimal answer is always RTM doesn't mean that this is
the appropriate place for him to receive that answer, and the OP's
follow-up question to your answer seems to illustrate that answering
non-topical questions encourages more of the same.

Cheers! --M
I answered the on topic question. I ignored the off topic. See how that
works?
Jul 23 '06 #12

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

Similar topics

1
2774
by: Jim Mesara | last post by:
I have the following file structure: / header.asp test.asp /subDir testpage.asp /images I would like to have header.asp to be usable from all directories.
11
1944
by: cppaddict | last post by:
Say that your CustomClass.h header files requires #include <string> Now say that your CustomClass.cpp file also requires string. Is it good form to repeat the <string> include to make the dependency explicit, or do just allow the include to be make implicitly through the .h include? That is, should the header of your .cpp file be: #include "CustomClass.h"
3
1785
by: Miguel | last post by:
I have a header file that I want to share among various files, and I use: #ifndef UTIL_H_ #define UTIL_H_ file contents #endif
8
3052
by: nrhayyal | last post by:
Hi c++ Gurus, Need your blessing. while testing few aspects with respect to header file inclusions, i observed few things which i would like to share with you. i have a file sqlca.h in which a structure sqlca is declared. i included this file as a soft link in /usr/include. the soft link is as follows: sqlca.h -> /usr/opt/db2_08_01/include64/sqlca.h
6
1616
by: Al-Burak | last post by:
I have a class which only purpose is to provide services to a variety of classes in other files. The 'manipulator' class is aware of the other classes only because the header files have been include in its header file. However, there are times when some of the other classes are not and will not be dealt with, thus the need to include the header files does not arrive. To handle this, I have used compiler preprocessors to prevent the...
4
6958
by: 'Mani | last post by:
Hi, This is just a generic question, where i want to know what is the difference in including a header file in a .h file and .cpp file. I have a class called MyClass (MyClass.h & MyClass.cpp). There is another class (OtherClass.h & OtherClass.cpp) OtherClass.cpp has a forward declaration to a class called 'Calc' which is in the namespace called 'Utils' like below:
1
1757
by: Martin Mücke | last post by:
I got a website consisting of about 150 php pages. The site uses a frameless table based design. Header and menu are always the same and therefore should be extracted. At the moment I got a "frame" (not a real html frame, more like "framework"), that contains my menu and header content. In this php page I dynamically include all content pages. Downsides: All pages got the same meta tags. Now I am looking for a better solution. I...
8
4595
by: nguillot | last post by:
Hello. If I have the following classes: class B {}; typedef B tB; if A is: class A
3
2574
by: KIRAN | last post by:
Hello all, My question is about the way of including header files(*.h) in source files (*.c) I have three folders, -build ( for project makefiles) -include ( for *.h files) -src (for *.c files). I know that there are two ways of specifying include path of header files
0
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10315
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10085
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5379
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4045
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

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.