Wybo Dekker <wybo(a)servalys.nl> writes:
> Hi,
>
> I have installed all of openlook (xview)
> But any precompiled binaries (such as /usr/openwin/bin/cmdtool)
> as well as my own developments using xview, when are executed say:
>
> bin>cmdtool
> XView warning: Cannot load font '-b&h-lucida-medium-r-*-*-*-120-*-*-*-*-*-*' (Font package)
> XView warning: Cannot load font '-b&h-lucida-medium-r-normal-sans-*-120-*-*-*-*-*-*' (Font package)
> XView error: Cannot open connection to window server: :0.0 (Server package)
>
> which is fatal.
> I had no problems with SuSE-9.0
You probably need to install the correct font package:
xorg-x11-fonts-75dpi-6.8.1-15
contained in either:
suse/i586/xorg-x11-fonts-75dpi-6.8.1-15.i586.rpm
suse/x86_64/xorg-x11-fonts-75dpi-6.8.1-15.x86_64.rpm
(I say probably, because that might not be all that is wrong, but it
is a start :-)
Hi,
I have installed all of openlook (xview)
But any precompiled binaries (such as /usr/openwin/bin/cmdtool)
as well as my own developments using xview, when are executed say:
bin>cmdtool
XView warning: Cannot load font '-b&h-lucida-medium-r-*-*-*-120-*-*-*-*-*-*' (Font package)
XView warning: Cannot load font '-b&h-lucida-medium-r-normal-sans-*-120-*-*-*-*-*-*' (Font package)
XView error: Cannot open connection to window server: :0.0 (Server package)
which is fatal.
I had no problems with SuSE-9.0
--
Wybo
Davi de Castro Reis <davicastro(a)terra.com.br> writes:
> Hi guys,
>
> Does anyone know how to release all the memory allocated by STL?
> Just let me say why I want to do this. The software I am working on uses
> STL a lot in its first phase. I allocate nearly a 1GB of memory in a lot
> of different STL containers.
What kind of containers and how big are the objects in them?
> In the second phase of the software, I clear() all these container and
> start a custom algorithm that also uses a lot of memory. But the STL
> memory pool is holding quite a lot of memory, and I run out of memory in
> the middle of the algorithm.
What kind of memory allocation do you use in the second phase?
> If I run the two phases of the software in different binaries,
> everything is ok and my algorithm fits in memory. There are no leaks
> that I am aware of in the software (I've already made a lot of valgrind
> checks).
> I do not want to use -D__USE_MALLOC or GLIBCPP_FORCE_NEW=1, since I do
> want the performance of the STL memory pool. I just want to release this
> pool during one of the phases of my software.
The pool is only used for nodes smaller than 128 bytes, and as you
have noticed there is no public/documented/legal way to release memory
from the pool. Therefore if you, for example, are using a list, map,
or set with small nodes your only choice is to write your own custom
allocator. Copying the pool allocator template from:
/usr/include/g++/bits/stl_alloc.h
and adding a member function to deallocate the pool to your version
might be an acceptable solution.
Before you get that far, are you sure that your memory is coming from
the pool? If you are using vectors for instance, you probably are
allocating much larger blocks and totally bypassing the pool. If so,
then you might want to know about the "swap trick" (Item 17 in Scott
Meyers' "Effective STL"):
vector<Stuff> big_vector;
...
... // use big_vector
...
vector<Stuff>().swap(big_vector); // clear big_vector and
// minimize its capacity
because clear() does not decrease the capacity of a vector or
deallocate any memory. Since you are apparently already deep enough
into your problem to have found the "pool" I really hesitate to
suggest this, but I just finished reading "Effective STL" so I
couldn't keep my mouth shut :-)
Hi guys,
Does anyone know how to release all the memory allocated by STL?
Just let me say why I want to do this. The software I am working on uses
STL a lot in its first phase. I allocate nearly a 1GB of memory in a lot
of different STL containers.
In the second phase of the software, I clear() all these container and
start a custom algorithm that also uses a lot of memory. But the STL
memory pool is holding quite a lot of memory, and I run out of memory in
the middle of the algorithm.
If I run the two phases of the software in different binaries,
everything is ok and my algorithm fits in memory. There are no leaks
that I am aware of in the software (I've already made a lot of valgrind
checks).
I do not want to use -D__USE_MALLOC or GLIBCPP_FORCE_NEW=1, since I do
want the performance of the STL memory pool. I just want to release this
pool during one of the phases of my software.
Thanks in advance,
Davi de Castro Reis
On SLES 64 there are two versions of the library libpthread.a -
/usr/lib64/libpthread.a & /usr/lib64/nptl/libpthread.a.
What's the difference?
I'm guessing the later maybe implements the Native POSIX Thread Library
while the former uses what? ? (LinuxThreads?, Next Generation POSIX
Threads?).
Rgds,
Simon
<linuxdev(a)sptc.net> writes:
> Hello,
> I am trying to write a program in C++ and I need to check to see if a
> directory exists, if not create it, move a file and verify that all works
> well. How do I go about this in Linux?
To check if a directory exists:
extern "C" {
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
}
#include <iostream>
using namespace std;
struct stat dir_stat;
int main(int argc, char* argv[]) {
stat(argv[1], &dir_stat);
if (S_ISDIR(dir_stat.st_mode)) {
cout << argv[1] << " is a directory" << endl;
} else {
cout << argv[1] << " is a NOT directory" << endl;
}
}
markgray@soyo:/ARK/BOOKS/Efficient_c++> g++ -Wall dircheck.cpp
markgray@soyo:/ARK/BOOKS/Efficient_c++> ./a.out /tmp
/tmp is a directory
markgray@soyo:/ARK/BOOKS/Efficient_c++> ./a.out dircheck.cpp
dircheck.cpp is a NOT directory
markgray@soyo:/ARK/BOOKS/Efficient_c++> ./a.out no_such_thing
no_such_thing is a NOT directory
markgray@soyo:/ARK/BOOKS/Efficient_c++>
See man 2 stat. (You will be advised of course to check out the other
macros described in the man page).
To create a directory, see man 2 mkdir.
To move a file, see man 2 rename.
Hope this helps.
[snip]
Hello,
I am trying to write a program in C++ and I need to check to see if a
directory exists, if not create it, move a file and verify that all works
well. How do I go about this in Linux?
This is a slightly better description:
I am reading a running a program and passing a filename of a binary file as a
command line argument. In this file I extract information that will be
stored in a database, and then the file will be moved to a certain directory
for usage by another application.
Where I put the file depends on information I get from the DB. The base
directory will be the same but subdirectories will be different. Therefore,
I must check to see if the directory and file exists, if not I create the
directory and then move the file from the location specified by the command
line arguments to the new location.
Any help will be appreciated. Again, please make it simple. I am still a bit
ignorant in the C++ world (especially in Linux).
Using SuSE 9.1 Pro, gcc-3.3.3-41
Thanks,
DC
Hi,
I am running Suse 9.2.
I am trying to install the Ximian connector 2.1.1 for Ximian
Evolution 2.0.1 but after untar, when I run a ./configure, I get the
error given below. Can you tell me from where I can get the Evolution
development libraries.
################################################################################
riazrahaman:/home/riazrahaman/temp/ximian-connector-2.1.1 # ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking Evolution version... configure: error: Evolution development
libraries not installed
################################################################################
regards,
Srivatsa Krishnaswamy
--
Srivatsa Krishnaswamy <vatsak(a)hp.com>
HP
This PS1 is cool, but I have several SuSe Boxes. I'd like my PS1 to
include my hostname too, any help? TIA!
#v+
PROMPT_COMMAND='PS1=`if test "$UID" = 0 ; then \
echo "\[\033[33;40m\]\u:\`pwd -P\` #\[\033[0m\] " ; \
else \
echo "\[\033[32;40m\]\u:\`pwd -P\` $\[\033[0m\] " ; \
fi `'
#v-