Page 1 of 2

cmake errors

Posted: Sun Dec 16, 2012 9:11 am UTC
by killing time

I'm trying to compile the source with mingw on Windows. My problem is that I cannot get cmake to find any libraries. I don't want to compile them now (I tried that for one and it did not work either). Instead want to use the files I already have. First of all I should make sure I understand what is meant by a library. It refers to the .dll files, right? Or is it something else that it is looking for? I tried pasting the DLLs all over the place but to no avail.

The error stems from the following line in cmakelist.txt:

Code: Select all

find_package( SDL REQUIRED )

with a message 'could NOT find SDL (missing: SDL_LIBRARY)'
The error also occurs for dozens of similar lines for finding GLEW, zlib, etc.
Where and for what does this command search?


Re: cmake errors

Posted: Mon Dec 17, 2012 4:43 am UTC
by danmal

Have you considered using VS? It's much easier to setup and there's a free version available for download.

In general you'll want to link against .a or .lib files and not a .dll. I don't use MinGW but I'm sure someone who does can provide more info.


Re: cmake errors

Posted: Mon Dec 17, 2012 10:12 am UTC
by Ishq

Using MingW32 is a bit more annoying because you have to configure all the paths yourself. Start up CMake GUI and for all the missing libraries, specify the paths. The libraries can either be found in your Mingw32 install or in the src/libs dir in the Unvanquished source tree. If you pick the libs from the Unvanquished source tree, make sure you pick the proper architecture.


Re: cmake errors

Posted: Tue Dec 18, 2012 2:26 pm UTC
by killing time

Took me hours to understand that the variables are actually requesting input, and are not supposed to be automatically generated. It's quite an intimidating list of values it wants the user to enter... I typed in some things but it definitely feels like I'm doing it wrong--this could take months. To my further dismay, I realized there is no verification as to whether you entered something correctly. It will say it "found" a library even if you didn't enter a valid path. I wonder how much more noobish flailing I will do before giving up, lol. Perhaps it is simply a wrongheaded idea to try this on a Windows machine.


Re: cmake errors

Posted: Wed Dec 19, 2012 12:47 am UTC
by epicdude

do it on a linux like a boss


Re: cmake errors

Posted: Wed Dec 19, 2012 1:57 am UTC
by Ishq
killing time wrote:

Took me hours to understand that the variables are actually requesting input, and are not supposed to be automatically generated. It's quite an intimidating list of values it wants the user to enter... I typed in some things but it definitely feels like I'm doing it wrong--this could take months. To my further dismay, I realized there is no verification as to whether you entered something correctly. It will say it "found" a library even if you didn't enter a valid path. I wonder how much more noobish flailing I will do before giving up, lol. Perhaps it is simply a wrongheaded idea to try this on a Windows machine.

I suppose that's true. You could use a free version of VS and get the benefit of the batch script though.


Re: cmake errors

Posted: Thu Dec 20, 2012 3:02 am UTC
by danmal

Cmake will try to find your libraries. If they're all in one place you can pass -DCMAKE_PREFIX_PATH="C:/path/to/folder" and CMake should be able to find them.


Re: cmake errors

Posted: Thu Dec 20, 2012 6:18 am UTC
by killing time

I tried compiling in VS and still experienced problems. I got something out of cmake this time, but then it was unable to compile the SDL library.


Re: cmake errors

Posted: Thu Dec 20, 2012 6:54 am UTC
by danmal

Can you post output from VS as well as your CMakeCache.txt file?


Re: cmake errors

Posted: Fri Dec 21, 2012 11:02 am UTC
by killing time

OK, thank you for taking so much interest in this problem.

A couple of files had these includes which cause errors:

Code: Select all

#include <ddraw.h>
#include <dsound.h>
#include <dinput.h>

There weren't any files with these names anywhere in the source directory.

Compiler output for SDL project:

Code: Select all

------ Build started: Project: INTERNAL_SDL, Configuration: Debug Win32 ------
Compiling...
SDL_dx5audio.c
c:\unvsource\unvanquished-master\src\libs\libsdl\src\audio\windx5\directx.h(78) : fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory
SDL_dx5yuv.c
c:\unvsource\unvanquished-master\src\libs\libsdl\src\video\windx5\directx.h(78) : fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory
SDL_dx5video.c
c:\unvsource\unvanquished-master\src\libs\libsdl\src\video\windx5\directx.h(78) : fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory
SDL_dx5events.c
c:\unvsource\unvanquished-master\src\libs\libsdl\src\video\windx5\directx.h(78) : fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory
Generating Code...
Build log was saved at "file://c:\unvsource\Unvanquished-master\build-32\src\libs\libsdl\INTERNAL_SDL.dir\Debug\BuildLog.htm"
INTERNAL_SDL - 4 error(s), 0 warning(s)

I attached CMakeCache.txt. It is plain text, not zipped. I had to rename it because the forum refused to upload it when the extension was txt.