fatal error: experimental/coroutine: No such file or directory
this is the error the compiler gives me
here's main.cpp
#include <fstream>
#include <iostream>
#include <filesystem>
#include <chrono>
#include <thread>
#include <winrt/windows.ui.viewmanagement.h>
int main (){
bool running = true;
winrt::Windows::UI::ViewManagement::UISettings Colsettings;
auto coloracc = Colsettings.GetColorValue(winrt::Windows::UI::ViewManagement::UIColorType::Accent);
std::cout << coloracc.B;
if (!std::filesystem::exists("color.inc")) {
running = false;
}
while (running)
{
std::this_thread::sleep_for(std::chrono::milliseconds(500));
std::cout << "aaaaaaaaaaa";
}
}
here's task.json
{
"version": "2.0.0",
"tasks": [
{
"type": "process",
"label": "C/C++: g++.exe build active file",
"command": "C:\\msys64\\mingw64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-std=c++23",
"-g",
"${file}",
"-I",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/cppwinrt",
"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
"detail": "compiler: C:\\msys64\\mingw64\\bin\\g++.exe"
}
]
}
I guess the solution is by changing tasks.json
I was surfing the web and I didn't find an article that tells me how to use winrt in vscode
and thanks
{
"type": "cppbuild",
"label": "C/C++: cl.exe build active file",
"command": "cl.exe",
"args": [
"WindowsApp.lib",
"/std:c++17",
"/Zi",
"/EHsc",
"/nologo",
"/Fe:",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"*.cpp"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$msCompile"
],
"group": "build",
"detail": "compiler: cl.exe"
}
so I used Microsoft compiler and it works fine maybe I'll try using cmake since I guess the project will get bigger
C:\msys64\mingw64\bin\clang++.exe -std=c++17 -g *.cpp -I "C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/cppwinrt" -I "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include" -I "C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt" -o "C:\behe\My_life\programmation\rainmeter c++ app simple ii guess\main.exe"
In file included from main.cpp:2:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:9:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/yvals_core.h:394:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:58:
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vadefs.h:61:33: error: expected ';' after top level declarator
typedef unsigned __int64 uintptr_t;
^
;
In file included from main.cpp:2:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:9:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/yvals_core.h:394:
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:96:1: error: C++ requires a type specifier for all declarations
_CRT_BEGIN_C_HEADER
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:69:9: note: expanded from macro '_CRT_BEGIN_C_HEADER'
__pragma(pack(push, _CRT_PACKING)) \
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:96:1: error: use of undeclared identifier 'push'
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:69:23: note: expanded from macro '_CRT_BEGIN_C_HEADER'
__pragma(pack(push, _CRT_PACKING)) \
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:96:1: error: expected ';' after top level declarator
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:70:9: note: expanded from macro '_CRT_BEGIN_C_HEADER'
extern "C" {
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:193:29: error: expected ';' after top level declarator
typedef unsigned __int64 size_t;
^
;
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:228:22: error: 'short wchar_t' is invalid
typedef unsigned short wchar_t;
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:228:5: warning: typedef requires a name [-Wmissing-declarations]
typedef unsigned short wchar_t;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:252:42: error: unknown type name 'size_t'
template <typename _CountofType, size_t _SizeOfArray>
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:366:51: error: unknown type name 'uintptr_t'; did you mean 'intptr_t'?
void __cdecl __security_check_cookie(_In_ uintptr_t _StackCookie);
^~~~~~~~~
intptr_t
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:195:30: note: 'intptr_t' declared here
typedef __int64 intptr_t;
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:367:67: error: unknown type name 'uintptr_t'; did you mean 'intptr_t'?
__declspec(noreturn) void __cdecl __report_gsfailure(_In_ uintptr_t _StackCookie);
^~~~~~~~~
intptr_t
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:195:30: note: 'intptr_t' declared here
typedef __int64 intptr_t;
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:371:8: error: unknown type name 'uintptr_t'; did you mean 'intptr_t'?
extern uintptr_t __security_cookie;
^~~~~~~~~
intptr_t
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:195:30: note: 'intptr_t' declared here
typedef __int64 intptr_t;
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:379:1: error: C++ requires a type specifier for all declarations
_CRT_END_C_HEADER
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:74:9: note: expanded from macro '_CRT_END_C_HEADER'
__pragma(pack(pop))
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:379:1: error: use of undeclared identifier 'pop'
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:74:23: note: expanded from macro '_CRT_END_C_HEADER'
__pragma(pack(pop))
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:379:18: error: expected ';' after top level declarator
_CRT_END_C_HEADER
^
;
In file included from main.cpp:2:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/istream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ostream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ios:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/xlocnum:13:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/cstdio:12:
In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/stdio.h:13:
In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/corecrt_wstdio.h:13:
C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/corecrt_stdio_config.h:35:10: error: Unsupported architecture
#error Unsupported architecture
^
In file included from main.cpp:2:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/istream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ostream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ios:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/xlocnum:15:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iterator:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iosfwd:14:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/cwchar:13:
In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/wchar.h:25:
C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/sys/stat.h:17:1: error: C++ requires a type specifier for all declarations
_CRT_BEGIN_C_HEADER
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:69:9: note: expanded from macro '_CRT_BEGIN_C_HEADER'
__pragma(pack(push, _CRT_PACKING)) \
^
In file included from main.cpp:2:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/istream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ostream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ios:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/xlocnum:15:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iterator:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iosfwd:14:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/cwchar:13:
In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/wchar.h:25:
C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/sys/stat.h:17:1: error: use of undeclared identifier 'push'
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:69:23: note: expanded from macro '_CRT_BEGIN_C_HEADER'
__pragma(pack(push, _CRT_PACKING)) \
^
In file included from main.cpp:2:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/istream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ostream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ios:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/xlocnum:15:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iterator:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iosfwd:14:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/cwchar:13:
In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/wchar.h:25:
C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/sys/stat.h:17:1: error: expected ';' after top level declarator
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:70:9: note: expanded from macro '_CRT_BEGIN_C_HEADER'
extern "C" {
^
In file included from main.cpp:2:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/istream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ostream:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ios:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/xlocnum:15:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iterator:11:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iosfwd:14:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/cwchar:13:
In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/wchar.h:25:
C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/sys/stat.h:27:5: error: unknown type name '_ino_t'
_ino_t st_ino;
^
C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/sys/stat.h:34:5: error: unknown type name '__time32_t'
__time32_t st_atime;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
this is the error the problem clang++ has given me g++ is giving me about 447 errors so yeah I'm clueless of what I should do
so I tried using cl.exe here's the compiler error
cl.exe /std:c++17 /Zi /EHsc /nologo /Fe: "C:\behe\My_life\programmation\rainmeter c++ app simple ii guess\main.exe" "C:\behe\My_life\programmation\rainmeter c++ app simple ii guess\main.cpp"
main.cpp
main.obj : error LNK2019: unresolved external symbol _WINRT_IMPL_SetErrorInfo#8 referenced in function "struct winrt::hresult __cdecl winrt::impl::get_runtime_activation_factory<struct winrt::Windows::Foundation::IActivationFactory>(struct winrt::param::hstring const &,void * *)" (??$get_runtime_activation_factory#UIActivationFactory#Foundation#Windows#winrt###impl#winrt##YA?AUhresult#1#ABUhstring#param#1#PAPAX#Z)
main.obj : error LNK2019: unresolved external symbol _WINRT_IMPL_GetErrorInfo#8 referenced in function "struct winrt::hresult __cdecl winrt::impl::get_runtime_activation_factory<struct winrt::Windows::Foundation::IActivationFactory>(struct winrt::param::hstring const &,void * *)" (??$get_runtime_activation_factory#UIActivationFactory#Foundation#Windows#winrt###impl#winrt##YA?AUhresult#1#ABUhstring#param#1#PAPAX#Z)
main.obj : error LNK2019: unresolved external symbol _WINRT_IMPL_SysAllocString#4 referenced in function "public: virtual int __stdcall winrt::impl::error_info_fallback::GetDescription(wchar_t * *)" (?GetDescription#error_info_fallback#impl#winrt##UAGHPAPA_W#Z)
main.obj : error LNK2019: unresolved external symbol _WINRT_IMPL_SysFreeString#4 referenced in function "public: static void __cdecl winrt::impl::bstr_traits::close(wchar_t *)" (?close#bstr_traits#impl#winrt##SAXPA_W#Z)
main.obj : error LNK2019: unresolved external symbol _WINRT_IMPL_SysStringLen#4 referenced in function "public: __thiscall winrt::hresult_error::hresult_error(struct winrt::hresult,struct winrt::take_ownership_from_abi_t)" (??0hresult_error#winrt##QAE#Uhresult#1#Utake_ownership_from_abi_t#1##Z)
C:\behe\My_life\programmation\rainmeter c++ app simple ii guess\main.exe : fatal error LNK1120: 5 unresolved externals
Related
I compliation the code with Vscode.
The clang -v:
clang version 14.0.3
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/msys64/mingw64/bin
You can see I get clang form msys.
The file I compliate use such header file:
#include <windows.h>
#include <windowsx.h>
#include <tchar.h>
#include <d2d1.h>
The task I use :
"args": [
"-fdiagnostics-color=always",
"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22000.0\\um\\x86\\user32.lib",
"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22000.0\\um\\x86\\ole32.lib",
"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22000.0\\um\\x86\\d2d1.lib",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"-mwindows"
],
And the complier messages :
C:\msys64\mingw64\bin\clang-cpp.exe -fdiagnostics-color=always "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22000.0\um\x86\user32.lib" "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22000.0\um\x86\ole32.lib" "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22000.0\um\x86\d2d1.lib" -g C:\Users\cookie\Desktop\GameEngineFromScratch\Platform\Windows\helloengine_d2d.cpp -o C:\Users\cookie\Desktop\GameEngineFromScratch\Platform\Windows\helloengine_d2d.exe -mwindows
clang-cpp: warning: C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22000.0\um\x86\user32.lib: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang-cpp: warning: C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22000.0\um\x86\ole32.lib: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang-cpp: warning: C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22000.0\um\x86\d2d1.lib: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang-cpp: warning: argument unused during compilation: '-mwindows' [-Wunused-command-line-argument]
I got a executable file but when I run it my terminal give me an erro message Unable to run: The specified executable is not a valid application for this operating system platform
It look like I got a executable file for linux but not windows.How to solve this question.
clang-cpp is the Clang preprocessor, not the C++ compiler. You should use clang++ for the C++ compiler front-end program.
i followed all the steps from https://v8.dev/docs/build-gn
to build release-static v8 lib but I'm getting this error :
using VC 2019 , win10 64bit from https://v8.dev/docs/build-gn
doing git branch it shows :
c:\Dev\my\v8\depot_tools\v8\v8>git branch
* (HEAD detached at origin/master)
master
the error I'm getting :
c:\Dev\my\v8\depot_tools\v8\v8>python tools/dev/v8gen.py x64.release
c:\Dev\my\v8\depot_tools\v8\v8>ninja -C out.gn/x64.release
ninja: Entering directory `out.gn/x64.release'
[1/1] Regenerating ninja files
[206/2990] LINK bytecode_builtins_list_generator.exe bytecode_builtins_list_generator.exe.pdb
FAILED: bytecode_builtins_list_generator.exe bytecode_builtins_list_generator.exe.pdb
ninja -t msvc -e environment.x64 -- ..\..\third_party\llvm-build\Release+Asserts\bin\lld-link.exe /nologo -libpath:..\..\third_party\llvm-build\Release+Asserts\lib\clang\12.0.0\lib\windows "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\lib\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64" /OUT:./bytecode_builtins_list_generator.exe /PDB:./bytecode_builtins_list_generator.exe.pdb #./bytecode_builtins_list_generator.exe.rsp
lld-link: error: could not open 'obj/v8_wrappers.lib': no such file or directory
[207/2990] LINK torque-language-server.exe torque-language-server.exe.pdb
FAILED: torque-language-server.exe torque-language-server.exe.pdb
ninja -t msvc -e environment.x64 -- ..\..\third_party\llvm-build\Release+Asserts\bin\lld-link.exe /nologo -libpath:..\..\third_party\llvm-build\Release+Asserts\lib\clang\12.0.0\lib\windows "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\lib\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64" /OUT:./torque-language-server.exe /PDB:./torque-language-server.exe.pdb #./torque-language-server.exe.rsp
lld-link: error: could not open 'obj/v8_wrappers.lib': no such file or directory
[208/2990] LINK torque.exe torque.exe.pdb
FAILED: torque.exe torque.exe.pdb
ninja -t msvc -e environment.x64 -- ..\..\third_party\llvm-build\Release+Asserts\bin\lld-link.exe /nologo -libpath:..\..\third_party\llvm-build\Release+Asserts\lib\clang\12.0.0\lib\windows "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\lib\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "-libpath:..\..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64" /OUT:./torque.exe /PDB:./torque.exe.pdb #./torque.exe.rsp
lld-link: error: could not open 'obj/v8_wrappers.lib': no such file or directory
[215/2990] CXX obj/test/unittests/cppgc_unittests_sources/member-unittest.obj
ninja: build stopped: subcommand failed.
It seems there are 5 symbols conflicted: nothrow_t, new, delete, new[], delete[]
[2/37] Building CXX object lib\CMakeFiles\cxx_shared.dir\__\src\algorithm.cpp.obj
FAILED: lib/CMakeFiles/cxx_shared.dir/__/src/algorithm.cpp.obj
C:\PROGRA~1\LLVM\bin\clang-cl.exe /nologo -TP -DNDEBUG -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -D_ALLOW_MSC_VER_MISMATCH -D_CRTBLD -D_CRT_SECURE_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -IC:\Users\User\AppData\Roaming\libcxx-master\include -fms-compatibility-version=19.00 --target=x86_64--windows -D_LIBC_NO_VCRUNTIME -D_LIBCPP_NO_VCRUNTIME /MD /O2 /Ob2 /DNDEBUG /std:c++14 -Wall -Wextra -W -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wno-user-defined-literals -Wno-covered-switch-default -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-compat -Wno-undef -Wno-reserved-id-macro -Wno-gnu-include-next -Wno-gcc-compat -Wno-zero-as-null-pointer-constant -Wno-deprecated-dynamic-exception-spec -Wno-sign-conversion -Wno-old-style-cast -Wno-deprecated -Wno-shift-sign-overflow -Wno-double-promotion -Wno-error -EHsc /Zl /showIncludes /Folib\CMakeFiles\cxx_shared.dir\__\src\algorithm.cpp.obj /Fdlib\CMakeFiles\cxx_shared.dir\ -c C:\Users\User\AppData\Roaming\libcxx-master\src\algorithm.cpp
In file included from C:\Users\User\AppData\Roaming\libcxx-master\src\algorithm.cpp:10:
In file included from C:\Users\User\AppData\Roaming\libcxx-master\include\random:1645:
In file included from C:\Users\User\AppData\Roaming\libcxx-master\include\istream:163:
In file included from C:\Users\User\AppData\Roaming\libcxx-master\include\ostream:137:
In file included from C:\Users\User\AppData\Roaming\libcxx-master\include\ios:215:
In file included from C:\Users\User\AppData\Roaming\libcxx-master\include\__locale:23:
In file included from C:\Users\User\AppData\Roaming\libcxx-master\include\support/win32/locale_win32.h:15:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\include\xlocinfo.h:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\include\yvals.h:9:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\crtdbg.h:13:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\include\vcruntime_new_debug.h:10:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\include\vcruntime_new.h(34,16): error: redefinition of 'nothrow_t'
struct nothrow_t {
^
C:\Users\User\AppData\Roaming\libcxx-master\include\new(123,25): note: previous definition is here
struct _LIBCPP_TYPE_VIS nothrow_t {};
^
This is my CMAKE. (also tried 19.20)
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM="C:/Program Files (x86)/Ninja/ninja.exe"
-DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe"
-DCMAKE_C_FLAGS="-fms-compatibility-version=19.00 --target=x86_64--windows -D_LIBC_NO_VCRUNTIME"
-DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe"
-DCMAKE_CXX_FLAGS="-fms-compatibility-version=19.00 --target=x86_64--windows -D_LIBC_NO_VCRUNTIME -D_LIBCPP_NO_VCRUNTIME"
-DCMAKE_C_LINK_EXECUTABLE="C:/Program Files/LLVM/bin/lld-link.exe"
-DCMAKE_CXX_LINK_EXECUTABLE="C:/Program Files/LLVM/bin/lld-link.exe"
-DLLVM_USE_LINKER="C:/Program Files/LLVM/bin/lld-link.exe"
-DLLVM_PATH="C:/Program Files/LLVM" -DLIBCXX_ENABLE_SHARED=YES
-DLIBCXX_ENABLE_STATIC=NO -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=YES
"C:/Users/User/AppData/Roaming/libcxx-master"
This is my SDK
set LIB=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\lib\x64;
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x64
Can I make it work? Where to send issue to whom?
I face the same issue with VS2019.
I removed no_runtime flags but set
-DCMAKE_C_LINK_EXECUTABLE="lld-link.exe -flavor link" ^
-DCMAKE_CXX_LINK_EXECUTABLE="lld-link.exe -flavor link" ^
Added -flavor link and it linked successfully. I did not test exceptions but test program with std::thread compiles and runs same as with cl compiler.
UPD: basic try-catch with std::exception thrown works
UPD: full cmake batch (your paths may vary!)
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM="D:/Programming/ninja-build/ninja.exe" ^
-DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER="clang-cl.exe" ^
-DCMAKE_C_FLAGS="-fms-compatibility-version=19.00 --target=x86_64--windows" ^
-DCMAKE_CXX_COMPILER="clang-cl.exe" ^
-DCMAKE_CXX_FLAGS="-fms-compatibility-version=19.00 --target=x86_64--windows " ^
-DCMAKE_C_LINK_EXECUTABLE="lld-link.exe -flavor link" ^
-DCMAKE_CXX_LINK_EXECUTABLE="lld-link.exe -flavor link" ^
-DLLVM_USE_LINKER="lld-link.exe" ^
-DLLVM_PATH="C:/Program Files/LLVM" -DLIBCXX_ENABLE_SHARED=YES ^
-DLIBCXX_ENABLE_STATIC=NO -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=YES ^
"D:\Programming\cpp_sandbox\libcxx-9.0.0.src"
Boost library header files were included in PATH AND SYMBOLS but building the program generates an error message:
10:27:13 **** Incremental Build of configuration gcc-debug for project DB8 ****
make MODE=debug CONFIGNAME=gcc-debug all
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `mkdir -p "out/gcc-debug/" && echo "-g -Wall - I/usr/include -fno-stack-protector -DXMLPARSER=libxml -DWITH_PARSIM - DWITH_NETBUILDER -I"C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include" -I"C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/cppconn" -IC:/local/boost_1_59_0/boost -I. - IC:/Users/LuisH.Forchesatto/Downloads/omnetpp-4.6/include" >out/gcc-debug//.last- copts'
defaultSensor.cc
In file included from C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/cppconn/connection.h:33:0,
from C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/mysql_connection.h:30,
from dbWriteWin.h:6,
from defaultSensor.cc:6:
C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/cppconn/warning.h:40:0: warning: ignoring #pragma warning [- Wunknown-pragmas]
#pragma warning (disable : 4290)
^
In file included from C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/cppconn/variant.h:38:0,
from C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/cppconn/connection.h:35,
from C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/mysql_connection.h:30,
from dbWriteWin.h:6,
from defaultSensor.cc:6:
C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/cppconn/exception.h:48:0: warning: ignoring #pragma warning [- Wunknown-pragmas]
#pragma warning (disable : 4290)
^
C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/cppconn/exception.h:52:0: warning: ignoring #pragma warning [- Wunknown-pragmas]
#pragma warning(push)
^
C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/cppconn/exception.h:53:0: warning: ignoring #pragma warning [- Wunknown-pragmas]
#pragma warning(disable: 4275)
^
C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/cppconn/exception.h:58:0: warning: ignoring #pragma warning [- Wunknown-pragmas]
#pragma warning(pop)
^
In file included from dbWriteWin.h:6:0,
from defaultSensor.cc:6:
C:/Program Files (x86)/MySQL/MySQL Connector C++ 1.1.6/include/mysql_connection.h:31:32: fatal error: boost/shared_ptr.hpp: No such file or directory
#include <boost/shared_ptr.hpp>
^
compilation terminated.
make: *** [out/gcc-debug//defaultSensor.o] Error 1
Makefile:94: recipe for target 'out/gcc-debug//defaultSensor.o' failed
10:27:14 Build Finished (took 1s.183ms)
The library is installed in the system, the folder/file exists in the computer and it's path is correct. What can be causing this error?
Contents of path and symbols:
https://dl.dropboxusercontent.com/u/85576999/paths%20and%20symbols.png
Contents of the boost library folder:
https://dl.dropboxusercontent.com/u/85576999/boost%20folder.png
Do not use spaces in paths. I suggest moving (or reinstalling) MySQL Connector libraries to the folder with simple name without spaces, for example: c:\mysqlconnector.
Check whether the path to boost is set for C++ language too - on the Path and Symbols screen there is Assembly language focused.
Take into account these cluses provided by Rudi.
How to fix [Error] expected primary-expression before 'void' Compiler: TDM-GCC 4.6.1 64-bit on this code
#include <iostream>
#include <pthread.h>
#include <stdlib.h>
using namespace std;
#define NUM_THREADS 5
int main ()
{
pthread_t threads[NUM_THREADS];
int rc;
int i;
for( i=0; i < NUM_THREADS; i++ ){
cout << "main() : creating thread, " << i << endl;
**rc = pthread_create(&threads[i], NULL, void * (*threadid *PrintHello));**
if (rc){
cout << "Error:unable to create thread," << rc << endl;
exit(-1);
}
}
pthread_exit(NULL);
}
void *PrintHello(void *threadid)
{
intptr_t tid;
tid = (intptr_t) threadid;
cout << "Hello World! Thread ID, " << tid << endl;
pthread_exit(NULL);
}
How do i go about fixing this error any help is welcome thanks in advance!
EDIT! Here is the exact compiler complaints
Compiler: TDM-GCC 4.6.1 64-bit
Executing g++.exe...
g++.exe "C:\Users\Thomas\Documents\c++\stuff\threads.cpp" -o "C:\Users\Thomas\Documents\c++\stuff\threads.exe" -march=pentium2 -mtune=pentium2 -msse2 - O2 -m32 -std=gnu++98 -pg -g3 -I"C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64- mingw32\include" -L"C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib" -static-libgcc -m32 -pg -g3
C:\Users\Thomas\Documents\c++\stuff\threads.cpp: In function 'int main()':
C:\Users\Thomas\Documents\c++\stuff\threads.cpp:16:45: error: expected primary-expression before 'void'
Execution terminated
[Error] expected primary-expression before 'void'
EDIT again Added full error and the error is on this line
rc = pthread_create(&threads[i], NULL, void * (*threadid *PrintHello));
16 45 C:\Users\Thomas\Documents\c++\stuff\threads.cpp [Error] expected primary-expression before 'void'
EDIT 3
Thanks to paul R with his partial solution after making the changes stated i get this
Compiler: TDM-GCC 4.6.1 64-bit
Executing g++.exe...
g++.exe "C:\Users\Thomas\Documents\c++\stuff\threads.cpp" -o "C:\Users\Thomas\Documents\c++\stuff\threads.exe" -march=pentium2 -mtune=pentium2 -msse2 -O2 -m32 -std=gnu++98 -pg -g3 -I"C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\include" -L"C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib" -static-libgcc -m32 -pg -g3
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libmingw32.a when searching for -lmingw32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmingw32.a when searching for -lmingw32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libmoldname.a when searching for -lmoldname
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmoldname.a when searching for -lmoldname
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libmingwex.a when searching for -lmingwex
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmingwex.a when searching for -lmingwex
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libmsvcrt.a when searching for -lmsvcrt
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmsvcrt.a when searching for -lmsvcrt
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libgmon.a when searching for -lgmon
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libgmon.a when searching for -lgmon
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libadvapi32.a when searching for -ladvapi32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libadvapi32.a when searching for -ladvapi32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libshell32.a when searching for -lshell32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libshell32.a when searching for -lshell32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libuser32.a when searching for -luser32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libuser32.a when searching for -luser32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libkernel32.a when searching for -lkernel32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libkernel32.a when searching for -lkernel32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libmingw32.a when searching for -lmingw32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmingw32.a when searching for -lmingw32
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libmoldname.a when searching for -lmoldname
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmoldname.a when searching for -lmoldname
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libmingwex.a when searching for -lmingwex
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmingwex.a when searching for -lmingwex
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib/libmsvcrt.a when searching for -lmsvcrt
c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmsvcrt.a when searching for -lmsvcrt
C:\Users\Thomas\AppData\Local\Temp\ccZIOBl3.o: In function `Z10PrintHelloPv':
C:/Users/Thomas/Documents/c++/stuff/threads.cpp:31: undefined reference to `_imp__pthread_exit'
C:\Users\Thomas\AppData\Local\Temp\ccZIOBl3.o: In function `main':
C:/Users/Thomas/Documents/c++/stuff/threads.cpp:17: undefined reference to `_imp__pthread_create'
C:/Users/Thomas/Documents/c++/stuff/threads.cpp:23: undefined reference to `_imp__pthread_exit'
collect2: ld returned 1 exit status
Execution terminated
Any other ideas would be appreciated thanks again in advance.
Change:
rc = pthread_create(&threads[i], NULL, void * (*threadid *PrintHello));
to:
rc = pthread_create(&threads[i], NULL, PrintHello, NULL);
You should also add a prototype for PrintHello prior to main:
void *PrintHello(void *threadid);