Hey all,
I'm writing a cross-platform application which is not GNU GPL compatible. The major problem I'm currently facing is that the application is linked dynamically with glibc and libstdc++, and almost every new major update to the libraries are not backwards compatible. Hence, random crashes are seen in my application.
As a workaro...
I'd like to define a function like MACRO . i.e.
#define foo(x)\
#if x>32\
x\
#else\
(2*x)\
#endif
that is,
if x>32, then foo(x) present x
else, foo(x) present (2*x)
but my GCC complains about:
int a = foo(31);
I think C preprocessor should be handle this correctly. since at compile time, it knows x=33. it could replace foo(33...
I am a newbie to debugging. I compiled my project with gcc and i am trying to debug it with a greenhills debugger. when i try to debug it, i get an error "unreadable memory" in greenhills.
Anyone know why and how to fix this error? Any help will be appreciated.
Thanks.
...
If I build a static library with llvm-gcc, then link it with a program compiled using mingw gcc, will the result work?
The same for other combinations of llvm-gcc, clang and normal gcc. I'm interested in how this works out on Linux (using normal non-mingw gcc, of course) and other platforms as well, but the emphasis is on Windows.
I'm ...
I made a static library with GCC. Building of the library was OK.
When I use it the linker throws undefined reference errors on some functions. But nm says the functions are defined and exported in the static library (marked with T). I know about the linking order that I need to put the libraries after that module that needs them so thi...
Hello,
My goal is to create a cross compiler (mipsel-soclib-lol), and it's something completly new to me. (I'm following this tutorial: http://www.soclib.fr/trac/dev/wiki/CrossCompiler)
So first I have to install few things: binutils, gcc, gdb, etc.
Most of them have been installed easily, but I have a problem for the installation of gc...
why in the first line of this code:
template <typename VectorType>
std::string repr_vector_dynamic(const VectorType* vect)
{
std::stringstream strs;
strs << "(";
for (int i = 0; i < vect->size(); ++i) {
if (0 != i) {
strs << ", ";
}
strs << (*vect)[i];
}
strs << ")";
return str...
I am trying to install gcc (a branch of gcc, not the trunk in the svn), and I configured it with:
./configure --prefix=/home/user/myroot/ --enable-languages=c,c++ \
--disable-multilib --libexecdir=/usr/lib --without-included-gettext \
--enable-threads=posix --disable-werror --with-arch-32=i486 \
--with-tune=generic --enable-...
Is it possible to instruct GNU c++ compiler to stop after 5 errors found? Can't find this in documentation. Thanks in advance.
...
Hi,
Im working on a source level debugger. The debug info available in elf
format. How could be 'step over' implemented?
The problem is at 'Point1', anyway I can wait for the
next source line (reading it from the .debug_line table).
Thanks
if (a == 1)
x = 1; //Point1
else if (a == 2)
x = 1;
z = 1;
...
I'm trying to install PIL on Snow Leopard, using Python 2.6.1, GCC 4.2.1, PIL 1.1.7, and have tried with both libjpeg6b and libjpeg7 -- nothing works. I've cleared out every trace of libjpeg/pil/zlib from fink, tried various compiler options, etc. and used http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/ and http:// www....
I'm on Snow Leopard, and want distutils to use gcc 4.0 and not 4.2, can anyone tell me how to make it do that? I've tried changing the /usr/bin/g* symlinks, and setting the C* environment vars -- but to no avail. Any thoughts?
...
what is considered best practice in the following snippet:
int foo(struct data *bar, struct info bla) {
if (!bar) {
bla->status = 0;
return;
}
...
}
in fact, it works fine. but i'm feeling uncomfortable with gcc giving me a warning.
here is the actual code:
static int pop(struct stack **stack, struct in...
Hi, here is very simplified code of problem I have:
enum node_type {
t_int, t_double
};
struct int_node {
int value;
};
struct double_node {
double value;
};
struct node {
enum node_type type;
union {
struct int_node int_n;
struct double_node double_n;
};
};
int main(void) {
struct int_no...
I have successfully compiled a C-program with GCC in Mac OS X and Linux, but have got the following error message in Cygwin 1.7.5:
/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/tgmath.h:38:21: error: complex.h: No
such file or directory
I have noticed that several guys reported that tgmath.h has problems in Cygwin. However, due to the la...
I have started using Redhat Linux i would like to know how to use Gcc to program in Linux.
Also i would like to know how i can access:
C
C++
Boost
GTK+
Libraries in Linux... i saw them getting installed when i installed Linux on my System.
Please Help!!
...
Hi, I am having following doubt regarding "int" flavors (unsigned int, long int, long long int).
When we do some operations(* , /, + , -) between int and its flavors (lets say long int)
in 32bit system and 64bit system is the implicit typecast happen for "int"
for example :-
int x ;
long long int y = 2000;
x = y ; (Higher is assigne...
Hi,
I have a faulty program that when execute receive a SIGSEGV.
I can use gdb like this:
$ gdb ./prog
But I would prefer that gdb catch the SIGSEGV from prog and attach it automatically.
$ ./prog
Segmentation Fault
(gdb) ...
Is there a way to do that?
Thanks
...
When i try to compile with gcc i get this error "collect2: _spawnvp: Exec format error". Does anybody know why and how to fix it? Any help will be appreciated.
Thanks
...
So I'm trying to break a few rules quietly. GoDaddy doesn't seem too keen on letting me have Git, and for some reason think that one needs root access to run any gcc (crazy web-hosting support teams). As I try to convince them to do what I tell them to, I'm trying to find a gcc that I can send to my server so I can build git on my own an...