I'm trying to install libcurl for Bloodshed Dev C++ but I'm running into a couple of issues.
I've included the curl directory under Dev-Cpp\MinGW\include and have placed the library files (which I compiled myself using MinGW) in the Dev-Cpp\MinGW\lib directory. I have added all the libraries I'm using to the Linker tab under Project> Project Options> Parameters.
Here is the code I'm using to test libcurl:
#define CURL_STATICLIB
#include "curl/curl.h"
#include <stdio.h>
#include <stdlib.h>
int main(void) {
CURLcode ret;
CURL *curl = curl_easy_init();
if (curl == NULL) {
fprintf(stderr, "Failed creating CURL easy handle!\n");
exit(EXIT_FAILURE);
}
/*Attempt to get Facebook*/
ret = curl_easy_setopt(curl, CURLOPT_URL, "http://www.facebook.com");
if (ret != CURLE_OK) {
fprintf(stderr, "Failed getting http://www.google.com: %s\n",
curl_easy_strerror(ret));
exit(EXIT_FAILURE);
}
ret = curl_easy_perform(curl);
if (ret != 0) {
fprintf(stderr, "Failed getting http://www.google.com: %s\n",
curl_easy_strerror(ret));
exit(EXIT_FAILURE);
}
return 0;
}
Now, the error enter code hereI'm getting is this:
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/libcurl.a when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/libcurl.dll when searching for -lcurlskipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/lib\libcurl.a when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../lib/libcurl.a when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../lib/libcurl.dll when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../lib\libcurl.a when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../libcurl.a when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../libcurl.dll when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../..\libcurl.a when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/libcurl.a when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/libcurl.dll when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../lib/libcurl.a when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../lib/libcurl.dll when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../libcurl.a when searching for -lcurl
skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../libcurl.a when searching for -lcurl
cannot find -lcurl
[Error] ld returned 1 exit status
recipe for target 'Test.exe' failed
I am thoroughly stuck, and would deeply appreciate someone calling me an idiot and telling me what I'm doing wrong.
"skipping incompatible" usually indicates a architecture mismatch. A wild guess is that you should add -m32 in your compile flags. (or -m64, but judging from the installation path -m32 looks more likely.)
(Unrelated to the question, but I can't help but notice that your code is requesting facebook.com and printing a error mentioning google.com.)
I've solved the issue by switching to Codeblocks, using a different distribution and following the tutorial listed below.
Using LibCURL C++
Related
Well, i did all i knew to work with allegro in C++ but i keep getting the same problem,
-lalleg not found
D:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\bin\ld.exe skipping incompatible D:\Program Files (x86)\Dev-Cpp\MinGW64\lib/liballeg.a when searching for -lalleg
D:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\bin\ld.exe skipping incompatible D:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../liballeg.a when searching for -lalleg
D:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\bin\ld.exe cannot find -lalleg
E:\Programacion\C++\Practicas\Allegro\Testing\collect2.exe [Error] ld returned 1 exit status
i tried to make DevC++ to send the -lalleg at compiling but i keep getting that
,if i don't put the compiler to use -lalleg
i get this
D:\Users\J****n\AppData\Local\Temp\ccz9vWbS.o In function `_mangled_main()':
4 E:\Programacion\C++\Practicas\Allegro\Testing\Main.cpp undefined reference to `_install_allegro_version_check'
D:\Users\J****n\AppData\Local\Temp\ccz9vWbS.o In function `WinMain':
7 E:\Programacion\C++\Practicas\Allegro\Testing\Main.cpp undefined reference to `_WinMain'
E:\Programacion\C++\Practicas\Allegro\Testing\collect2.exe [Error] ld returned 1 exit status
any of you know of any possible solution
i'm using Allegro 4.2.2 and the last version of DevC++
the code is something basig ,just a test
int main(){
allegro_init();
return 0;
}
END_OF_MAIN();
any help is welcome,thank you for the time
I'm trying to use MingGW on Windows but when I try to compile my c/c++ files, following error occurs when I compile with C(gcc)
> gcc c:\Users\Administrator\Desktop\C_C++\helloworld\hello.c - o c:\Users\Administrator\Desktop\C_C++\helloworld/hello
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc_eh
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc_eh
collect2.exe: error: ld returned 1 exit status
and following error occurs when I compile with C++(g++)
> g++ c:\Users\Administrator\Desktop\C_C++\helloworldcpp\hello.cpp -o c:\Users\Administrator\Desktop\C_C++\helloworldcpp/hello
g++.exe: error: CreateProcess: No such file or directory
The path variable is C:\MinGW\bin . I've downloaded mingw-developer-toolkit, mingw32-base, mingw32-gcc-g++ and msys-base among the basic setup packages. Also I'm getting #include error for iostream. I've tried almost all of the methods out in the internet but couldn't fix.
It seems like MinGW wasn't installed correctly.
Re-installing it will likely fix the issue.
I'm trying to link SFML2.3.1 in Codelite 9.1.3. I'm using Windows 10, 64 bit. I did everything according to this tutorial http://en.sfml-dev.org/forums/index.php?topic=18820.0. I did the Include Paths, the Library Paths, entered the libraries including the dependencies in the correct order. A lot of other people have asked similar questions and I've tried all the solutions offered there-Linking SFML in CodeLite - and several others. Here's the error I get:
C:\WINDOWS\system32\cmd.exe /C C:/TDM-GCC-64/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ CodeLiteProject - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/Benjamin/Documents/sfml/CodeLiteProject'
C:/TDM-GCC-64/bin/g++.exe -o ./Debug/CodeLiteProject #"CodeLiteProject.txt" -L. -LC:/SFML-2.3.1/lib -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lsfml-audio-s -lsfml-network-s -lopengl32 -lfreetype -ljpeg -lwinmm -lgdi32 -lopenal32 -lws2_32
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib/libsfml-graphics-s.a when searching for -lsfml-graphics-s
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib\libsfml-graphics-s.a when searching for -lsfml-graphics-s
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib/libsfml-graphics-s.a when searching for -lsfml-graphics-s
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsfml-graphics-s
And it repeats those same last four lines for each library (skipping incompatible - cannot find). Then after all that it says this:
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[1]: *** [Debug/CodeLiteProject] Error 1
CodeLiteProject.mk:78: recipe for target 'Debug/CodeLiteProject' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/Benjamin/Documents/sfml/CodeLiteProject'
mingw32-make.exe: *** [All] Error 2
All I've ever really done with a compiler before is hit "Build and Run", so I really appreciate any help. Also, I've tried every different variation of ways of entering the libraries (-l*, *-s, *-s-d, *.lib, *.a, etc.)
This line:
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib/libsfml-graphics-s.a when searching for -lsfml-graphics-s
This error usually means that you have an arch differences, i.e. your code is compiled as a 64 bit application, while the SFML libraries are built as 32 bit library.
Try using SFML libraries that are built with a 64 bit compiler (preferably using the same compiler as the one you are using - TDM-GCC 64 bit/v5.1)
It doesn't appear that you're linking the debug SFML libs, yet the project is being built in Debug mode. Append "-d" to the end of the SFML lib names when building in Debug, e.g.:
/TDM-GCC-64/bin/g++.exe -o ./Debug/CodeLiteProject #"CodeLiteProject.txt" -L. -LC:/SFML-2.3.1/lib -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lsfml-audio-s-d -lsfml-network-s-d ...
I have one question about SDL compile, I use DEV C++ compiler a SDL program, but there is a error, the error log:
d:\program files (x86)\dev-cpp\mingw64\x86_64-w64-mingw32\bin\ld.exe cannot find -lSDLmain
d:\program files (x86)\dev-cpp\mingw64\x86_64-w64-mingw32\bin\ld.exe cannot find -lSDL
d:\program files (x86)\dev-cpp\mingw64\x86_64-w64-mingw32\bin\ld.exe cannot find -lobjc
D:\C++\SDL\collect2.exe [Error] ld returned 1 exit status
I learn it from : http://tjumyk.github.io/sdl-tutorial-cn/lessons/lesson01/windows/devcpp/index.html
I completely followed the course step by step to install and config ,but it doesn't compile.
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);