fogleman / Craft

A simple Minecraft clone written in C using modern OpenGL (shaders).
http://www.michaelfogleman.com/craft/
MIT License
10.44k stars 1.39k forks source link

mingw32-make Error. #208

Open 09jlardinois opened 6 years ago

09jlardinois commented 6 years ago

I've got C:\Program Files\CURL setup with \lib \bin \include and .\ from that directory in the PATH variables. Just hasn't been working. I truly don't know what I'm doing because I've never used C or cMake. Just looking for the updated glfw build. Can't seem to build.

I keep getting this error even after multiple restarts and bypassing permissions by plopping it in other folders.

[ 14%] Built target glfw [ 15%] Linking C executable craft.exe CMakeFiles\craft.dir/objects.a(auth.c.obj):auth.c:(.text+0xae): undefined reference to_impcurl_easy_init' CMakeFiles\craft.dir/objects.a(auth.c.obj):auth.c:(.text+0x11a): undefined reference to _imp__curl_easy_setopt' CMakeFiles\craft.dir/objects.a(auth.c.obj):auth.c:(.text+0x189): undefined reference to_impcurl_easy_perform' CMakeFiles\craft.dir/objects.a(auth.c.obj):auth.c:(.text+0x1a4): undefined reference to _imp__curl_easy_getinfo' CMakeFiles\craft.dir/objects.a(auth.c.obj):auth.c:(.text+0x1ad): undefined reference to_impcurl_easy_cleanup' CMakeFiles\craft.dir/objects.a(main.c.obj):main.c:(.text.startup+0x2a): undefined reference to _imp__curl_global_init' CMakeFiles\craft.dir/objects.a(main.c.obj):main.c:(.text.startup+0x1975): undefined reference to_impcurl_global_cleanup' collect2.exe: error: ld returned 1 exit status CMakeFiles\craft.dir\build.make:343: recipe for target 'craft.exe' failed mingw32-make[2]: [craft.exe] Error 1 CMakeFiles\Makefile2:71: recipe for target 'CMakeFiles/craft.dir/all' failed mingw32-make[1]: [CMakeFiles/craft.dir/all] Error 2 Makefile:128: recipe for target 'all' failed mingw32-make: *** [all] Error 2`

09jlardinois commented 6 years ago

Something to do with Norton Antivirus. I fixed that part, but now I get this error.

[ 14%] Built target glfw mingw32-make[2]: *** No rule to make target 'C:/Program Files/CURL/lib/libcurl.dll.a', needed by 'craft.exe'. Stop. CMakeFiles\Makefile2:71: recipe for target 'CMakeFiles/craft.dir/all' failed mingw32-make[1]: *** [CMakeFiles/craft.dir/all] Error 2 Makefile:128: recipe for target 'all' failed mingw32-make: *** [all] Error 2

It can't find libcurl.dll.a even though it's clearly in the right path.

09jlardinois commented 6 years ago

Restarted from scratch. I get this:

CMakeFiles\craft.dir\objects.a(auth.c.obj):auth.c:(.text+0xae): undefined reference to `_imp__curl_easy_init' CMakeFiles\craft.dir\objects.a(auth.c.obj):auth.c:(.text+0x11a): undefined reference to `_imp__curl_easy_setopt' CMakeFiles\craft.dir\objects.a(auth.c.obj):auth.c:(.text+0x189): undefined reference to `_imp__curl_easy_perform' CMakeFiles\craft.dir\objects.a(auth.c.obj):auth.c:(.text+0x1a4): undefined reference to `_imp__curl_easy_getinfo' CMakeFiles\craft.dir\objects.a(auth.c.obj):auth.c:(.text+0x1ad): undefined reference to `_imp__curl_easy_cleanup' CMakeFiles\craft.dir\objects.a(main.c.obj):main.c:(.text.startup+0x2a): undefined reference to `_imp__curl_global_init' CMakeFiles\craft.dir\objects.a(main.c.obj):main.c:(.text.startup+0x1975): undefined reference to `_imp__curl_global_cleanup' collect2.exe: error: ld returned 1 exit status CMakeFiles\craft.dir\build.make:343: recipe for target 'craft.exe' failed mingw32-make[2]: *** [craft.exe] Error 1 CMakeFiles\Makefile2:71: recipe for target 'CMakeFiles/craft.dir/all' failed mingw32-make[1]: *** [CMakeFiles/craft.dir/all] Error 2 Makefile:128: recipe for target 'all' failed mingw32-make: *** [all] Error 2

sharabiania commented 6 years ago

It has something to do with the curl libraries on Windows. As the error says, it cannot find references to _imp_curl_easy_init.

I'm getting the same issue.

The documentation on how to setup and build on Windows needs to get improved (specially the part about installing curl).

09jlardinois commented 5 years ago

It has something to do with the curl libraries on Windows. As the error says, it cannot find references to _imp_curl_easy_init.

Just wanted to let you know, I got it working. I kind of suspected maybe it was looking for a 32-bit CURL library even though I'm on 64-bit, so what I did instead of put the CURL/ folder containing lib and include folders into both /Program files and /Program Files (x86).

It built successfully and runs successfully without error, and includes the latest GLFW with the wandering / rising cursor fix.

RaspberryEqualsPi commented 4 years ago

i did what 09jilardinois in code blocks, i used the 32 bit libraries and stuff and it worked!

ignacionr commented 4 years ago

@09jlardinois can you close this issue, then?