Hi, I'm creating some sort of frontend for a program. To launch the program I'm using the call CreateProcess(), which among other things receives a pointer to a STARTUPINFO structure. To initialize the structure I used to do:
STARTUPINFO startupInfo = {0}; // Or even '\0'.
startupInfo.cb = sizeof(startupInfo);
When compiling the progr...
My compiler:xlc version 10.1
Environment: AIX5.3
Linker: ld
When i work on Linux , with gcc (4.4.1) i use the following option
-Wl,-rpath
(-Wl for the linker options) it adds a directory to the runtime library search path.
What's the equivalent for xlc compiler ?
or what's the equivalent to -rpath for the linker.
Thank you.
...
I'm having some trouble with some struct typedef declarations in a header file not seeming to go through to my implementation file.
Specifically, I have the following types defined: Type, Value, Integer, String, and Float. They are all typedef'd from struct names, in the exact same manner. I'm writing an informal hashCode function to su...
I'm writing a C++ class to read input from a file into preallocated buffers called "chunks".
I want the caller to be able to call a public static Chunk class method called GetNextFilledChunk(), which
Grabs a Chunk from an inactive chunk pool
Fills the Chunk instance from the input stream using the Chunk's private member variables/func...
The readme included with the new Xcode 3.2.1 this week says the following:
Static code analysis is fully integrated within the Xcode IDE via the Build and Analyze option under the Build menu or via custom build settings
GCC 4.2 is the default system compiler for the 10.6 SDK
The optional LLVM compiler is included using two different fr...
when i compile lex.yy.c with lfl gcc recognizes that some .a file of the flex library might be needed to be linked with my code. similarly for yacc we specify the -ly compiler option.
in other words if i create a library, abc.a i want gcc to recognize that whenever a program is compiled with -labc it should link with the library abc.a. ...
I am in the following situation:
I am writing code for a kernel that does not allow SSE instructions
I need to do floating-point arithmetic
I'm compiling for a x86_64 platform
Here is a code sample that illustrates the problem:
int
main(int argc, char** argv)
{
double d = 0.0, dbase;
uint64_t base_value = 300;
d = (2200...
I have a C++ library that generates much larger code that I would really expect for what it is doing. From less than 50K lines of source I get shared objects that are almost 4 MB and static archives pushing 9. This is problematic both because the library binaries are quite large, and, much worse, even simple applications linking against ...
Ok, so I know portability is not the strong point of C++, but I have to get my code running on both Mac&Windows. I've come up with a solution, but it's not perfect, and I'm interested to see if there is someone out there who can suggest a better one.
I need to us a class hierarchy in several DLLs/bundles - e.g., I have an abstract base ...
I am getting a lot of these warnings from 3rd party code that I cannot modify.
Is there a way to disable this warning or at least disable it for certain areas (like #pragma push/pop in VC++)?
Example:
list.h:1122: warning: `list<LogOutput*, allocator<LogOutput*> >::node_alloc_' will be initialized after
list.h:1117: warning: `alloca...
I'm sitting on an OpenSuse 11.1 x64 Box and I have a module that uses sigc++. When linking like this:
g++ [a lot of o's, L's and l's] -lsigc-2.0
I get
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lsigc-2.0
However the library is there.
In the filesystem:
$ sudo find / -name "libsigc-2.0*"...
If you compile a shared library with GCC and pass the "-z defs" flag (which I think just gets passed blindly on to ld) then you get a nice report of what symbols are not defined, and ld fails (no .so file is created). On the other hand, if you don't specify "-z defs" or explicitly specify "-z nodefs" (the default), then a .so will be pro...
Currently, MinGW's only installs the 3.x.x series of the gcc compiler by default. However, it looks like the 4.x.x series of compilers have been out for some time, and as others have mentioned, it seems to work just fine. Is there any reason why it hasn't moved to the 4.x.x versions yet, and any reason why I shouldn't use the newer ver...
I'm trying to compile with g++ some code previously developed under Visual C++ 2008 Express Edition, and it looks like g++ won't let me call a template method on a reference returned by a method of a template variable. I was able to narrow the problem down to the following code:
class Inner
{
public:
template<typename T>
T get() con...
lets put a simple example:
struct some_struct {
std::string str;
int a, b, c;
}
some_struct abc, abc_copy;
abc.str = "some text";
abc.a = 1;
abc.b = 2;
abc.c = 3;
abc_copy = abc;
then abc_copy is an exact copy of abc.. how is it possible without defining the = operator?
(this took me by surprise when working on some code..)
...
Hi.
I'm trying to use OpenGL on Android using C. I'm following this excellent tutorial, but I've hit a wall.
I'm using an ARM compiler (arm-none-linux-gnueabi-ld) on Linux Mint 7 (Ubuntu 9.04 branch).
I can copy the compiled binary to the Android emulator just fine, it runs. But when I try to make it myself, I get the following error:...
Is there anything wrong with having a single class (one .h) implemented over multiple source files? I realize that this could be a symptom of too much code in a single class, but is there anything technically wrong with it?
For instance:
Foo.h
class Foo
{
void Read();
void Write();
void Run();
}
Foo.Read.cpp
#include "Foo....
I'm running Solaris, so it's possible that this is specific to running GCC on Solaris. If I use GCC to generate a shared object, and then run nm on it to see undefined symbols, there will always be a reference to main:
[624] | 0| 0|NOTY |GLOB |0 |UNDEF |main
If I manually generate the same shared object using ld,...
When I compile the following code:
#define _POSIX_C_SOURCE 200112L
#define _ISOC99_SOURCE
#define __EXTENSIONS__
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
int
main(int argc, char *argv[])
{
char *symlinkpath = argv[1];
char actualpath [PATH_MAX];
char *ptr;
ptr = realpath(symlinkpath, actualpath);
...
I am doing some C programming for school and I have found myself reusing libraries that I have created, over and over again (stacks, user input, error handling, etc).
Right now, my personal SVN directory structure looks like this:
trunk/
|-- 2520
| `-- assignments
| |-- A2
| |-- Makefile
| |-- README
| ...