MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0013769 | CMake | Modules | public | 2012-12-02 03:53 | 2013-05-06 09:32 |
Reporter | R Cullen | ||||
Assigned To | Benjamin Eikel | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | MinGW | OS | Windows | OS Version | 7 |
Product Version | CMake 2.8.10.1 | ||||
Target Version | Fixed in Version | ||||
Summary | 0013769: FindSDL.cmake libraries in wrong order | ||||
Description | The FindSDL.cmake file does not order the SDL libraries correctly. "-lSDLmain" must be added to the g++ arguments before "-lSDL", not doing this results in linking errors like those below : c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/lib\libSDLmain.a(SDL_win32_main.o): In function `redirect_output': /Users/slouken/release/SDL/SDL-1.2.15/./src/main/win32/SDL_win32_main.c:219: undefined reference to `SDL_strlcpy' /Users/slouken/release/SDL/SDL-1.2.15/./src/main/win32/SDL_win32_main.c:220: undefined reference to `SDL_strlcat' ... | ||||
Steps To Reproduce | Install MinGW Compile SDL using MinGW Compile attached program using : cmake -Wdev -DSDL_BUILDING_LIBRARY=FALSE -G"MSYS Makefiles" .. && make VERBOSE=1 | ||||
Additional Information | Here are the sources if you dont trust the .zip test.cpp #include "SDL.h" #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 #define SCREEN_DEPTH 8 int main(int argc, char *argv[]) { SDL_Surface *screen; Uint8 *p; int x = 10; int y = 20; SDL_Init(SDL_INIT_VIDEO); screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_DEPTH, SDL_SWSURFACE); p = (Uint8 *)screen->pixels + y * screen->pitch + x * screen->format->BytesPerPixel; *p=0xf0; SDL_Flip(screen); while(1); } CMakeLists.txt cmake_minimum_required(VERSION 2.6) project(MyProject) set(EXECUTABLE_NAME "sdl_bug") #SET THIS TO YOUR MING INSTALATION if( WIN32 ) set(CMAKE_PREFIX_PATH "c:/MinGW/") endif() add_executable(${EXECUTABLE_NAME} test.cpp) find_package(SDL REQUIRED) if(SDL_FOUND) include_directories(${SDL_INCLUDE_DIR}) target_link_libraries(${EXECUTABLE_NAME} ${SDL_LIBRARY}) endif() | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | sources.zip (898) 2012-12-02 03:53 https://public.kitware.com/Bug/file/4580/sources.zip | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2012-12-02 03:53 | R Cullen | New Issue | |||
2012-12-02 03:53 | R Cullen | File Added: sources.zip | |||
2012-12-02 07:53 | Benjamin Eikel | Note Added: 0031795 | |||
2012-12-02 08:38 | Benjamin Eikel | Note Added: 0031796 | |||
2012-12-31 11:20 | Benjamin Eikel | Status | new => resolved | ||
2012-12-31 11:20 | Benjamin Eikel | Resolution | open => fixed | ||
2012-12-31 11:20 | Benjamin Eikel | Assigned To | => Benjamin Eikel | ||
2013-05-06 09:32 | Robert Maynard | Note Added: 0032995 | |||
2013-05-06 09:32 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|