title: error: ISO C++ forbids declaration of 'core' with no type
body: <p>I am getting error in the title. First of all, I did my search here in stackoverflow and in the google. There are many similar errors but I couldn't figure out how to solve the error. Some of the errors that I am getting with the error in the title are below. There are way many errors than the below errors but I just put a few of them.</p>
  
  <pre><code>    core.cpp:9:102: error: ISO C++ forbids declaration of 'core' with no type [-fpermissive]
      uint32_t number_of_core_msg_types, uint32_t msg_q_size, uint32_t bytes_per_flit) throw(err) :
  
      core.cpp:9:102: error: 'int boost::core::core(const pe_id&amp;, const uint64_t&amp;, boost::shared_ptr&lt;id_factory&lt;long long unsigned int&gt; &gt;, boost::shared_ptr&lt;tile_statistics&gt;, logger&amp;, boost::shared_ptr&lt;random_gen&gt;, boost::shared_ptr&lt;memory&gt;, uint32_t, uint32_t, uint32_t)' should have been declared inside 'boost::core'
  
      core.cpp: In function 'int boost::core::core(const pe_id&amp;, const uint64_t&amp;, boost::shared_ptr&lt;id_factory&lt;long long unsigned int&gt; &gt;, boost::shared_ptr&lt;tile_statistics&gt;, logger&amp;, boost::shared_ptr&lt;random_gen&gt;, boost::shared_ptr&lt;memory&gt;, uint32_t, uint32_t, uint32_t)':
  
      core.cpp:10:5: error: only constructors take member initializers
   pe(id), system_time(t), stats(st), log(l), ran(r),
  </code></pre>
  
  <p>Here is my core.hpp file:</p>
  
  <pre><code>    #ifndef __CORE_HPP__
      #define __CORE_HPP__
  
      #include &lt;vector&gt;
      #include &lt;map&gt;
      #include &lt;boost/shared_ptr.hpp&gt;
      #include &lt;boost/bind.hpp&gt;
      #include "id_factory.hpp"
      #include "logger.hpp"
      #include "statistics.hpp"
      #include "pe.hpp"
      #include "random.hpp"
      #include "bridge.hpp"
      #include "messages.hpp"
      #include "memory.hpp"
  
      using namespace std;
      using namespace boost;
  
     /* core class provides common constructor process and connect process */
  
      #define MAX_PAYLOAD 256
  
      class core : public pe {
      public:
             core(const pe_id &amp;id, const uint64_t &amp;system_time,
                 shared_ptr&lt;id_factory&lt;packet_id&gt; &gt; packet_id_factory,
                 shared_ptr&lt;tile_statistics&gt; stats, logger &amp;log,
                 shared_ptr&lt;random_gen&gt; ran,
                 shared_ptr&lt;memory&gt; mem,
                 uint32_t number_of_core_msg_types, 
                 uint32_t msg_queue_size, uint32_t m_bytes_per_flit) throw(err);
       virtual ~core() throw();
  
       /* Common core methods */
       virtual void connect(shared_ptr&lt;bridge&gt; net_bridge) throw(err);
       virtual void tick_positive_edge() throw(err);
       virtual void tick_negative_edge() throw(err);
  
      /* Fast forwarding */
      virtual uint64_t next_pkt_time() throw(err);
      virtual bool is_drained() const throw() = 0;
  
      /* not used */
      virtual void add_packet(uint64_t time, const flow_id &amp;flow, uint32_t len) throw(err);
      virtual bool work_queued() throw(err);
      virtual bool is_ready_to_offer() throw(err);
      virtual void set_stop_darsim() throw(err);
  
      protected:
      /* implement core logic */
      virtual void execute() = 0;
      /* check and update finished memory requests */
      virtual void update_from_memory_requests() = 0;
  
      void tick_positive_edge_memory() throw(err);
      void tick_negative_edge_memory() throw(err);
  
      /* use these queues to use the network */
      shared_ptr&lt;messageQueue&gt; receive_queue(uint32_t type);
      shared_ptr&lt;messageQueue&gt; send_queue(uint32_t type);
  
      /* Global time */
      const uint64_t &amp;system_time;
  
      /* Aux */
      shared_ptr&lt;tile_statistics&gt; stats;
      logger &amp;log;
      shared_ptr&lt;random_gen&gt; ran;
  
      uint32_t m_number_of_msg_types;
      uint32_t m_first_core_msg_type;
      uint32_t m_msg_queue_size;
      uint32_t m_bytes_per_flit;
  
      /* memory */
      shared_ptr&lt;memory&gt; m_memory;
  
      private:
      typedef struct {
           packet_id id;
           flow_id flow;
           uint32_t len;
           uint32_t xmit;
           uint64_t payload[MAX_PAYLOAD];
      } core_incoming_packet_t;
      typedef map&lt;uint32_t, core_incoming_packet_t&gt; incoming_packets_t;
  
      void release_xmit_buffer();
  
      map&lt;uint32_t/*msg type*/, shared_ptr&lt;messageQueue&gt; &gt; m_out_msg_queues;
      map&lt;uint32_t/*msg type*/, shared_ptr&lt;messageQueue&gt; &gt; m_in_msg_queues;
  
      /* Network */
      shared_ptr&lt;bridge&gt; m_net;
      vector&lt;uint32_t&gt; m_queue_ids;
      incoming_packets_t m_incoming_packets;
      shared_ptr&lt;id_factory&lt;packet_id&gt; &gt; m_packet_id_factory;
      map&lt;uint32_t, uint64_t*&gt; m_xmit_buffer;
  
      uint32_t m_receive_channel_round_robin_pointer;
      uint32_t m_send_queue_round_robin_pointer;
  
      };
  
      #endif
  </code></pre>
  
  <p>and here is relevant part of the core.cpp file:</p>
  
  <pre><code>#include "core.hpp"
  
  core::core(const pe_id &amp;id, const uint64_t &amp;t, shared_ptr&lt;id_factory&lt;packet_id&gt; &gt; pif,
         shared_ptr&lt;tile_statistics&gt; st, logger &amp;l, shared_ptr&lt;random_gen&gt; r,
         shared_ptr&lt;memory&gt; mem,
         uint32_t number_of_core_msg_types, uint32_t msg_q_size, uint32_t bytes_per_flit) throw(err) :
  pe(id), system_time(t), stats(st), log(l), ran(r),
  m_msg_queue_size(msg_q_size), m_bytes_per_flit(bytes_per_flit), m_memory(mem), m_packet_id_factory(pif),
  m_receive_channel_round_robin_pointer(0), m_send_queue_round_robin_pointer(0)
  {
         m_number_of_msg_types = number_of_core_msg_types + mem-&gt;number_of_mem_msg_types();
         m_first_core_msg_type = mem-&gt;number_of_mem_msg_types();
         for (uint32_t i = 0; i &lt; m_number_of_msg_types; ++i) {
                m_in_msg_queues[i] = shared_ptr&lt;messageQueue&gt; (new messageQueue(i, m_msg_queue_size));
                m_out_msg_queues[i] = shared_ptr&lt;messageQueue&gt; (new messageQueue(i, m_msg_queue_size));
         }
         m_memory-&gt;set_core_send_queues(m_out_msg_queues);
         m_memory-&gt;set_core_receive_queues(m_in_msg_queues);
   }
  
  core::~core() throw() { }
  
  void core::connect(shared_ptr&lt;bridge&gt; net_bridge) throw(err) {
      m_net = net_bridge;
      shared_ptr&lt;vector&lt;uint32_t&gt; &gt; qs = m_net-&gt;get_ingress_queue_ids();
      m_queue_ids.clear();
      copy(qs-&gt;begin(), qs-&gt;end(), back_insert_iterator&lt;vector&lt;uint32_t&gt; &gt;(m_queue_ids));
  }
  
  shared_ptr&lt;messageQueue&gt; core::receive_queue(uint32_t type) {
      assert((uint32_t)type &lt; m_number_of_msg_types);
      return m_in_msg_queues[type];
  }
  
  shared_ptr&lt;messageQueue&gt; core::send_queue(uint32_t type) {
      assert((uint32_t)type &lt; m_number_of_msg_types);
      return m_out_msg_queues[type];
  }
  
  void core::release_xmit_buffer() {
  /* release xmit buffer for injection if transmission is done */
      for (map&lt;uint32_t, uint64_t*&gt;::iterator i = m_xmit_buffer.begin(); i != m_xmit_buffer.end(); ++i) {
          if (m_net-&gt;get_transmission_done(i-&gt;first)) {
              delete[] i-&gt;second;
              m_xmit_buffer.erase(i-&gt;first);
              break;
          }
      }
  }
  .......
  .......
  .......
  </code></pre>
  
  <p>Can anyone point out what the problem is? By the way, I am trying to compile a program and these codes are the parts of the program.</p>