djyt / cannonball

Cannonball: An Enhanced OutRun Engine
http://reassembler.blogspot.com
649 stars 116 forks source link

Unable to build on arch linux #116

Closed jaoxford closed 3 years ago

jaoxford commented 3 years ago

I am unable to build on arch linux. The steps I took were:

cd cmake/
cmake .
make .

Output:

[  2%] Linking CXX executable cannonball
/usr/bin/ld: cannot find -lopengl32
/usr/bin/ld: cannot find -lglu32
/usr/bin/ld: cannot find -ldxguid
/usr/bin/ld: cannot find -ldinput8
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/cannonball.dir/build.make:851: cannonball] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/cannonball.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Any ideas on what to do?

drfiemost commented 3 years ago

You have to specify the TARGET, also building in a separate directory is recommended:

mkdir build && cd build
cmake -DTARGET=linux.cmake ../cmake
make
jaoxford commented 3 years ago

Thanks for reaching out to me. Just tried that. Here's the output:


mkdir build && cd build
[jacob@jacob build]$ cmake -DTARGET=linux.cmake ../cmake
CMake files for linux.cmake found
CMake Warning (dev) at /usr/share/cmake-3.21/Modules/FindOpenGL.cmake:315 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  linux.cmake:6 (find_package)
  CMakeLists.txt:29 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib/libOpenGL.so   
SDL2 Include  : /usr/include;/usr/include/SDL2
SDL2 Libraries: /usr/lib/libSDL2main.a;/usr/lib/libSDL2-2.0.so.0.16.0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jacob/Downloads/cannonball/cmake
[jacob@jacob build]$ make
make: *** No targets specified and no makefile found.  Stop.
[jacob@jacob build]$ 

I think you forgot to mention that I had to cd into the cmake directory to run make. Doing that built it.