Hi, I am trying to do some analysis with the logical address. The following program explains
my motive ...
#include<stdio.h>
int main()
{
int x=10;
printf("The address of main is %p\n",&main);
printf("The address of x is %p\n",&x);
return 0;
}
When I run this program in my 32bit system it shows
The address of main is 0x80483b4
T...
Hello,
I am doing parallel programming with MPI on Beowulf cluster. We wrote parallel algorithm for simulated annealing. It works fine. We expect 15 time faster execution than with serial code. But we did some execution of serial C code on different architectures and operating systems just so we could have different data sets for perfor...
I have a project that uses log4cxx, boost, etc. libraries whose headers generate lots of (repetitive) warnings. Is there a way to suppress warnings from library includes (i.e. #include <some-header.h>) or includes from certain paths? I'd like to use -Wall and/or -Wextra as usual on project code without relevant info being obscured. I cur...
Hi!
I want to setup a custom toolchain with qmake. I've set the compiler but I don't know how to set the linker. This error is reported because cmake try to use the compiler to link:
The C compiler "xgcc.exe" is not able to compile a simple test program.
Here there is a snippet of my toolchain file
# specify the cross compiler
INCLUD...
At the CocoaHeads Öresund meeting yesterday, peylow had constructed a great ObjC quiz. The competition was intense and three people were left with the same score when the final question was to be evaluated: How many reserved keywords does Objective-C add to C?
Some spirited debate followed. All agreed that @interface, @implementation et...
In Microsoft visual c++ compiler, you can specify linker options using
#pragma comment(lib, "MSVCRT") //links with the MVCRT library
see this page
I find this feature very useful because linker errors are common and i want to just place all the linker options in my source code instead of specifying them to the compiler.
question: I...
My main interest is with moving code from header files to source files (for decoupling), but keeping the same performance for the inlined stuff.
I'm not sure where to get started, could someone explain what to do?
...
I have installed GCC and GTK+. Its working fine, but i need to statically link GTK+ libraries with my application (its a small application) so that there exist only one '.exe'.
Can anybody suggest a solution for this problem...?
...
I have a pthreads program. I have to compile it with gcc -pthread in Linux (-pthreads is unrecognized option) and gcc -pthreads in Sun (-pthread is unrecognized option). Why the difference, since it's the same compiler? However, -lpthread works on both, but I heard this isn't always sufficient.
...
Is there a good reason why this program compiles under GCC even with the -ansi and -pedantic flags?
#include <cmath>
int main (int argc, char *argv [])
{
double x = 0.5;
return static_cast<int>(round(x));
}
This compiles clean (no warnings, even) with g++ -ansi -pedantic -Wall test.cpp -o test.
I see two problems:
round...
I have a static lib A, which also uses static libs B, C and D.
I then have applications X and Y which both use A, but not B, C or D.
Is there some way to make it so X and Y will automatically see that A used B, C and D and link them, so that I don't need to keep track for the entire dependency tree so I can explicitly pass every static...
Hi, I'm tackling a trivial buffer overflow (yes, exploitation; but unrelated to the problem) I'm trying to figure out the fields in the memory map, when GCC's stack protector is enabled. As an illustration:
$ ./overflow
*** stack smashing detected ***: ./overflow terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__for...
Setup:
class A {
public:
void a() {}
};
class B {
public:
void b() {}
};
class C: public A, public B {
public:
void c() {}
};
What (I thought) I should be able to do:
C* foo = new C();
foo->b();
And I get the following linker error from GCC:
`... undefined reference to 'C::b(void)'`
If I use explicit scope re...
I am trying to link something I wrote to an existing shared library.
I using gcc 3.2.3 on RedHat 3. When I get to the link phase I get an error that says:
object_files_linux/hvm_example.o(.text+0x233):~/hvm_example.cpp:254: undefined reference to `xoc::hvmapi::id(std::basic_string, std::allocator > const&)'
I have run the nm command on...
I'm tring to use openssl in a gcc program but it isn't working.
g++ server.cpp /usr/lib/libssl.a -o server
gives error, anything with -l option gives error, what should I type on command line to use openssl. The file /usr/lib/libssl.a exists, but still linker error no such funtion MD5() exists occurs.
...
Theres are couple of places in my code base where the same operation is repeated a very large number of times for a large data set. In some cases it's taking a considerable time to process these.
I believe that using SSE to implement these loops should improve their performance significantly, especially where many operations are carried...
In Solaris, gcc gives me
implicit declaration of function `getopt'
when compiling
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
getopt(1,argv,"");
return 0;
}
The man page for getopt says something about including unistd.h or stdio.h, however even though I'm inluding both I still get this w...
I'm having problems with LD_LIBRARY_PATH at link time (this question has nothing to do with run time).
The link line looks like this when I run make (this is a Linux system using g++ version 4.1.x):
g++ a.o b.o c.o -o myapp \
-L/long/path/to/libs/ \
-L/another/long/path/ \
-labc -ldef -lghi
The -l options reference shared librarie...
I am converting a number of low-level operations from native matlab code into C/mex code, with great speedups. (These low-level operations can be done vectorized in .m code, but I think I get memory hits b/c of large data. whatever.) I have noticed that compiling the mex code with different CFLAGS can cause mild improvements. For exampl...
I'm trying to learn assembly using NASM, the pcasm-book.pdf from Dr Paul Carter - http://www.drpaulcarter.com/pcasm/ - on my Mac OS X Snow Leopard.
I'm trying to link the previous compiled C sample to asm samples:
gcc first.o driver.c asm_io.o -o first
But it's returning it:
driver.c:3: warning: ‘cdecl’ attribute ignored
ld: warning...