It doesn't want to compile,
the Makefile is broken, in fact,
the .cc extension is inappropriate,
it should be .cpp since the compile
thinks it's a C file and doesn't recognize :: and class.
g++ main.cc
Does not work neither, the problem is that
#include <allocator.h>
I'm unable to find a way to safely change
the include directory, maybe you can help.
I cannot be root, so I can't install it under
/usr/include, so I have to find a way to change
the include params after g++ - ?????
> It doesn't want to compile,
> the Makefile is broken, in fact,
At the moment, this may be true for most systems.
The Makefile needs to be configure for the local machine.
Inside of the Makefile the STLHOME variable needs to
be set to point to the local home of the STLPORT library
installation. Other varibles need to be set for the system's
individual installation senarios.
Eventually this system may have a configure file if it gets to
be popular and there is general interest.
> the .cc extension is inappropriate,
> it should be .cpp since the compile
> thinks it's a C file and doesn't recognize :: and class.
The gnu compilers should not have the problem you
describe. which version of g++ are you using? is your
g++ the same as your gcc?
You may need to install STLPORT, although I believe the
allocator will run without it?
marc
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
>> It doesn't want to compile,
>> the Makefile is broken, in fact,
>At the moment, this may be true for most systems.
>The Makefile needs to be configure for the local machine.
>Inside of the Makefile the STLHOME variable needs to
>be set to point to the local home of the STLPORT library
>installation. Other varibles need to be set for the >system's individual installation senarios.
First of all, I'm not sure what is the variable
for the include directory.
All I know, is that I CANNOT install it under
/usr/include by anyway, I cannot be ROOT
on a University LAN and Allocator users
shouldn't need to be ROOT to install it.
>Eventually this system may have a configure file if it >gets to be popular and there is general interest.
It should have a default configuration for any platform
by default.
>> the .cc extension is inappropriate,
>> it should be .cpp since the compile
>> thinks it's a C file and doesn't recognize :: and class.
>The gnu compilers should not have the problem you
>describe. which version of g++ are you using? is your
>g++ the same as your gcc?
That's is if you use gcc,
if you use g++ he cannot find <allocator.h>,
since it's not in /usr/include.
You must change this to <marc/allocator.h>
or "allocator.h"
You may need to install STLPORT, although I believe the
allocator will run without it?
I have no clue which STLport is available,
it's simply gcc as is.
Fred.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I modified your files and release a new version,
with #include "allocator.h" instead of
#include <allocator.h>
I also included a project.h,
so you don't need to compile each file one by one.
The following is the output on SunOS 5.7 using g++:
(i.e. gcc for C++)
marc 4:48pm >ls
allocator.cpp arena.h global_defs.h semaphore.h
allocator.h bit_vector.cpp main.cpp shared_memory.cpp
arena.cpp bit_vector.h project.h shared_memory.h
marc 4:48pm >g++ main.cpp
In file included from main.cpp:14:
allocator.h:34: `allocator' redeclared as different kind of symbol
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/../../../../include/g++-3/stl
_alloc.h:729: previous declaration of `template <class _Tp> class allocator<_Tp>
'
In file included from project.h:13,
from main.cpp:16:
allocator.cpp: In method `allocator::Chunk::Chunk(const int &, const int &)':
allocator.cpp:56: `_STL' undeclared (first use this function)
allocator.cpp:56: (Each undeclared identifier is reported only once
allocator.cpp:56: for each function it appears in.)
allocator.cpp:56: parse error before `::'
allocator.cpp:57: parse error before `::'
allocator.cpp:65: `old_options' undeclared (first use this function)
marc 4:48pm >
As you can see your class allocator is conflicting
with a very well known allocator template class
provided by Sun ?!?
Fred.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I didn't replace /usr/include/semaphore.h
with your version, else it might conflict badly !
You shouldn't use <semaphore.h>
this is a reserved name for compiler specific
implementation !
A better approach would be "semaphore.h"
or <marc/semaphore.h>
Samething with other include file.
Here's the output of Watcom C++ 10.6
cc main.cc
main.cc(5): Error! E059: (col 20) unable to open 'sys/ipc.h'
main.cc(6): Error! E059: (col 20) unable to open 'sys/shm.h'
main.cc(11): Error! E059: (col 17) unable to open 'vector'
/usr/include/allocator.h(25): Error! E059: (col 17) unable to open 'bitset'
/usr/include/allocator.h(25): Note! N393: (col 17) included from main.cc(15)
/usr/include/bit_vector.h(27): Error! E059: (col 17) unable to open 'bitset'
/usr/include/bit_vector.h(27): Note! N393: (col 17) included from /usr/include/allocator.h(30)
/usr/include/bit_vector.h(27): Note! N393: (col 17) included from main.cc(15)
/usr/include/bit_vector.h(31): Error! E336: (col 25) declaration specifiers are required to declare 'namespace'
/usr/include/bit_vector.h(31): Error! E498: (col 11) syntax error before 'bit_vec_space'; probable cause: incorrectly spelled type name
/usr/include/arena.h(28): Error! E059: (col 20) unable to open 'sys/sem.h'
/usr/include/arena.h(28): Note! N393: (col 20) included from /usr/include/allocator.h(31)
/usr/include/arena.h(28): Note! N393: (col 20) included from main.cc(15)
/usr/include/arena.h(29): Error! E059: (col 20) unable to open 'sys/ipc.h'
/usr/include/arena.h(30): Error! E059: (col 20) unable to open 'sys/shm.h'
/usr/include/arena.h(36): Error! E059: (col 17) unable to open 'bitset'
/usr/watcom/10.6/usr/include/semaphore.h(48): Error! E029: (col 9) symbol '__kererr' has not been declared
/usr/watcom/10.6/usr/include/semaphore.h(48): Note! N393: (col 9) included from /usr/include/arena.h(40)
/usr/watcom/10.6/usr/include/semaphore.h(48): Note! N393: (col 9) included from /usr/include/allocator.h(31)
/usr/watcom/10.6/usr/include/semaphore.h(48): Note! N393: (col 9) included from main.cc(15)
/usr/watcom/10.6/usr/include/semaphore.h(59): Error! E029: (col 9) symbol '__kererr' has not been declared
/usr/watcom/10.6/usr/include/semaphore.h(70): Error! E029: (col 9) symbol '__kererr' has not been declared
/usr/include/shared_memory.h(28): Error! E059: (col 20) unable to open 'sys/ipc.h'
/usr/include/shared_memory.h(28): Note! N393: (col 20) included from /usr/include/arena.h(42)
/usr/include/shared_memory.h(28): Note! N393: (col 20) included from /usr/include/allocator.h(31)
/usr/include/shared_memory.h(28): Note! N393: (col 20) included from main.cc(15)
/usr/include/shared_memory.h(29): Error! E059: (col 20) unable to open 'sys/shm.h'
/usr/include/shared_memory.h(34): Error! E059: (col 18) unable to open 'cstdlib'
/usr/include/shared_memory.h(40): Error! E336: (col 21) declaration specifiers are required to declare 'namespace'
/usr/include/shared_memory.h(40): Error! E498: (col 11) syntax error before 'mem_space'; probable cause: incorrectly spelled type name
main.cc(17): Error! E121: (col 18) syntax error
main.cc(18): Error! E133: (col 18) too many errors: compilation aborted
Fred.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
>Which UNIX platform does QNX 4.25 work on? I dont
>understand what OS your are compiling on?
Under what Windows does Windows run on ?
Your question doesn't make any sense at all.
QNX which was called "Quick Unix"
in the 80's before At&t lawyers complained
is a MicroKernel OS Unix Compatible by itself
for Hard Real-Time application.
after renaming main.cpp in 1.02 to main.cc
cc main.cc
main.cc(5): Error! E059: (col 20) unable to open 'sys/ipc.h'
main.cc(6): Error! E059: (col 20) unable to open 'sys/shm.h'
main.cc(11): Error! E059: (col 17) unable to open 'vector'
allocator.h(27): Error! E059: (col 17) unable to open 'bitset'
allocator.h(27): Note! N393: (col 17) included from main.cc(14)
bit_vector.h(29): Error! E059: (col 17) unable to open 'bitset'
bit_vector.h(29): Note! N393: (col 17) included from allocator.h(31)
bit_vector.h(29): Note! N393: (col 17) included from main.cc(14)
bit_vector.h(33): Error! E336: (col 25) declaration specifiers are required to declare 'namespace'
bit_vector.h(33): Error! E498: (col 11) syntax error before 'bit_vec_space'; probable cause: incorrectly spelled type name
arena.h(30): Error! E059: (col 20) unable to open 'sys/sem.h'
arena.h(30): Note! N393: (col 20) included from allocator.h(32)
arena.h(30): Note! N393: (col 20) included from main.cc(14)
arena.h(31): Error! E059: (col 20) unable to open 'sys/ipc.h'
arena.h(32): Error! E059: (col 20) unable to open 'sys/shm.h'
arena.h(38): Error! E059: (col 17) unable to open 'bitset'
semaphore.h(26): Error! E059: (col 20) unable to open 'sys/ipc.h'
semaphore.h(26): Note! N393: (col 20) included from arena.h(41)
semaphore.h(26): Note! N393: (col 20) included from allocator.h(32)
semaphore.h(26): Note! N393: (col 20) included from main.cc(14)
semaphore.h(27): Error! E059: (col 20) unable to open 'sys/sem.h'
semaphore.h(58): Error! E336: (col 21) declaration specifiers are required to declare 'namespace'
semaphore.h(58): Error! E498: (col 11) syntax error before 'Semaphore'; probable cause: incorrectly spelled type name
shared_memory.h(30): Error! E059: (col 20) unable to open 'sys/ipc.h'
shared_memory.h(30): Note! N393: (col 20) included from arena.h(43)
shared_memory.h(30): Note! N393: (col 20) included from allocator.h(32)
shared_memory.h(30): Note! N393: (col 20) included from main.cc(14)
shared_memory.h(31): Error! E059: (col 20) unable to open 'sys/shm.h'
shared_memory.h(36): Error! E059: (col 18) unable to open 'cstdlib'
shared_memory.h(42): Error! E336: (col 21) declaration specifiers are required to declare 'namespace'
shared_memory.h(42): Error! E498: (col 11) syntax error before 'mem_space'; probable cause: incorrectly spelled type name
semaphore.h(26): Error! E133: (col 20) too many errors: compilation aborted
semaphore.h(26): Note! N393: (col 20) included from project.h(6)
semaphore.h(26): Note! N393: (col 20) included from main.cc(16)
There is no STL under Watcom C++ 10.6,
some folks tried to port some part of STL
to that compiler, but they faced some bugs
with part of it.
Fred.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
there is no such file under /usr/include
Samething for
#include <bitset>
#include <sys/ipc>
#include <sys/shm>
#include <sys/sem.h>
namespace is an unknown keyword !
This is why I don't want to use STL, namespace
and other new stuff in my library, since those stuff
are not supported by relatively "recent" compilers.
Fred.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Has anyone tested this allocator on other platforms besides Linux? It should be reasonably portable on other UNIX
platforms such as SunOS and HPOS.
I could use some feedback from platforms to which I don't
have access.
marc
It doesn't want to compile,
the Makefile is broken, in fact,
the .cc extension is inappropriate,
it should be .cpp since the compile
thinks it's a C file and doesn't recognize :: and class.
g++ main.cc
Does not work neither, the problem is that
#include <allocator.h>
I'm unable to find a way to safely change
the include directory, maybe you can help.
I cannot be root, so I can't install it under
/usr/include, so I have to find a way to change
the include params after g++ - ?????
setenv INCLUDE=/usr/include:/home/..../allocator/include
doesn't work neither.
Fred.
> It doesn't want to compile,
> the Makefile is broken, in fact,
At the moment, this may be true for most systems.
The Makefile needs to be configure for the local machine.
Inside of the Makefile the STLHOME variable needs to
be set to point to the local home of the STLPORT library
installation. Other varibles need to be set for the system's
individual installation senarios.
Eventually this system may have a configure file if it gets to
be popular and there is general interest.
> the .cc extension is inappropriate,
> it should be .cpp since the compile
> thinks it's a C file and doesn't recognize :: and class.
The gnu compilers should not have the problem you
describe. which version of g++ are you using? is your
g++ the same as your gcc?
You may need to install STLPORT, although I believe the
allocator will run without it?
marc
>> It doesn't want to compile,
>> the Makefile is broken, in fact,
>At the moment, this may be true for most systems.
>The Makefile needs to be configure for the local machine.
>Inside of the Makefile the STLHOME variable needs to
>be set to point to the local home of the STLPORT library
>installation. Other varibles need to be set for the >system's individual installation senarios.
First of all, I'm not sure what is the variable
for the include directory.
All I know, is that I CANNOT install it under
/usr/include by anyway, I cannot be ROOT
on a University LAN and Allocator users
shouldn't need to be ROOT to install it.
>Eventually this system may have a configure file if it >gets to be popular and there is general interest.
It should have a default configuration for any platform
by default.
>> the .cc extension is inappropriate,
>> it should be .cpp since the compile
>> thinks it's a C file and doesn't recognize :: and class.
>The gnu compilers should not have the problem you
>describe. which version of g++ are you using? is your
>g++ the same as your gcc?
That's is if you use gcc,
if you use g++ he cannot find <allocator.h>,
since it's not in /usr/include.
You must change this to <marc/allocator.h>
or "allocator.h"
You may need to install STLPORT, although I believe the
allocator will run without it?
I have no clue which STLport is available,
it's simply gcc as is.
Fred.
I modified your files and release a new version,
with #include "allocator.h" instead of
#include <allocator.h>
I also included a project.h,
so you don't need to compile each file one by one.
The following is the output on SunOS 5.7 using g++:
(i.e. gcc for C++)
marc 4:48pm >ls
allocator.cpp arena.h global_defs.h semaphore.h
allocator.h bit_vector.cpp main.cpp shared_memory.cpp
arena.cpp bit_vector.h project.h shared_memory.h
marc 4:48pm >g++ main.cpp
In file included from main.cpp:14:
allocator.h:34: `allocator' redeclared as different kind of symbol
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/../../../../include/g++-3/stl
_alloc.h:729: previous declaration of `template <class _Tp> class allocator<_Tp>
'
In file included from project.h:13,
from main.cpp:16:
allocator.cpp: In method `allocator::Chunk::Chunk(const int &, const int &)':
allocator.cpp:56: `_STL' undeclared (first use this function)
allocator.cpp:56: (Each undeclared identifier is reported only once
allocator.cpp:56: for each function it appears in.)
allocator.cpp:56: parse error before `::'
allocator.cpp:57: parse error before `::'
allocator.cpp:65: `old_options' undeclared (first use this function)
marc 4:48pm >
As you can see your class allocator is conflicting
with a very well known allocator template class
provided by Sun ?!?
Fred.
I didn't replace /usr/include/semaphore.h
with your version, else it might conflict badly !
You shouldn't use <semaphore.h>
this is a reserved name for compiler specific
implementation !
A better approach would be "semaphore.h"
or <marc/semaphore.h>
Samething with other include file.
Here's the output of Watcom C++ 10.6
cc main.cc
main.cc(5): Error! E059: (col 20) unable to open 'sys/ipc.h'
main.cc(6): Error! E059: (col 20) unable to open 'sys/shm.h'
main.cc(11): Error! E059: (col 17) unable to open 'vector'
/usr/include/allocator.h(25): Error! E059: (col 17) unable to open 'bitset'
/usr/include/allocator.h(25): Note! N393: (col 17) included from main.cc(15)
/usr/include/bit_vector.h(27): Error! E059: (col 17) unable to open 'bitset'
/usr/include/bit_vector.h(27): Note! N393: (col 17) included from /usr/include/allocator.h(30)
/usr/include/bit_vector.h(27): Note! N393: (col 17) included from main.cc(15)
/usr/include/bit_vector.h(31): Error! E336: (col 25) declaration specifiers are required to declare 'namespace'
/usr/include/bit_vector.h(31): Error! E498: (col 11) syntax error before 'bit_vec_space'; probable cause: incorrectly spelled type name
/usr/include/arena.h(28): Error! E059: (col 20) unable to open 'sys/sem.h'
/usr/include/arena.h(28): Note! N393: (col 20) included from /usr/include/allocator.h(31)
/usr/include/arena.h(28): Note! N393: (col 20) included from main.cc(15)
/usr/include/arena.h(29): Error! E059: (col 20) unable to open 'sys/ipc.h'
/usr/include/arena.h(30): Error! E059: (col 20) unable to open 'sys/shm.h'
/usr/include/arena.h(36): Error! E059: (col 17) unable to open 'bitset'
/usr/watcom/10.6/usr/include/semaphore.h(48): Error! E029: (col 9) symbol '__kererr' has not been declared
/usr/watcom/10.6/usr/include/semaphore.h(48): Note! N393: (col 9) included from /usr/include/arena.h(40)
/usr/watcom/10.6/usr/include/semaphore.h(48): Note! N393: (col 9) included from /usr/include/allocator.h(31)
/usr/watcom/10.6/usr/include/semaphore.h(48): Note! N393: (col 9) included from main.cc(15)
/usr/watcom/10.6/usr/include/semaphore.h(59): Error! E029: (col 9) symbol '__kererr' has not been declared
/usr/watcom/10.6/usr/include/semaphore.h(70): Error! E029: (col 9) symbol '__kererr' has not been declared
/usr/include/shared_memory.h(28): Error! E059: (col 20) unable to open 'sys/ipc.h'
/usr/include/shared_memory.h(28): Note! N393: (col 20) included from /usr/include/arena.h(42)
/usr/include/shared_memory.h(28): Note! N393: (col 20) included from /usr/include/allocator.h(31)
/usr/include/shared_memory.h(28): Note! N393: (col 20) included from main.cc(15)
/usr/include/shared_memory.h(29): Error! E059: (col 20) unable to open 'sys/shm.h'
/usr/include/shared_memory.h(34): Error! E059: (col 18) unable to open 'cstdlib'
/usr/include/shared_memory.h(40): Error! E336: (col 21) declaration specifiers are required to declare 'namespace'
/usr/include/shared_memory.h(40): Error! E498: (col 11) syntax error before 'mem_space'; probable cause: incorrectly spelled type name
main.cc(17): Error! E121: (col 18) syntax error
main.cc(18): Error! E133: (col 18) too many errors: compilation aborted
Fred.
Fred,
Which UNIX platform does QNX 4.25 work on? I dont
understand what OS your are compiling on?
I was under the impression Watcom was a Microsoft
OS compiler.
marc
>Which UNIX platform does QNX 4.25 work on? I dont
>understand what OS your are compiling on?
Under what Windows does Windows run on ?
Your question doesn't make any sense at all.
QNX which was called "Quick Unix"
in the 80's before At&t lawyers complained
is a MicroKernel OS Unix Compatible by itself
for Hard Real-Time application.
http://www.qnx.com/
>I was under the impression Watcom was a Microsoft
>OS compiler.
Watcom was own by Watcom, until Sybex bought it.
So, Watcom is manufactured by Sybex,
which is a competitor to Borland/Imprise
and Microsoft.
It's the only compiler working under QNX 4.25,
QNX6/RtP will use GCC however.
http://get.qnx.com/
So finally,
just change your include files to the local
directory, so I can try it out!
Fred.
after renaming main.cpp in 1.02 to main.cc
cc main.cc
main.cc(5): Error! E059: (col 20) unable to open 'sys/ipc.h'
main.cc(6): Error! E059: (col 20) unable to open 'sys/shm.h'
main.cc(11): Error! E059: (col 17) unable to open 'vector'
allocator.h(27): Error! E059: (col 17) unable to open 'bitset'
allocator.h(27): Note! N393: (col 17) included from main.cc(14)
bit_vector.h(29): Error! E059: (col 17) unable to open 'bitset'
bit_vector.h(29): Note! N393: (col 17) included from allocator.h(31)
bit_vector.h(29): Note! N393: (col 17) included from main.cc(14)
bit_vector.h(33): Error! E336: (col 25) declaration specifiers are required to declare 'namespace'
bit_vector.h(33): Error! E498: (col 11) syntax error before 'bit_vec_space'; probable cause: incorrectly spelled type name
arena.h(30): Error! E059: (col 20) unable to open 'sys/sem.h'
arena.h(30): Note! N393: (col 20) included from allocator.h(32)
arena.h(30): Note! N393: (col 20) included from main.cc(14)
arena.h(31): Error! E059: (col 20) unable to open 'sys/ipc.h'
arena.h(32): Error! E059: (col 20) unable to open 'sys/shm.h'
arena.h(38): Error! E059: (col 17) unable to open 'bitset'
semaphore.h(26): Error! E059: (col 20) unable to open 'sys/ipc.h'
semaphore.h(26): Note! N393: (col 20) included from arena.h(41)
semaphore.h(26): Note! N393: (col 20) included from allocator.h(32)
semaphore.h(26): Note! N393: (col 20) included from main.cc(14)
semaphore.h(27): Error! E059: (col 20) unable to open 'sys/sem.h'
semaphore.h(58): Error! E336: (col 21) declaration specifiers are required to declare 'namespace'
semaphore.h(58): Error! E498: (col 11) syntax error before 'Semaphore'; probable cause: incorrectly spelled type name
shared_memory.h(30): Error! E059: (col 20) unable to open 'sys/ipc.h'
shared_memory.h(30): Note! N393: (col 20) included from arena.h(43)
shared_memory.h(30): Note! N393: (col 20) included from allocator.h(32)
shared_memory.h(30): Note! N393: (col 20) included from main.cc(14)
shared_memory.h(31): Error! E059: (col 20) unable to open 'sys/shm.h'
shared_memory.h(36): Error! E059: (col 18) unable to open 'cstdlib'
shared_memory.h(42): Error! E336: (col 21) declaration specifiers are required to declare 'namespace'
shared_memory.h(42): Error! E498: (col 11) syntax error before 'mem_space'; probable cause: incorrectly spelled type name
semaphore.h(26): Error! E133: (col 20) too many errors: compilation aborted
semaphore.h(26): Note! N393: (col 20) included from project.h(6)
semaphore.h(26): Note! N393: (col 20) included from main.cc(16)
There is no STL under Watcom C++ 10.6,
some folks tried to port some part of STL
to that compiler, but they faced some bugs
with part of it.
Fred.
As you can see,
#include <cstdlib> is invalid
the correct old syntax was:
#include <stdlib.h>
#include <vector> is invalid
there is no such file under /usr/include
Samething for
#include <bitset>
#include <sys/ipc>
#include <sys/shm>
#include <sys/sem.h>
namespace is an unknown keyword !
This is why I don't want to use STL, namespace
and other new stuff in my library, since those stuff
are not supported by relatively "recent" compilers.
Fred.