Hello, trying to get the Gnu Scientific Library (gsl) to work in cygwin g++.
Cygwin is installed and updated with all default parameters and includes gsl:runtime, gsl-apps and gsl-doc. I am trying the example program given in the gsl website:
http://www.gnu.org/software/gsl/manual/html%5Fnode/An-Example-Program.html
include
#inclu...
Hello,
What are the specific options I would need to build in "release mode" with full optimizations in GCC? If there are more than one option, please list them all. Thanks.
...
I have the following method to swap two double arrays (double**) in c++. Profiling the code, the method is accounting for 7% of the runtime... I was thinking that this should be a low cost operation, any suggestions? I am new with c++, but i was hoping to just swap the references to the arrays.
62 void Solver::Swap(double** &v1, dou...
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...
can power function be used to calulate the power of very large values like pow(200,200).
also can it be used for long long int values ... pow(long long int,long long int).
i am getting this error
/sources/tested.cpp: In function 'int main()':
/sources/tested.cpp:16: error: call of overloaded 'pow(long long int&, long long int&)' is amb...
I wanted to try out the Boost::Serialization library for a project I'm working on. I'm also trying to get used to programming in Linux as well. I set up boost in its default locations. I tried compiling the test file they provide here with the command line arguments they provide and it worked fine. In this example they use the .a file.
...
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 trying to compile my code to test a function to read and print a data file, but I get a compiling error that I don't understand - "error: expected constructor, destructor, or type conversion before ';' token". Wall of relevant code-text is below.
struct Day
{
int DayNum;
int TempMax;
int TempMin;
double Precip;
int TempRa...
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...
Ever since I realized many years ago, that this doesn't produce an error by default, (in gcc at least) I've always wondered why?
I understand that you can issue compiler flags to produce a warning, but shouldn't it always be an error? Why does it make sense for a non-void function not returning value to be valid?
An example as requeste...
Hi there,
I have to program a C/C++ application. I have windows and linux (ubuntu 9.04) in my machine, and can program in both of them (via gcc/code blocks/vim,etc). The problem is that the executable is going to be run in a Unix (not linux) machine (will have access to it in about 20 days).
My Team Leader doesn´t want all of the code...
I installed valgrind on Snow Leopard using the patch at https://bugs.kde.org/show%5Fbug.cgi?id=205241 . However, when I run it with a binary I compiled from C++ code, I'm told that valgrind "cannot execute binary file". What g++ flags should I set to make my program work with valgrind?
...
As ugly as win32 Microsoft compiler is by using the __declspec macro, it does have the advantage of being explicit about what you want to export or not.
Moving the same code onto a Linux gnu/gcc system now means all classes are exported!(?)
Is this really true?
Is there a way to NOT export a class within a shared library under gcc?
#...
I'm investigating a deadlock bug. I took a core with gcore, and found that one of my functions seems to have called itself - even though it does not make a recursive function call.
Here's a fragment of the stack from gdb:
Thread 18 (Thread 4035926944 (LWP 23449)):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x005133de in __lll_mutex_loc...
I have a container similar to this one.
template <typename Nat, typename Elt>
class NatMap {
public:
Elt& operator[] (Nat nat) {
return tab [nat.GetRaw()];
}
private:
Elt tab [Nat::kBound];
};
I wanted to drop the requirement for Elt to have a default constructor:
template <typename Nat, typename Elt>
class NatMap {
pub...
Can you give an example of stack overflow in C++? Other than the recursive case:
void foo() { foo(); }
...
Hello all,
Using g++ and having linker errors. I have a simple program in split into two modules: main.cpp and Dice.h Dice.cpp.
main.cpp:
#include <iostream>
#include "Dice.h"
int main(int argc, char **argv) {
int dieRoll = Dice::roll(6);
std::cout<<dieRoll<<std::endl;
std::cin.get();
return 0;
}
Dice.h:
#ifnde...
What are the best RSS feeds for C++ ?
...
I get the following error when I try to compile my app:
*** No rule to make target `/mypath/lib/libm.a', needed by `/myPath/bin/appName'
Why is the linker looking for libm.a according to an absolute path?
...
Hi,
I just found on my Ubuntu, there are two different C++ compiler: /usr/bin/g++ and /usr/bin/c++. I am not familiar with the latter, but man c++ just jumps to the manpage of gcc. I wonder what is their difference as C++ compilers?
Thanks and regards!
...