我想编译一个开源项目,但无法编译该项目。我正在使用Jetbrains CLion作为我的IDE。
项目(可以随意克隆并尝试一下):https://github.com/xetra11/vm
我已经尝试了以下编译器:
所有人都在真正开始之前抛出错误。只有两个设法进行编译,但是这样做会产生编译错误。维护者告诉我他能够使用clang和gcc进行编译。所以我很困惑我在这里做错了。
使用LLVM / clang-cpp :
[ 0%] Building CXX object CMakeFiles/libsqfvm.dir/src/Entry.cpp.obj
[ 2%] Building CXX object CMakeFiles/libsqfvm.dir/src/arraydata.cpp.obj
[ 4%] Building CXX object CMakeFiles/libsqfvm.dir/src/astnode.cpp.obj
In file included from C:\Development\Github\sqfvm\src\Entry.cpp:1:
C:\Development\Github\sqfvm\src/netserver.h:1:10: fatal error: 'iostream' file not found
#include <iostream>
^~~~~~~~~~
In file included from C:\Development\Github\sqfvm\src\arraydata.cpp:1:
C:\Development\Github\sqfvm\src/arraydata.h:2:10: fatal error: 'string' file not found
#include <string>
^~~~~~~~
[ 6%] Building CXX object CMakeFiles/libsqfvm.dir/src/callstack.cpp.obj
1 error generated.
C:\Development\Github\sqfvm\src\astnode.cpp:1:10: fatal error: 'string' file not found
#include <string>
^~~~~~~~
make.exe[3]: *** [CMakeFiles\libsqfvm.dir\build.make:62: CMakeFiles/libsqfvm.dir/src/Entry.cpp.obj] Error 1
make.exe[3]: *** Waiting for unfinished jobs....
1 error generated.
1 error generated.
[ 8%] Building CXX object CMakeFiles/libsqfvm.dir/src/callstack_apply.cpp.obj
make.exe[3]: *** [CMakeFiles\libsqfvm.dir\build.make:75: CMakeFiles/libsqfvm.dir/src/arraydata.cpp.obj] Error 1
make.exe[3]: *** [CMakeFiles\libsqfvm.dir\build.make:88: CMakeFiles/libsqfvm.dir/src/astnode.cpp.obj] Error 1
In file included from C:\Development\Github\sqfvm\src\callstack.cpp:1:
C:\Development\Github\sqfvm\src/callstack.h:2:10: fatal error: 'memory' file not found
#include <memory>
^~~~~~~~
1 error generated.
make.exe[3]: *** [CMakeFiles\libsqfvm.dir\build.make:101: CMakeFiles/libsqfvm.dir/src/callstack.cpp.obj] Error 1
In file included from C:\Development\Github\sqfvm\src\callstack_apply.cpp:1:
C:\Development\Github\sqfvm\src/callstack_apply.h:2:10: fatal error: 'memory' file not found
#include <memory>
^~~~~~~~
1 error generated.
make.exe[3]: *** [CMakeFiles\libsqfvm.dir\build.make:114: CMakeFiles/libsqfvm.dir/src/callstack_apply.cpp.obj] Error 1
make.exe[2]: *** [CMakeFiles\Makefile2:109: CMakeFiles/libsqfvm.dir/all] Error 2
make.exe[1]: *** [CMakeFiles\Makefile2:121: CMakeFiles/libsqfvm.dir/rule] Error 2
make.exe: *** [Makefile:130: libsqfvm] Error 2
使用MinGW64 / gcc :
[ 0%] Building CXX object CMakeFiles/libsqfvm.dir/src/Entry.cpp.obj
[ 2%] Building CXX object CMakeFiles/libsqfvm.dir/src/arraydata.cpp.obj
[ 4%] Building CXX object CMakeFiles/libsqfvm.dir/src/callstack_apply.cpp.obj
[ 4%] Building CXX object CMakeFiles/libsqfvm.dir/src/callstack_count.cpp.obj
[ 6%] Building CXX object CMakeFiles/libsqfvm.dir/src/callstack_exitwith.cpp.obj
[ 8%] Building CXX object CMakeFiles/libsqfvm.dir/src/callstack_for.cpp.obj
In file included from C:\Development\Github\sqfvm\src\virtualmachine.h:11,
from C:\Development\Github\sqfvm\src\arraydata.cpp:3:
C:\Development\Github\sqfvm\src\dlops.h: In member function 'void* dlops::resolve(std::__cxx11::string)':
C:\Development\Github\sqfvm\src\dlops.h:65:11: error: invalid conversion from 'long long int (*)()' to 'void*' [-fpermissive]
return res;
^~~
C:\Development\Github\sqfvm\src\dlops.h: In member function 'bool dlops::try_resolve(std::__cxx11::string, void**)':
C:\Development\Github\sqfvm\src\dlops.h:15:43: error: invalid conversion from 'FARPROC' {aka 'long long int (*)()'} to 'void*' [-fpermissive]
#define DLOPS_LIB_SYM(H, N) GetProcAddress(H, N)
~~~~~~~~~~~~~~^~~~~~
C:\Development\Github\sqfvm\src\dlops.h:72:13: note: in expansion of macro 'DLOPS_LIB_SYM'
*outptr = DLOPS_LIB_SYM(handle, name.c_str());
^~~~~~~~~~~~~
In file included from C:\Development\Github\sqfvm\src\virtualmachine.h:11,
from C:\Development\Github\sqfvm\src\callstack_count.cpp:2:
C:\Development\Github\sqfvm\src\dlops.h: In member function 'void* dlops::resolve(std::__cxx11::string)':
C:\Development\Github\sqfvm\src\dlops.h:65:11: error: invalid conversion from 'long long int (*)()' to 'void*' [-fpermissive]
return res;
^~~
C:\Development\Github\sqfvm\src\dlops.h: In member function 'bool dlops::try_resolve(std::__cxx11::string, void**)':
C:\Development\Github\sqfvm\src\dlops.h:15:43: error: invalid conversion from 'FARPROC' {aka 'long long int (*)()'} to 'void*' [-fpermissive]
#define DLOPS_LIB_SYM(H, N) GetProcAddress(H, N)
~~~~~~~~~~~~~~^~~~~~
C:\Development\Github\sqfvm\src\dlops.h:72:13: note: in expansion of macro 'DLOPS_LIB_SYM'
*outptr = DLOPS_LIB_SYM(handle, name.c_str());
^~~~~~~~~~~~~
In file included from C:\Development\Github\sqfvm\src\virtualmachine.h:11,
from C:\Development\Github\sqfvm\src\callstack_exitwith.cpp:2:
C:\Development\Github\sqfvm\src\dlops.h: In member function 'void* dlops::resolve(std::__cxx11::string)':
C:\Development\Github\sqfvm\src\dlops.h:65:11: error: invalid conversion from 'long long int (*)()' to 'void*' [-fpermissive]
return res;
^~~
C:\Development\Github\sqfvm\src\dlops.h: In member function 'bool dlops::try_resolve(std::__cxx11::string, void**)':
C:\Development\Github\sqfvm\src\dlops.h:15:43: error: invalid conversion from 'FARPROC' {aka 'long long int (*)()'} to 'void*' [-fpermissive]
#define DLOPS_LIB_SYM(H, N) GetProcAddress(H, N)
~~~~~~~~~~~~~~^~~~~~
C:\Development\Github\sqfvm\src\dlops.h:72:13: note: in expansion of macro 'DLOPS_LIB_SYM'
*outptr = DLOPS_LIB_SYM(handle, name.c_str());
^~~~~~~~~~~~~
In file included from C:\Development\Github\sqfvm\src\virtualmachine.h:11,
from C:\Development\Github\sqfvm\src\callstack_for.cpp:5:
C:\Development\Github\sqfvm\src\dlops.h: In member function 'void* dlops::resolve(std::__cxx11::string)':
C:\Development\Github\sqfvm\src\dlops.h:65:11: error: invalid conversion from 'long long int (*)()' to 'void*' [-fpermissive]
return res;
^~~
C:\Development\Github\sqfvm\src\dlops.h: In member function 'bool dlops::try_resolve(std::__cxx11::string, void**)':
C:\Development\Github\sqfvm\src\dlops.h:15:43: error: invalid conversion from 'FARPROC' {aka 'long long int (*)()'} to 'void*' [-fpermissive]
#define DLOPS_LIB_SYM(H, N) GetProcAddress(H, N)
~~~~~~~~~~~~~~^~~~~~
C:\Development\Github\sqfvm\src\dlops.h:72:13: note: in expansion of macro 'DLOPS_LIB_SYM'
*outptr = DLOPS_LIB_SYM(handle, name.c_str());
^~~~~~~~~~~~~
In file included from C:\Development\Github\sqfvm\src\virtualmachine.h:11,
from C:\Development\Github\sqfvm\src\callstack_apply.cpp:3:
C:\Development\Github\sqfvm\src\dlops.h: In member function 'void* dlops::resolve(std::__cxx11::string)':
C:\Development\Github\sqfvm\src\dlops.h:65:11: error: invalid conversion from 'long long int (*)()' to 'void*' [-fpermissive]
return res;
^~~
C:\Development\Github\sqfvm\src\dlops.h: In member function 'bool dlops::try_resolve(std::__cxx11::string, void**)':
C:\Development\Github\sqfvm\src\dlops.h:15:43: error: invalid conversion from 'FARPROC' {aka 'long long int (*)()'} to 'void*' [-fpermissive]
#define DLOPS_LIB_SYM(H, N) GetProcAddress(H, N)
~~~~~~~~~~~~~~^~~~~~
C:\Development\Github\sqfvm\src\dlops.h:72:13: note: in expansion of macro 'DLOPS_LIB_SYM'
*outptr = DLOPS_LIB_SYM(handle, name.c_str());
^~~~~~~~~~~~~
make.exe[3]: *** [CMakeFiles\libsqfvm.dir\build.make:77: CMakeFiles/libsqfvm.dir/src/arraydata.cpp.obj] Error 1
make.exe[3]: *** Waiting for unfinished jobs....
make.exe[3]: *** [CMakeFiles\libsqfvm.dir\build.make:147: CMakeFiles/libsqfvm.dir/src/callstack_exitwith.cpp.obj] Error 1
make.exe[3]: *** [CMakeFiles\libsqfvm.dir\build.make:133: CMakeFiles/libsqfvm.dir/src/callstack_count.cpp.obj] Error 1
make.exe[3]: *** [CMakeFiles\libsqfvm.dir\build.make:161: CMakeFiles/libsqfvm.dir/src/callstack_for.cpp.obj] Error 1
make.exe[3]: *** [CMakeFiles\libsqfvm.dir\build.make:119: CMakeFiles/libsqfvm.dir/src/callstack_apply.cpp.obj] Error 1
In file included from C:\Development\Github\sqfvm\src\virtualmachine.h:11,
from C:\Development\Github\sqfvm\src\Entry.cpp:2:
C:\Development\Github\sqfvm\src\dlops.h: In member function 'void* dlops::resolve(std::__cxx11::string)':
C:\Development\Github\sqfvm\src\dlops.h:65:11: error: invalid conversion from 'long long int (*)()' to 'void*' [-fpermissive]
return res;
^~~
C:\Development\Github\sqfvm\src\dlops.h: In member function 'bool dlops::try_resolve(std::__cxx11::string, void**)':
C:\Development\Github\sqfvm\src\dlops.h:15:43: error: invalid conversion from 'FARPROC' {aka 'long long int (*)()'} to 'void*' [-fpermissive]
#define DLOPS_LIB_SYM(H, N) GetProcAddress(H, N)
~~~~~~~~~~~~~~^~~~~~
C:\Development\Github\sqfvm\src\dlops.h:72:13: note: in expansion of macro 'DLOPS_LIB_SYM'
*outptr = DLOPS_LIB_SYM(handle, name.c_str());
^~~~~~~~~~~~~
make.exe[3]: *** [CMakeFiles\libsqfvm.dir\build.make:63: CMakeFiles/libsqfvm.dir/src/Entry.cpp.obj] Error 1
make.exe[2]: *** [CMakeFiles\Makefile2:109: CMakeFiles/libsqfvm.dir/all] Error 2
make.exe[1]: *** [CMakeFiles\Makefile2:121: CMakeFiles/libsqfvm.dir/rule] Error 2
make.exe: *** [Makefile:130: libsqfvm] Error 2