Author Topic: How to fix the fatal_error?  (Read 3551 times)

0 Members and 1 Guest are viewing this topic.

Offline Azadeh

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
  • Gender: Female
  • I've just joined!
    • View Profile
    • Awards
How to fix the fatal_error?
« on: January 31, 2016, 05:37:12 am »
Hi
I get the error "/usr/include/c++/5/cstddef:51:11: error: ‘::max_align_t’ has not been declared
   using ::max_align_t;
           ^"
So I should update the libraries because I find this solution: "A workaround until libraries get updated is to include <cstddef> or <stddef.h> before any headers from that library."
I wrote some command on the Ubuntu terminal such as:
 "sudo apt-get install apt-file
sudo apt-file update
apt-file search stddef.h"
Then still the error exist.
Thank you

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17740
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: How to fix the fatal_error?
« Reply #1 on: January 31, 2016, 03:26:07 pm »
What are you trying to do when you get that error ?
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Azadeh

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
  • Gender: Female
  • I've just joined!
    • View Profile
    • Awards
Re: How to fix the fatal_error?
« Reply #2 on: February 01, 2016, 04:24:39 am »
Make, I wrote "make" in the terminal.

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17740
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: How to fix the fatal_error?
« Reply #3 on: February 01, 2016, 12:27:37 pm »
To make what exactly.....

You're not giving anywhere near enough information ..

What are you trying to compile ?

Where did you get the source code ?

Which distro / version / architecture (eg. Ubuntu 14.04 64bit) ?
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Azadeh

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
  • Gender: Female
  • I've just joined!
    • View Profile
    • Awards
Re: How to fix the fatal_error?
« Reply #4 on: February 01, 2016, 04:44:34 pm »
To make what exactly
before writing make I wrote "cd", exactly "cd gen" that gen is folder include c++ codes.
What are you trying to compile?
yes
Where did you get the source code?
I get the source code on a personal page, do you need it?
Which distro/ version/ architecture?
ubuntu-15.10-desktop or server-i386 64bit

Offline Azadeh

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
  • Gender: Female
  • I've just joined!
    • View Profile
    • Awards
Re: How to fix the fatal_error?
« Reply #5 on: February 01, 2016, 05:23:28 pm »
fixed the error by adding "includes cstddef>" at the first line of some pages of codes, but now the newer error "narrowing conversion of long long int to long unsigned int inside {} [-Wnarrowing]

the source code relative to it:
Code: [Select]
// Implements the joint conditional cummulative density functions for CP-nets
// For node j in the lexicographic topological sort as defined by the dag code:
// the table gives P( s, t | n, c, j ).
// The number of rows in each table is the triangular number of min(c, j).

#ifndef TABLES_H
#define TABLES_H

#include <random> // Mersenne Twister
#include <chrono> // Used to initialize MT

const unsigned long int factorial[17] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800, 87178291200, 1307674368000, 20922789888000};

void random_outcome_pair(uint64_t& o, uint64_t& oo, const unsigned int n, const unsigned int hd = 0);

uint64_t random_k_subset(uint64_t T, const int N, const int n);

class cpnet_ccdf
{
 public:
  cpnet_ccdf(const int length);
  cpnet_ccdf(cpnet_ccdf &obj);
  ~cpnet_ccdf();
  int length() { return length_; };
  void store(double p, const int s, const int t) { P[row_] = p; S[row_] = s; T[row_] = t; ++row_; };
  void adjust_last() { P[length_ - 1] = 1.0; };
  void print();
  friend std::ostream& operator<<(std::ostream& os, const cpnet_ccdf& obj);
  friend std::istream& operator>>(std::istream& is, cpnet_ccdf& obj); // test
  void random_st(int& s, int& t);
  // static uint64_t random_cpt(const int k); // use rand_cpt in degen_multi.cc
  void random_node(const int n, int& q, uint64_t& U, uint64_t& A, unsigned long int** cpt, int j);
  // void random_node(const int n, int& q, uint64_t& U, uint64_t& A, uint64_t& cpt);
  // void random_toporder_node(const int n, const int j, int& q, uint64_t& U, uint64_t& A, uint64_t& cpt);
 
 private:
  int length_;
  int row_;
  double *P;
  int *S;
  int *T;
};

// all tables for all available values of (n, c, j, q) go here
class cpnet_dist
{
 public:
  cpnet_dist(int maxn, int maxk);
  ~cpnet_dist();
  cpnet_ccdf* dist(int n, int c, int j, int q) { return DIST[n][c][j][q]; };
  void init(int n, int c, int j, int q, int len);
  void print();
  void dump();
  void dump(std::string fname);
  static void dagcode_to_dag(const unsigned int n, const uint64_t dc[], unsigned int ch_ix[], char ch[], unsigned long imp[]);
  static void dc_and_cpts_to_xml(const unsigned int n, const uint64_t dc[], unsigned long int** cpts, std::string working_directory, std::string fname);
  void free_cpt(const int n, long unsigned int** cpt);
  void generate_random_cpnet(const int n, const int c, uint64_t dc[], long unsigned int* cpt[]);
  // void random_toporder_cpnet(const int n, const int c, uint64_t dc[], uint64_t cpt[]);
 
 private:
  const int MAX_N;
  const int MAX_K;
  cpnet_ccdf***** DIST = nullptr;
};

bool degen_multi( unsigned int m, // number of inputs (indegree)
  unsigned int nAsst, // number of rows
  unsigned int* C ); // array of outputs defining function

void rand_cpt( unsigned long int cpt[], // Return value
       const int k,              // Number of parents
       const long unsigned int size_cpt ); // Number of rows = d^k

void print_cpt( const unsigned long int cpt[], // CPT to output
        const unsigned long int size_cpt ); // Number of rows = d^k

#endif // TABLES_H
I think error got from
 
Code: [Select]
const unsigned long int factorial[17] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800, 87178291200, 1307674368000, 20922789888000};
« Last Edit: February 01, 2016, 05:31:02 pm by Azadeh »

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17740
  • Karma: 457
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: How to fix the fatal_error?
« Reply #6 on: February 01, 2016, 08:25:26 pm »
I get the source code on a personal page, do you need it?

It would probably help.
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Azadeh

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
  • Gender: Female
  • I've just joined!
    • View Profile
    • Awards
Re: How to fix the fatal_error?
« Reply #7 on: February 02, 2016, 04:54:01 am »
I get the source code on a personal page, do you need it?

It would probably help.
this error solved, I asked about the new fatal_error.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal