comp.lang.c++
  Home FAQ Contact Sign in
comp.lang.c++ only
 
Advanced search
May 2008
motuwethfrsasuw
   1234 18
567891011 19
12131415161718 20
19202122232425 21
262728293031  22
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.c++ Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  gmake error: No rule to make target lib_file.a         


Author: D3|\||\|!$
Date: May 2, 2008 23:07

Hi all!!!
I have been trying to port a piece of C++ code from windows to Linux
environment. I'm using redhat9 which has KDE3 and QT3.1.x on it.

I used KDevelop 2.1 bundled with it. I created a new C++ project with
KDevelop.
The code needs to import headers and .a files containing the
definitions of functions contained therein. I supplied the path of the
folder containing the headers as "-Ipath_of_header_folder" as a
compiler flag and supplied the path of library files' folder as "-
Lpath_of_lib_folder" as a linker flag. Then I mentioned the names of
the libraries that need to be linked with the code in the linker
options->additional libraries. I have used -Wall compiler flag.

The code is compiling properly but when I hit make, the compiler is
throwing up the following error:
gmake[3]: *** No rule to make target `lib_file.a,', needed by
`project_name'. Stop.

Seems something is wrong with the make options but I haven't changed
any of the defaults..

Please Help!!!
1 Comment
  C++ STL List implementation         


Author: harsh.murari
Date: May 2, 2008 15:03

I wanted to know how the C++ STL list is implemented. Specifically, I
wanted to understand the memory usage by the list objects.

I have the following code snippet:

std::list L;

L.push_back(10);
L.push_back(20);

printf("List size %%d\n", sizeof(L));

This is returning the object size of L to be 4 bytes. How is this
possible? What data members does the list object contain? Where are
previous pointer, next pointer etc stored? Any insights would be
appreciated.
2 Comments
  Help Me Urgent!!!         


Author: kaki
Date: May 2, 2008 12:48

1 Comment
  Multiple inheritance question         


Author: t-tocs
Date: May 2, 2008 12:00

In C++, is it possible to design a class so that it will not allow
multiple inheritance?
6 Comments
  What is the purpose of C++0X constexpr?         


Author: jason.cipriani
Date: May 2, 2008 10:27

I am reading the description of "generalized constant expressions" in C
++0x here:

http://en.wikipedia.org/wiki/C%%2B%%2B0x#Generalized_constant_expressions

And I don't understand the purpose of constexpr.

How are these different?

constexpr int Number = 5;
const int Number = 5;

And when would you ever want to do this:

constexpr int Number () { return 5; }
double array[Number()];

Instead of just:

const int Number = 5;
double array[Number];

Thanks,
Jason
7 Comments
  Design issue         


Author: Philipp.Weissenbacher
Date: May 2, 2008 06:16

Hi all!

I've got something of a design issue here:

class Bucket {
public:
// Initial capacity of a bucket (= # of items in a page)
static const unsigned int M = 10;

// Key store
Key keyStore[M];

// Count of items in the bucket
int count;

// Bucket's depth (number of significant bits)
int localDepth;

Bucket();
~Bucket();
};

Now, I use Bucket in a data structure like this:

#include "Bucket.h"

Foobar::Foobar() : a(0), b(0), c(0) {
}
Show full article (1.02Kb)
4 Comments
  Port to gcc-4.3 (template template issue)         


Author: ndbecker2
Date: May 2, 2008 04:19

On upgrading from gcc-4.1.2 to gcc-4.3, this (stripped down) code is
now
rejected:

#include
#include

template class CONT=std::vector>
class Ring {

};
Show full article (0.98Kb)
2 Comments
  constructing const vectors         


Author: Dan Smithers
Date: May 2, 2008 03:24

Is there a way of specifying the contents of a vector in the constructor
when the elements are not identical?

I would like to be able to construct a static const vector that contains
pre-determined values.

class CFoo
{
static const std::vector m_foo;

static const int *const m_bar;
...
};

const std::vector CFoo::m_foo({1, 2, 3});
const int *const CFoo::m_bar = {10, 20, 30};

As I want a static member, it needs to be all done through the constructor.

Would it be easier just to declare a const array as in m_bar?

thanks

dan
7 Comments
  Brace-enclosed array initialisers         


Author: Paul Jackson
Date: May 2, 2008 03:05

Here's a brace-enclosed initialiser for a 3D array:

int a4[2][3][4] = {
{ 1, 2, 3, 4, {5, 6, 7 }, },
{ {13, 14, 15 }, 17, 18, 19, 20, {21, 22, 23, 24} }};

gcc produces some warnings when compiling this, but sets a4 to this,
which is what I'd expect:

{ { 1 2 3 4 } { 5 6 7 0 } {0 0 0 0 } }
{ {13 14 15 0 } {17 18 19 20 } {21 22 23 24 } }

It gets more interesting if I leave out initialiser '20':

int a4[2][3][4] = {
{ 1, 2, 3, 4, {5, 6, 7 }, },
{ {13, 14, 15 }, 17, 18, 19, {21, 22, 23, 24} }};

gcc now produces lots more warnings, and sets a4 to this:

{ { 1 2 3 4 } { 5 6 7 0 } { 0 0 0 0 } }
{ {13 14 15 0 } {17 18 19 21 } { 0 0 0 0 } }

Any ideas on what the 'correct' behaviour here should be? I've only
checked 6.7.8 in the C99 spec, but this seems to be wrong. I suspect
that either reporting an error or setting a4 to
Show full article (1.06Kb)
2 Comments
  CRTP base class using typedef of sub-class doesn't work         


Author: Frank Bergemann
Date: May 2, 2008 02:42

Hi,

the (gcc-3.4.4) compiler complains, if i try to use a typedef of
subclass in superclass:

|padsol15 141> make Helper_test
[CXXD] Helper_test.cc
In file included from Helper_test.cc:17:
Helper.h:258: error: ISO C++ forbids declaration of `BaseType' with no
type
Helper.h:258: error: `::BaseType' is not a valid declarator
Helper.h:258: error: expected `;' before "BaseType"
make: *** [Helper_test.o] Error 1

???
Show full article (1.13Kb)
3 Comments
1 2