Hi all
Im having a problem im my class "utils". Im using linux slackware 8.0
(old? yes: so old).
i trying g++ (gnu c++ compiler) 3.1 and glib default of Slack 8.0.
I cant migrate this server now, but i need to compile my class in this
machine...
See my class:
#include <iostream>
#include <fstream>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
#include <dirent.h>
class utils {
public:
void utils::cutleft( char *str, unsigned int len);
void utils::strip(ch ar *str, char *st);
void utils::ltgt(cha r *str);
void utils::left(cha r *str, unsigned int len);
void utils::extract_ mail(char *str, char *retorno);
void utils::extract_ date(char *str, char *data);
void utils::split(ch ar *linha, int separador, unsigned int index);
void utils::tira_esp acos(std::strin g &str);
void utils::tira_esp acos(char *str);
int utils::linecoun t(char *filename);
bool utils::deltree( char *dirname);
bool utils::file_exi st(char *path);
bool utils::is_dir(c har *path);
};
See my problem:
[root@test:/app/proxy]# make
g++ -Wall -c -o ../lib/utils.o ../lib/utils.cpp
In file included from ../lib/utils.cpp:1:
.../lib/utils.h:20: `::string' undeclared (first use here)
.../lib/utils.h:20: `str' was not declared in this scope
.../lib/utils.h:20: variable or field `tira_espacos' declared void
.../lib/utils.h:20: declaration of `void utils::tira_esp acos(char *)'
.../lib/utils.h:21: conflicts with previous declaration `int
utils::tira_esp acos'
.../lib/utils.cpp: In method `void utils::apaga_li nha(char *, char *)':
.../lib/utils.cpp:218: template argument 1 is invalid
.../lib/utils.cpp:218: template argument 1 is invalid
.../lib/utils.cpp:218: template argument 2 is invalid
.../lib/utils.cpp:218: confused by earlier errors, bailing out
make: *** [../lib/utils.o] Error 1
If anyone can help-me, I will be perpetual grateful
Thanks 2 2438
Ludis wrote: Im having a problem im my class "utils". Im using linux slackware 8.0 (old? yes: so old). i trying g++ (gnu c++ compiler) 3.1 and glib default of Slack 8.0. I cant migrate this server now, but i need to compile my class in this machine...
See my class:
#include <iostream> #include <fstream> #include <vector> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <time.h> #include <dirent.h> class utils { public: void utils::cutleft( char *str, unsigned int len);
Drop the "utils::" prefices. They are unnecessary _inside_ the
class 'utils' definition.
All those 'char*' should probably be 'char const*'.
void utils::strip(ch ar *str, char *st); void utils::ltgt(cha r *str); void utils::left(cha r *str, unsigned int len); void utils::extract_ mail(char *str, char *retorno); void utils::extract_ date(char *str, char *data); void utils::split(ch ar *linha, int separador, unsigned int index); void utils::tira_esp acos(std::strin g &str);
You didn't include <string>. You need <string> to use 'std::string'.
void utils::tira_esp acos(char *str); int utils::linecoun t(char *filename); bool utils::deltree( char *dirname); bool utils::file_exi st(char *path); bool utils::is_dir(c har *path); };
See my problem:
[root@test:/app/proxy]# make g++ -Wall -c -o ../lib/utils.o ../lib/utils.cpp In file included from ../lib/utils.cpp:1: ../lib/utils.h:20: `::string' undeclared (first use here) ../lib/utils.h:20: `str' was not declared in this scope ../lib/utils.h:20: variable or field `tira_espacos' declared void ../lib/utils.h:20: declaration of `void utils::tira_esp acos(char *)' ../lib/utils.h:21: conflicts with previous declaration `int utils::tira_esp acos' ../lib/utils.cpp: In method `void utils::apaga_li nha(char *, char *)':
Where is this 'method'? Next time consider reading the FAQ,
especially section 5.
../lib/utils.cpp:218: template argument 1 is invalid ../lib/utils.cpp:218: template argument 1 is invalid ../lib/utils.cpp:218: template argument 2 is invalid ../lib/utils.cpp:218: confused by earlier errors, bailing out make: *** [../lib/utils.o] Error 1
V
Thanks Victor Bazarov
I got success in my compilation now. Really was a problem with includes
files... lol
In slackware 10.2 it compiled without these include, perhaps because I
have included it in another archives. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: yarmfelder |
last post by:
Hi all,
I noticed that with Slackware they don't include
mod_php in the latest distro. I also noticed some
talk on the web that there was an insecurity
issue with mod_php in a previous version of
Slackware.
So is this just a Slackware mishap or is there
a good reason to no longer permit PHP from
|
by: Angelo Della Penna |
last post by:
Hi all,
for anyone interested, I've just successfully installed Oracle 9iR2
(9.2.0.4.0) on Linux Slackware 9.0 (gcc-3.2.2, kernel 2.4.20).
Actually, the installation of base release 9.2.0.1.0 produced some
relink errors, fully resolved by patchset 9.2.0.4.0.
Best regards.
|
by: wibawanto |
last post by:
Can I install Posgresql on slackware linux? This package doesn't
include with slackware. I have visited on postgresql website, but it
only for Red Hat linux. Where can I get postgresql for Slack?
|
by: tevans |
last post by:
I'm using Slackware GNU/Linux 9.0 on an Intel PII 266 machine that's SMP
capable, but only with one CPU installed, and 64MB of RAM. It's
basically a small test system that I play around with in some free time
before installing things on my larger systems.
I am trying to do a fresh install of MySQL 4.0.14 (I removed the
previous 3.23.56 installation, including directory structure and
leftover components). I'm compiling with these options...
|
by: news |
last post by:
I just installed Slackware 10.1 Still need to install some missing
needed libraries, but I think that's unrelated.
Every time it boots up, or I try "/etc/rc.d/rc.mysqld start" I get
this:
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
mysqld ended
| |
by: Shridhar Daithankar |
last post by:
Hi,
I am trying to deploy drupal on my machine to play around with. Only to
discover to my horror that slackware ships with a php package that does not
include postgresql extension.
Frankly I am irritated. I don't want to compile any damn stuff. Slack has
worked so far for me but it's postgresql support is lamer than I could have
thought..
|
by: Fragemann |
last post by:
Hi all,
I installed Apache, enabled PHP and made sure that MySQL
starts when I boot up.
Now I am seeing a bizarre problem. The following HTML
produces the wrong response from PHP. How to fix?
<html>
<?
|
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...
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
|
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...
| |
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,...
|
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...
|
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();...
|
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...
|
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
| |