I have a case where the compiler is giving me an error:
./FOO.H: In member function
Bar<ItemType>::operator()(ItemType&)':
./FOO.H:447: error: `i_key' was not declared in this scope
Class bar is defined:
template <class ItemType>
class Bar public FuBar<ItemType, type_t>
And, i_key is defined as a protected member of FuBar:
template <class ItemType, class ThisType>
class FuBar : public Another<ItemType>, public RWTPtrorderedVector<ItemType>
.....
protected:
ThisType const & i_key;
I'm using g++ version 3.4.5.
g++ -MMD -MP -g -O3 -Wall -fpic -D__linux_x86_64__ -I.
-I/<other included dirs> -D_RWCONFIG_rmd -c Foo.C -o Foo.o
I can easily work around by adding a public accessor function, but this code does work on other company builds, but this is a simply access to a protected data element that should be visible from inheriting classes.
--
Jerry Feldman <gaf(a)blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
Hi all,
I tried to compile a linux kernel for my Palm Tungsten T with openSUSE 10.2
this weekend, but I didn't succeed.
At first I fetched the kernel trunk from Montavista, they also provide
a 'palmtt_defconfig' file to configure the kernel (2.6.20 I think) for the
Tungsten T.
Next I used Yast to search for and install the packages required to build the
kernel for the ARM architecture. Well, I realized, that openSUSE 10.2 just
ships a binutils package (cross-arm-binutils.rpm) for arm, but no
corresponding cross-compiler. I wonder if the cross-arm-binutils package is
of any use without a corresponding cross-compiler? Anyway, I did not want to
compile and setup my own toolchain and hoped, that openSUSE ships a toolchain
out of the box. While searching for this, I recongnized icecream and the fact
that openSUSE 10.2 also ships the cross-arm-gcc-icecream-backend package. It
seems like this was what I wanted. I examined the archive that was placed
in /usr/share/icecream-envs/cross-arm-gcc-icecream-backend_x86_64.tar.gz and
it seems like it holds the complete gcc toolchain to compile software for
arm.
After I installed an configured icecream, I configured the Montavista kernel:
# cd ~/Documents/linux-omap/
# make CC=icecc palmtt_defconfig
I checked the generated Makefile for ARCH and CROSS_COMPILE variables and they
seem to be set correctly:
...
SUBARCH := arm
...
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?= arm-linux-
...
Next I set ICECC_VERSION to the arm toolchain envrionment:
# export
ICECC_VERSION=/usr/share/icecream-envs/cross-arm-gcc-icecream-backend_x86_64.tar.gz
Then I started to compile the kernel using:
# make CC=icecc zImage
But I get the following output:
...
cc1: error: unrecognized command line option "-mlittle-endian"
cc1: error: unrecognized command line option "-mapcs"
cc1: error: unrecognized command line option "-mno-sched-prolog"
cc1: error: unrecognized command line option "-mabi=apcs-gnu"
arch/arm/kernel/asm-offsets.c:0: error: bad value (armv4t) for -march= switch
arch/arm/kernel/asm-offsets.c:0: error: bad value (arm9tdmi) for -mtune=
switch
...
make[1]: *** [arch/arm/kernel/asm-offsets.s] Fehler 1
make: *** [prepare0] Fehler 2
Well, it seems like icecream takes the wrong cross-compiler (cc1). So how do I
tell icecream that it should take the cc1 provided by
the 'cross-arm-gcc-icecream-backend_x86_64.tar.gz' archive to compile the
kernel? Setting it via the envrionment variable ICECC_VERSION does not work.
Kind regards,
Jörg.
------------------------------------------
Here's the full debug output of icecc:
# make CC=icecc zImage
ICECC[22178] 15:25:46: <building_local>
ICECC[22178] 15:25:46: </building_local: 3ms>
CHK include/linux/version.h
make[1]: »include/asm-arm/mach-types.h« ist bereits aktualisiert.
CHK include/linux/utsrelease.h
CC arch/arm/kernel/asm-offsets.s
ICECC[22255] 15:25:47:
native /var/cache/icecream/native/957f0fa42db6b790e7360d4150fd7305.tar.gz
ICECC[22255] 15:25:47: env:
x86_64 '/var/cache/icecream/native/957f0fa42db6b790e7360d4150fd7305.tar.gz'
ICECC[22255] 15:25:47: arch/arm/kernel/asm-offsets.c compiled 1 times on
x86_64
ICECC[22255] 15:25:47: Have to use host 192.168.1.2:10245 - Job ID: 90 -
environment: x86_64 got environment: true
ICECC[22255] 15:25:47: <create CS channel>
ICECC[22255] 15:25:47: </create CS channel: 7ms>
ICECC[22255] 15:25:47: <send compile_file>
ICECC[22255] 15:25:47: </send compile_file: 0ms>
ICECC[22255] 15:25:47: <write_server_cpp from cpp>
cc1: error: unrecognized command line option "-mlittle-endian"
cc1: error: unrecognized command line option "-mapcs"
cc1: error: unrecognized command line option "-mno-sched-prolog"
cc1: error: unrecognized command line option "-mabi=apcs-gnu"
arch/arm/kernel/asm-offsets.c:0: error: bad value (armv4t) for -march= switch
arch/arm/kernel/asm-offsets.c:0: error: bad value (arm9tdmi) for -mtune=
switch
ICECC[22255] 15:25:47: </write_server_cpp from cpp: 2ms>
ICECC[22255] 15:25:47: <wait for cpp>
ICECC[22255] 15:25:47: </wait for cpp: 0ms>
make[1]: *** [arch/arm/kernel/asm-offsets.s] Fehler 1
make: *** [prepare0] Fehler 2
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-programming+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-programming+help(a)opensuse.org
I have been writing some routines in assembler using nasm & ld (compile and
link) and gdb for debuggin. I am going to be converting these routines to the
at&t syntax and pass them off to gcc(gas) so that I will have access to libc.
I have been reading about the gcc compiler, and have been examining its .s
files (at&t syntax) which are fed to GAS. GAS is supposed to ship with
binutils, but I do not find it on my system as a separate utility... I use
gcc every day so obviously gas is there somewhere. Can someone please tell me
whether gcc still uses gas? ... is gas internal to gcc now?
Also, I have read rumors that the latest gas code supports the intel syntax...
true?
Thanks
--
Kind regards,
M Harris <><
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-programming+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-programming+help(a)opensuse.org
I have been using eclipse for a while now. Since SuSE 9.x and it
normally worked fine.
But, since upgrading to 10.2, I could not get it to work. It gives me
horrendous java errors that I don't understand.
When I delete the $HOME/.eclipse directory, it starts up fine and things
work. I import a project and I can use it.
But, when I exit Eclipse, it looks like it is exiting, but the java
process never die.
I have to kill -9 it to get rid of it, and then my config is scewed up.
If I try to start eclipse again, the java process exit with -1.
I have to delete the $HOME/.eclipse directory again before I can
continue.
I have java 1.5.0 installed with patches
(java-1_5_0-sun-1.5.0_update10-2.1)
eclipse :
---------
eclipse-platform-3.2.1-24
eclipse-scripts-3.2.1-24
eclipse-3.2.1-24
eclipse-jdt-3.2.1-24
eclipse-gtk2-3.2.1-24
I ran the latest eclipse updates, but it made no difference.
I have googled for a solution, but it seems that google-fu is not good
on this.
Has anybody had a similar situation, or does anybody have any idea what
could be wrong?
Thanks
--
Andre Truter | Software Consultant | Registered Linux user #185282
Jabber: andre.truter(a)gmail.com | http://www.trusoft.co.za
~ I am never wrong except when I am not right ~
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-programming+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-programming+help(a)opensuse.org
The GCC -MM and -MMD options generate dependencies. However, when I try
to build with Rogue Wave, not only to I get the local dependencies, but
I also get all the STL and Rogue Wave dependencies. Note that RogueWave
has its own version of the STL.
The C++ file's header lists is:
#include <iostream>
#include <rw/tpordvec.h>
#include <string>
#include <iterator>
#include "thisfile.h"
The command line is:
g++-I$(RWPATH)/include -I$(RWPATH) -D_RWCONFIG_rmd -MMD -c thisfile.cc
What I should see in thisfile.d is:
thisfile.o: thisfile.cc thisfile.h
What I do see is:
thisfile.o: thisfile.cc <RWPATH>/include/iostream
\ <RWPATH>/include/istream \
....
thisfile.h
According to the GCC man page, the -MM (and -MMD) options should
exclude system headers (eg. those files included in angle brackets).
I've tried a few different options. My partner in Toronto actually
found that it was trying to compile some of the RogueWave files such
as vector.cc since it is implicitly included
as <RWPATH>/include/vector.cc into the .i file by the preprocessor.
I'm not worried about the performance implications regarding the
inclusion of all the header files, but I am concerned about make
implicitly wanting to compile the RW .cc files. One possible solution
is to create a script to remove all the lines with <RWPATH>, but I'm
looking for a more elegant solution.
--
Jerry Feldman <gaf(a)blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
Hi,
I've written a small keyring utility(*) to store passwords and such. It
is using gpgme to interface with gnupg and works wonderfully on Gentoo
and Fedora.
However, on OpenSUSE 10.2 it doesn't. The problem is that
gpgme_set_passphrase_cb() doesn't have any effect on that platform.
I'm seeing pinentry-gtk-2 prompting me for a passphrase no matter what I
do. This naturally leads to my keyring not working as the gpgme
framework can't get the correct passphrase.
Is there anything I can do to force gpgme to use the callback that I
provides in gpgme_set_passphrase_cb() or is this something that has been
hard coded into gnupg on OpenSUSE?
Thanks a lot in advance,
jules
(*) Full source is here:
http://www.omesc.com/content/downloads/dist/testing/brutus-snapshot.tar.bz2
Look in <brutus/idl/products/evolution/2.4/brutus-keyring/> for the
keyring source. A small test program is in <../keyring-test/>.
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-programming+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-programming+help(a)opensuse.org
Hi Jerry,
You could set up a zero-length vector as a global object outside of
a function. You could then use it as the default reference via:
std::vector<double> zero(0);
int foo(std::vector<double> & x, std::vector<double> & y=zero);
However, this is rather unsafe, as a non-const y (and, therefore,
zero) could be changed by foo (and the global, non-const zero could be
changed by any part of the code). If zero can be changed, we can not
guarantee that it will remain a zero-length vector. There are two
ways to address this problem.
First, if y is not altered within foo, then just make both zero
and y const quantities:
const std::vector<double> zero(0);
int foo(std::vector<double> & x, const std::vector<double> & y=zero);
The second way, as Verdi suggsted, is to overload foo:
int foo(std::vector<double> & x, std::vector<double> & y);
int foo(std::vector<double> & x)
{
std::vector<double> y;
return foo(x, y);
}
Of these two options, the second is safest, as the y vector
declared within foo can not interfere with any other parts of your
code (i.e., it can not be used anywhere else, unlike a global). When
possible, I try to find ways to reduce the number of functions I write
(and thus maximize code reuse), but I do not see the advantage of
using a single function definition with a default value as in the
first case. (And, in effect, there is only one function foo in the
second case, as both functions end up using the code within foo(x,
y).)
Have you come across a situation like this where overloading is
not preferable? I would be interested in finding out.
Take care!
- Nathan
--
Nathan C. Hearn
nhearn(a)uchicago.edu
ASC Flash Center
Computational Physics Group
University of Chicago
On 4/3/07, Jerry Feldman <gaf(a)blu.org> wrote:
> In porting some code I have a function (this is the original code). The
> second parameter has a default. Array is a home grown class.
> int foo(Array<aaa> &x, Array<bbb> *y = NULL);
>
> What I want is to replace the home grown array classes with the STL
> vector class. I also want to pass them by reference.
> int foo(std::vector<aaa> &x, std::vector<bbb> &y);
> But, this requires 2 parameters. Using vector, I could overload foo
> with an inline single argument function that would achieve the desired
> result.
> inline int foo(std::vector<aaa> &x) {
> std::vector<bbb> y; // empty vector
> return foo(x, y);
> }
>
> Is there a good way where I could use a single function call, using
> vector where the second parameter has a default value as the empty
> vector. This would also achieve the desired result, but with a
> performance hit if vector y is populated.
> int foo(std::vector<aaa> &x, std::vector<bbb> *y =NULL);
> --
> Jerry Feldman <gaf(a)blu.org>
> Boston Linux and Unix user group
> http://www.blu.org PGP key id:C5061EA9
> PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-programming+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-programming+help(a)opensuse.org
In porting some code I have a function (this is the original code). The
second parameter has a default. Array is a home grown class.
int foo(Array<aaa> &x, Array<bbb> *y = NULL);
What I want is to replace the home grown array classes with the STL
vector class. I also want to pass them by reference.
int foo(std::vector<aaa> &x, std::vector<bbb> &y);
But, this requires 2 parameters. Using vector, I could overload foo
with an inline single argument function that would achieve the desired
result.
inline int foo(std::vector<aaa> &x) {
std::vector<bbb> y; // empty vector
return foo(x, y);
}
Is there a good way where I could use a single function call, using
vector where the second parameter has a default value as the empty
vector. This would also achieve the desired result, but with a
performance hit if vector y is populated.
int foo(std::vector<aaa> &x, std::vector<bbb> *y =NULL);
--
Jerry Feldman <gaf(a)blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9