tishion / potto Goto Github PK
View Code? Open in Web Editor NEWA minimum cross-platform implementation of COM (Component Object Model), DI/IOC framework
Home Page: https://tishion.github.io/potto/
License: MIT License
A minimum cross-platform implementation of COM (Component Object Model), DI/IOC framework
Home Page: https://tishion.github.io/potto/
License: MIT License
Does the output of them compatible with Potto?
That could showcase the full power of Potto. A list of real-world projects that are using Potto is awesome, too.
Isn't COM supposed to share objects between different programming languages? potto is implemented in C++ and can only be used with C++ (at least this is my conclusion after reading the examples). So what's the point of it? For fun? Why don't just use C++'s native objects since potto is C++ only anyway?
XPCOM as it current form in the Firefox source tree is too integrated with Firefox to be able to be used standalone. VirtualBox has their own fork of XPCOM included as part of VirtualBox source code and VirtualBox is indeed using XPCOM on non-Windows platforms. I just had a quick look at VirtualBox's XPCOM. It's so complex!
Check if the compiler supports C++17. If the compiler supports C++17 then use C++ standard library's <filesystem>
instead of <ghc/filesystem.hpp>
.
These results were on MSYS2 (CLANG64):
$ cmake ..
-- Building for: Ninja
-- The C compiler identification is Clang 16.0.5
-- The CXX compiler identification is Clang 16.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/clang64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/clang64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/msys64/home/Administrator/potto/build
$ ninja -j1
[1/12] Building CXX object CMakeFiles/potto.dir/src/PottoModuleEntryManager.cpp.obj
[2/12] Building CXX object CMakeFiles/potto.dir/src/PottoModulePoolManager.cpp.obj
[3/12] Building CXX object CMakeFiles/potto.dir/src/potto.cpp.obj
[4/12] Linking CXX shared library libpotto.dll
[5/12] Building CXX object tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj
FAILED: tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj
C:\msys64\clang64\bin\c++.exe -IC:/msys64/home/Administrator/potto/include -IC:/msys64/home/Administrator/potto/thirdparty -std=gnu++11 -g -MD -MT tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj -MF tools\CMakeFiles\pt-gen.dir\potto-gen\potto-gen.cpp.obj.d -o tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj -c C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:114:19: error: no matching constructor for initialization of 'std::ofstream' (aka 'basic_ofstream<char>')
std::ofstream ofs(outputFilePath, std::ios_base::trunc);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/c++/v1/fstream:1365:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const char *' for 1st argument
explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1368:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const wchar_t *' for 1st argument
explicit basic_ofstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1371:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const string' (aka 'const basic_string<char>') for 1st argument
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1380:5: note: candidate constructor not viable: requires single argument '__rhs', but 2 arguments were provided
basic_ofstream(basic_ofstream&& __rhs);
^
C:/msys64/clang64/include/c++/v1/iosfwd:141:32: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class _LIBCPP_TEMPLATE_VIS basic_ofstream;
^
C:/msys64/clang64/include/c++/v1/fstream:1363:5: note: candidate constructor not viable: requires 0 arguments, but 2 were provided
basic_ofstream();
^
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:205:19: error: no matching constructor for initialization of 'std::ofstream' (aka 'basic_ofstream<char>')
std::ofstream ofs(outputFilePath, std::ios_base::trunc);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/c++/v1/fstream:1365:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const char *' for 1st argument
explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1368:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const wchar_t *' for 1st argument
explicit basic_ofstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1371:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const string' (aka 'const basic_string<char>') for 1st argument
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
^
C:/msys64/clang64/include/c++/v1/fstream:1380:5: note: candidate constructor not viable: requires single argument '__rhs', but 2 arguments were provided
basic_ofstream(basic_ofstream&& __rhs);
^
C:/msys64/clang64/include/c++/v1/iosfwd:141:32: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class _LIBCPP_TEMPLATE_VIS basic_ofstream;
^
C:/msys64/clang64/include/c++/v1/fstream:1363:5: note: candidate constructor not viable: requires 0 arguments, but 2 were provided
basic_ofstream();
^
2 errors generated.
ninja: build stopped: subcommand failed.
Note: this issue is about MinGW based Clang, not MSVC based Clang.
From what I have read, it seems the problem MS COM Apartments supposed to solve doesn't exist in Potto. Thus, Potto doesn't need to support feature like MS COM Apartments. Please correct me if I'm wrong.
https://www.codeguru.com/soap/understanding-com-apartments-part-i/
It seems Potto is pure C++. I can't find any .idl files in the source tree.
These results were on MSYS2 (UCRT64):
$ cmake ..
-- Building for: Ninja
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/ucrt64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/ucrt64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (2.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/msys64/home/Administrator/potto/build
$ ninja -j1
[1/12] Building CXX object CMakeFiles/potto.dir/src/PottoModuleEntryManager.cpp.obj
[2/12] Building CXX object CMakeFiles/potto.dir/src/PottoModulePoolManager.cpp.obj
[3/12] Building CXX object CMakeFiles/potto.dir/src/potto.cpp.obj
[4/12] Linking CXX shared library libpotto.dll
[5/12] Building CXX object tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj
FAILED: tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj
C:\msys64\ucrt64\bin\c++.exe -IC:/msys64/home/Administrator/potto/include -IC:/msys64/home/Administrator/potto/thirdparty -std=gnu++11 -g -MD -MT tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj -MF tools\CMakeFiles\pt-gen.dir\potto-gen\potto-gen.cpp.obj.d -o tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj -c C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp: In function 'void GenerateClassIdHeaderFile(const std::string&, const std::string&, const std::string&)':
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:114:59: error: no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(ghc::filesystem::path&, const std::ios_base::openmode&)'
114 | std::ofstream ofs(outputFilePath, std::ios_base::trunc);
| ^
In file included from C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:32:
C:/msys64/ucrt64/include/c++/13.2.0/fstream:857:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(std::basic_ofstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
857 | basic_ofstream(basic_ofstream&& __rhs)
| ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:857:7: note: candidate expects 1 argument, 2 provided
C:/msys64/ucrt64/include/c++/13.2.0/fstream:832:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const std::string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::ios_base::openmode]'
832 | basic_ofstream(const std::string& __s,
| ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:832:41: note: no known conversion for argument 1 from 'ghc::filesystem::path' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
832 | basic_ofstream(const std::string& __s,
| ~~~~~~~~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:814:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
814 | basic_ofstream(const wchar_t* __s,
| ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:814:37: note: no known conversion for argument 1 from 'ghc::filesystem::path' to 'const wchar_t*'
814 | basic_ofstream(const wchar_t* __s,
| ~~~~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:797:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
797 | basic_ofstream(const char* __s,
| ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:797:34: note: no known conversion for argument 1 from 'ghc::filesystem::path' to 'const char*'
797 | basic_ofstream(const char* __s,
| ~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:786:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>]'
786 | basic_ofstream(): __ostream_type(), _M_filebuf()
| ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:786:7: note: candidate expects 0 arguments, 2 provided
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp: In function 'void GenerateModuleLibXmlFile(const std::string&, const std::string&)':
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:205:59: error: no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(ghc::filesystem::path&, const std::ios_base::openmode&)'
205 | std::ofstream ofs(outputFilePath, std::ios_base::trunc);
| ^
C:/msys64/ucrt64/include/c++/13.2.0/fstream:857:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(std::basic_ofstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
857 | basic_ofstream(basic_ofstream&& __rhs)
| ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:857:7: note: candidate expects 1 argument, 2 provided
C:/msys64/ucrt64/include/c++/13.2.0/fstream:832:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const std::string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::ios_base::openmode]'
832 | basic_ofstream(const std::string& __s,
| ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:832:41: note: no known conversion for argument 1 from 'ghc::filesystem::path' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
832 | basic_ofstream(const std::string& __s,
| ~~~~~~~~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:814:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
814 | basic_ofstream(const wchar_t* __s,
| ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:814:37: note: no known conversion for argument 1 from 'ghc::filesystem::path' to 'const wchar_t*'
814 | basic_ofstream(const wchar_t* __s,
| ~~~~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:797:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
797 | basic_ofstream(const char* __s,
| ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:797:34: note: no known conversion for argument 1 from 'ghc::filesystem::path' to 'const char*'
797 | basic_ofstream(const char* __s,
| ~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:786:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>]'
786 | basic_ofstream(): __ostream_type(), _M_filebuf()
| ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:786:7: note: candidate expects 0 arguments, 2 provided
ninja: build stopped: subcommand failed.
I discovered a technology called CORBA that is very similar to COM. There are interfaces and interface files just like in COM. Btw, there are too many implementations. How is CORBA compared to Potto?
This is the only thing I saw.
404
There isn't a GitHub Pages site here.If you're trying to publish one, read the full documentation to learn how to set up GitHub Pages for your repository, organization, or user account.
What do you think about modifying Potto in a way that any valid Potto object is also a valid real MS COM object? This way, the same dll could be served as both Potto COM server and MS COM server. Is it something possible?
/utf-8 is a MSVC-only switch that GCC and Clang (I'm not sure about Clang-Cl) don't understand.
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.