Giter Club home page Giter Club logo

gnu-toolchain-for-windows's Issues

Adding boost to default libraries

Boost is a very powerful librery for C++, so consider adding it to the default libraries.
You can download it from here.
PS: $version is the version you want, preferably latest stable for gcc7-10; latest beta for gcc trunk.

ld problem

rec.mp4

I met this ld problem, see video for more info.

Compilation error

While compiling with your complier, I met the following error:

C:\ptrs>C:\gcc11\gcc\bin\g++ ptrs.cpp
In file included from c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\bits\postypes.h:40,
                 from c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\iosfwd:40,
                 from c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\ios:38,
                 from c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\ostream:38,
                 from c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\iostream:39,
                 from demo:1,
                 from ptrs.cpp:1:
c:\gcc11\gcc\lib\gcc\x86_64-w64-mingw32\11\include\c++\cwchar:44:10: fatal error: wchar.h: No such file or directory 
   44 | #include <wchar.h>
      |          ^~~~~~~~~
compilation terminated.

I used the following files:
demo:

#pragma once
#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::string;

template <typename T>
class demo {
private:
    T var;
    string name;
    string scope;
    static string ato = "auto_ptr";
    static string uniq = "unique_ptr";
    static string shr = "shared_ptr";
public:
    demo(T val = 0, string n = "NULL", string sc = "main()", string pt = demo::ato) {
        var = val;
        name = n;
        scope = sc;
        cout << "Object " << name << " with value of " << var << " in scope " << scope << " created using " << pt << "." << endl;
    }
    
    ~demo() {
        cout << "Object " << name << " with value of " << var << " in scope " << scope << " destroyed by " << pt << "." << endl;
    }

    void setnm(string nm) {name = nm;}
    void setv(T v) {var = v;}
}

ptrs.cpp:

#include "demo"
#include <iostream>
#include <memory>
using namespace std;

int main() {
    auto_ptr p1 = new demo<unsigned short>(1, "p1");
    unique_ptr p2 = new demo<unsigned short>(2, "p2", , demo<unsigned short>::uniq);
    shared_ptr p3 = new demo<unsigned short>(3, "p3", , demo<unsigned short>::shr);
    auto_ptr p11 = p1;
    p11 -> setnm("p11");
    //unique_ptr p22 = p2;     will cause err at compile time
    //p22 -> setnm("p22");
    shared_ptr p33 = p3;
    p33 -> setnm("p33");
    return 0;
}

Add new branch of build

Gcc now actually supports C++20 modules now, and you can get the source from gitee using the following command:

git clone https://gitee.com/mirrors/gcc.git -b devel/c++-modules --depth=1

That way, it supports the following syntax:

import std.core;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.