Welcome, Guest. Please login or register.

Author Topic: gcc and precompiled header  (Read 4056 times)

Description:

0 Members and 2 Guests are viewing this topic.

Offline ciVicTopic starter

  • Jr. Member
  • **
  • Join Date: Nov 2004
  • Posts: 98
    • Show all replies
gcc and precompiled header
« on: September 04, 2013, 09:28:33 AM »
Hi all,

since the gcc is very slow on an A4000/040, especially when using the STL, I tried to use precompiled header with the m68k gcc 3.4. Unfortunately I can only see an error message "PCH not supported". I'm wondering why, since it works doing the same on a linux machine and 3.4 should support precompiled header. Maybe somebody knows a solution or a newer gcc version for classic Amigas?

FYI, here are the hello.cpp and hello.h:

Code: [Select]

#pragma once
#include <string>
using namespace std;

class Hello
{
public:
        Hello() : s(&quot;Hello World!&quot;) {};
        string s;
};



Code: [Select]

#include "hello.h"
#include

using namespace std;

int main()
{
        Hello h;
        cout << h.s;
        return 0;
}



and I can compile it this way:

Code: [Select]

g++ -x c++-header hello.h
g++ -H hello.cpp
« Last Edit: September 04, 2013, 10:09:26 AM by ciVic »
 

Offline ciVicTopic starter

  • Jr. Member
  • **
  • Join Date: Nov 2004
  • Posts: 98
    • Show all replies
Re: gcc and precompiled header
« Reply #1 on: September 05, 2013, 09:36:11 AM »
Indeed I'm coding with WinUAE, but I like my real Amiga and want to use it. Unfortunately I must use C++ and a "modern" compiler since I need some C++ classes from other sources like rapidjson and twit curl.

I also found out the reason for the "PCH not supported". This error message was inserted with some patches for Amiga. So there is no hope that I could get this work.

@matthey Thx, seems like your hints speed up the compiler a bit.