I have access to computer in a public library and I want to try out some C++ and maybe other code. Problem is that there is no g++ installed and I can't install it using packages because I have no root access. Is there a "smart" way to make a full environment for programming in a home folder?
I have gcc installed (I can compile C code)....
Hi,
can anyone tell when g++ replaces the __FUNCTION__ 'macro' with the string containing the function name? It seems it can replace it not until it has check the syntactical correctness of the source code, i.e. the following will not work
#include <whatsneeded>
#define DBG_WHEREAMI __FUNCTION__ __FILE__ __LINE__
int main(int argc, ch...
My program has this function:
vector<itemPtr> Level::getItemsAt(const Point& pt)
{
vector<itemPtr> vect(items.size());
// copy all items at pt's position to vect
remove_copy_if(items.begin(), items.end(), vect.begin(),
boost::bind(matchesPosition<itemPtr>, _1, pt));
// upda...
Is it possible to instruct GNU c++ compiler to stop after 5 errors found? Can't find this in documentation. Thanks in advance.
...
Compiling this code using g++ 4.2.1:
struct S { };
template<typename T> struct ST { };
template<typename BaseType>
class ref_count : private BaseType { };
template<typename RefCountType>
class rep_base : public RefCountType { };
class wrap_rep : public rep_base<ref_count<S> > {
typedef rep_base<ref_count<S> > base_type; // lin...
Background:
Many years ago, I inherited a codebase that was using the Visual Studio (VC++) flag '/fp:fast' to produce faster code in a particular calculation-heavy library. Unfortunately, '/fp:fast' produced results that were slightly different to the same library under a different compiler (Borland C++). As we needed to produce exactly...
Hi,
I am building a C++ project in XCode which uses two libraries. Say for e.g libX.a and libY.a. There are some function definitions common on libX.a and libY.a for which I get duplicate symbol linker error.
This is fine, but I get only one error at a time. Once I fix the error, I'll get the next duplicate symbol error and this proces...
When compiling C++ with GCC 4.4 or MSVC is it possible to get the compiler to emit messages when a function is inlined?
...
Hi I need to determine the mangled name of a function from within an c++ app itself.
Is there any equivalent to the __FUNCDNAME__ macro in g++ ?
...
hi,
codeSourcery G++ Lite Edition is a freeware or Sharware? any help please? please
see the link "http://www.codesourcery.com/sgpp/lite_edition.html"
...
If so, why? Why doesn't it use the copy constructor of the value type?
I get the following error:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/vector.tcc: In member functio
n `ClassWithoutAss& ClassWithoutAss::operator=(const ClassWithoutAss&)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/vector.tcc:238: instantiate
d f...
I have an Objective-C/Cocoa project that incorporates a static library. That static library has some object files that have C++ in them.
I've found that if the project that I'm using the library in contains no other C++ in it, the link fails (can't link new/delete/etc). But simply adding a single (empty) .cpp file to the project causes...
What's wrong here?
#include <memory>
#include <vector>
int main()
{
std::vector<std::unique_ptr<int>> vec;
int x(1);
std::unique_ptr<int> ptr2x(&x);
vec.push_back(ptr2x); //This tiny command has a vicious error.
return 0;
}
The error:
$ g++ -std=gnu++0x main.cpp
In file included from c:\mingw\bin\../lib/gcc/min...
I'm simulating a biological model involving several (27) stiff ordinary differential equations using C++. My program runs perfectly under MS C++ 2010 expression compiler but fails under the g++ compiler (NetBeans 6.8, Ubuntu 10.04 LTS). The problem is that some of the variables become NaN. The following are the values of the variable Vm ...
I build a huge project frequently and this takes long time (more than one hour) to finish even after configuring pre-compiled headers. Are their any guidelines or tricks to allow make work in parallel (e.g. starting gcc in background, ...etc) to allow for faster builds?
Note: Sources and binaries are too large in size to be placed in a ...
Hi,
is it possible to call function-like-macros with less that all the parameters in linux?
actually doing this only generates a warning in Visual Studio (warning 4003) and unassigned variables replaces with "".
But compiling it using g++ generates an error in linux ("error: macro * requires ** arguments, but only ** given").
is there...
Lets say i have written a program in C and compiled it with both gcc and g++, which compilation will run faster? gcc or g++? I think g++ compilation will make it slow, but not sure about it.
Let me clarify my question again because of confutation about gcc.
Let say i compile program a.c like this on console.
gcc a.c
g++ a.c
which a...
can I compile & run Brew MP Applications without Sourcery G++ ARM Compiler?
...
Hi,
So I'm trying to pick C++, and to do so I decided to write a generic Group class using templates, that takes a Type and size as template parameters:
in group.h:
#ifndef __GROUP_H
#define __GROUP_H
#define MAX_SIZE 10
/**********************************************************
* Define a Group class that handles a collection of m...
I'm following the C++ Cookbook tutorial on static and dynamic library linking with g++. I can build the binary fine, but when I run it I get the error
./hellobeatles: error while loading shared libraries: libjohnpaul.so: cannot open shared object file: No such file or directory
I used the command
: g++ -o hellobeatles hellobeatles.cpp...