d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Can Any 1 Explain This Error On Opensuse C++
12Next
Add Reply New Topic New Poll
Member
Posts: 30,168
Joined: Jun 10 2010
Gold: 1,157.00
Jun 29 2013 07:21pm
line 30:47

error: expected ';', identifier or '(' before ' Bool'

Quote
/*
* Copyright (C) 2010 gonzoj
*
* Please check the CREDITS file for further information.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef TYPES_H_
#define TYPES_H_

typedef unsigned char byte;

typedef unsigned short word;

typedef unsigned int dword;

#ifndef INCLUDE_NCURSES
typedef enum { FALSE /*= 0*/, TRUE /*= 1*/ } bool;
#endif

#endif /* TYPES_H_ */
Member
Posts: 16,144
Joined: Mar 27 2008
Gold: 14,618.00
Jun 29 2013 07:35pm
maybe cuz bool is a keyword?

i don't know which compiler you use, but this code compiles on my gcc
it dosn't compile on my g++, cuz it says the bool is already defined

edit: if you rename bool to something different, it has no errors on my g++

edit2: at least in c99, the FALSE and TRUE statements are already defined as 0 and 1. i bet they didn't change that in c++. so i propose you to just skip this line

This post was edited by Richter on Jun 29 2013 07:38pm
Member
Posts: 30,168
Joined: Jun 10 2010
Gold: 1,157.00
Jun 29 2013 07:37pm
im not a big linux guy but i do know i have opensuse, i did sudo zypper install gcc47-c++

i cant name it something different because bool is defined in another cpp that its includes

edit how can i skiP?

This post was edited by gamemaste789 on Jun 29 2013 07:39pm
Member
Posts: 30,168
Joined: Jun 10 2010
Gold: 1,157.00
Jun 29 2013 07:38pm
its definded here

Quote

/*
* Copyright (C) 2010 gonzoj
*
* Please check the CREDITS file for further information.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef STRING_H_
#define STRING_H_

#include <unistd.h>

#include "util/types.h"

void string_random(unsigned, char, unsigned, char *);

size_t string_to_byte(const char *, byte *);

char * string_to_lower_case(char *);

char * string_to_upper_case(char *);

void string_split_lines(char *, int *);

char * string_new(char **, ...);

bool string_compare(char *, char *, bool);

bool string_is_numeric(char *);

char * string_format_time(int);

#endif /* STRING_H_ */


This post was edited by gamemaste789 on Jun 29 2013 07:41pm
Member
Posts: 16,144
Joined: Mar 27 2008
Gold: 14,618.00
Jun 29 2013 07:42pm
by skipping the line i mean you delete the line

but if you also support me the "cpp" file you want to compile, it's maybe easier to understand what you are doing

are you compiling with "gcc" or "g++"? (usually the exact version isn't that important, but imo it's important if gcc or g++. the gcc is a c compiler and the g++ a cpp, but the c++ also compiles c)
Member
Posts: 30,168
Joined: Jun 10 2010
Gold: 1,157.00
Jun 29 2013 07:47pm
well its a program, im trying to install and ./configure goes find and it throws me that error with make
Member
Posts: 16,144
Joined: Mar 27 2008
Gold: 14,618.00
Jun 29 2013 08:00pm
the configure usually runs without errors.
but sometimes there is the word "no" at the end of a line, when a library isn't found.

when i try to "make" the code, i also get errors (others, cuz i'm missing a dependency)
maybe when i have the dependency i can compile further till i get to your error message...

edit: soon i soon go to sleep ;)

edit2: i had to install autogen. now i'm at other dependency problems xD

edit3: had to install libc6-dev-i386 too

This post was edited by Richter on Jun 29 2013 08:22pm
Member
Posts: 30,168
Joined: Jun 10 2010
Gold: 1,157.00
Jun 29 2013 08:09pm
going through the log of ./configure

checking if gcc static flag -static works... no
checking for MD5_Init in -lssl... no
checking whether -lc should be explicitly linked in... no
checking if gcc static flag -static works... no
checking if gcc supports -fno-rtti -fno-exceptions... no
checking whether we are cross compiling... no
checking for sqrt... no

thats all the 1s, some of of them repeated

well the owner of this doesnt work on this any more...
its like 3-4 years old D:

where did u get libc6, i cant find it by zypper search

This post was edited by gamemaste789 on Jun 29 2013 08:19pm
Member
Posts: 16,144
Joined: Mar 27 2008
Gold: 14,618.00
Jun 29 2013 08:20pm
Quote (gamemaste789 @ 30 Jun 2013 03:09)

where did u get libc6, i cant find it by zypper search


i think you already have the libs. but not sure yet :)
i'm working on a 64bit machine, so i also have to install 32bit library stuff to compile 32bit apps
Member
Posts: 30,168
Joined: Jun 10 2010
Gold: 1,157.00
Jun 29 2013 08:24pm
ya.... im on 32bit
Go Back To Programming & Development Topic List
12Next
Add Reply New Topic New Poll