Arukiap / Fractal-Xplorer

A 3D fractal generator using OpenGL, C++ and GLSL shaders
10 stars 2 forks source link

Error compiling on windows: can't open SDL2main.lib #1

Open Geof23 opened 4 years ago

Geof23 commented 4 years ago

I followed the instructions for building on Windows in README. What am I missing?

clang++ *.cpp -I.\include\ -Llib -L. -lglew32s -lSDL2main -lSDL2 -o fractals.exe -lopengl32
...
 "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.25.28610\\bin\\Hostx64\\x64\\link.exe" -out:fractals.exe -defaultlib:libcmt "-libpath:C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.25.28610\\lib\\x64" "-libpath:C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.25.28610\\atlmfc\\lib\\x64" "-libpath:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.18362.0\\ucrt\\x64" "-libpath:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.18362.0\\um\\x64" -libpath:lib -libpath:. -nologo "C:\\Users\\v-jesawa\\AppData\\Local\\Temp\\camera-0a0c67.o" "C:\\Users\\v-jesawa\\AppData\\Local\\Temp\\display-ea8967.o" "C:\\Users\\v-jesawa\\AppData\\Local\\Temp\\main-bf02cf.o" "C:\\Users\\v-jesawa\\AppData\\Local\\Temp\\menu-011216.o" "C:\\Users\\v-jesawa\\AppData\\Local\\Temp\\mesh-163515.o" "C:\\Users\\v-jesawa\\AppData\\Local\\Temp\\mouse-0faa69.o" "C:\\Users\\v-jesawa\\AppData\\Local\\Temp\\shader-1c97a6.o" glew32s.lib SDL2main.lib SDL2.lib opengl32.lib
LINK : fatal error LNK1181: cannot open input file 'SDL2main.lib'
clang++: error: linker command failed with exit code 1181 (use -v to see invocation)
Arukiap commented 4 years ago

Hi @Geof23 !

Can you please remove the -L. part from your command? I believe that by running the command you specified above which has two instances of the -L argument option, you are overwriting -Llib, which is the argument option that specifies the path to the libraries that are to be linked (thus the compiler is searching for the libraries in ., the root directory of the repository, and not on the /lib directory where it should be looking).

Please try removing the duplicate -L. option and tell me if that works.

Geof23 commented 4 years ago

You can have multiple -L args. It’s finding the other libs in lib

On Fri, Apr 10, 2020 at 8:16 AM Ruben Carvalho notifications@github.com wrote:

Hi @Geof23 https://github.com/Geof23 !

Can you please remove the -L. part from your command? I believe that by doing so, you are overwriting -Llib, which is the command that specifies the path to the libraries that are to be linked.

Please try removing the duplicate -L. option and tell me if that works.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Arukiap/Fractal-Xplorer/issues/1#issuecomment-612074027, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMJOD6VQBK66SONZKEJ3MDRL4Z6LANCNFSM4MFIJHMQ .

Geof23 commented 4 years ago

Anyway, Ruben, I appreciate you getting back so quickly.

When I use your suggestion, I get the same problem:

clang++ *.cpp -I.\include\ -Llib -lglew32s -lSDL2main -lSDL2 -lOpenGL32 -o fractals.exe

LINK : fatal error LNK1181: cannot open input file 'SDL2main.lib' clang++: error: linker command failed with exit code 1181 (use -v to see invocation)

On Fri, Apr 10, 2020 at 11:00 AM Geof Sawaya geof.sawaya@gmail.com wrote:

You can have multiple -L args. It’s finding the other libs in lib

On Fri, Apr 10, 2020 at 8:16 AM Ruben Carvalho notifications@github.com wrote:

Hi @Geof23 https://github.com/Geof23 !

Can you please remove the -L. part from your command? I believe that by doing so, you are overwriting -Llib, which is the command that specifies the path to the libraries that are to be linked.

Please try removing the duplicate -L. option and tell me if that works.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Arukiap/Fractal-Xplorer/issues/1#issuecomment-612074027, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMJOD6VQBK66SONZKEJ3MDRL4Z6LANCNFSM4MFIJHMQ .

Arukiap commented 4 years ago

@Geof23 No problem! I would kindly ask you to try out the gcc g++ compiler instead, for the time being. I had a buddy of mine do a clean installation of this repository using the MINGW compiler and it worked for him on a Windows machine.

Geof23 commented 4 years ago

Cool, Ruben -- I'll let you know what works

On Fri, Apr 10, 2020 at 1:11 PM Ruben Carvalho notifications@github.com wrote:

@Geof23 https://github.com/Geof23 No problem! I would kindly ask you to try out the gcc g++ compiler instead, for the time being. I had a buddy of mine do a clean installation of this repository using the MINGW compiler and it worked for him on a Windows machine.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Arukiap/Fractal-Xplorer/issues/1#issuecomment-612197228, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMJODZ2ESMM62BO6PO4A4LRL54P5ANCNFSM4MFIJHMQ .