zero9178 / gnu-toolchain-for-windows Goto Github PK
View Code? Open in Web Editor NEWBinaries for a complete GNU Toolchain for Windows
Binaries for a complete GNU Toolchain for Windows
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;
I met this ld problem, see video for more info.
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;
}
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.
g++ now supports c++23, so maybe we should update the binaries ASAP
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.