User forums > Using Code::Blocks

Project not building after change in its properties

(1/3) > >>

pion:
I'm trying to import the SDL2 library and followed these two tutorials:

https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/codeblocks/index.php
https://www.youtube.com/watch?v=QV6bOYbT_-I&t=57s

However, after I changed the project's properties accordingly (add search directory, edit linker options, add library directory etc. ), pasted the code and put the .dll file into the project folder, (it gives me no errors when debugging) it repeatedly asks me if I want to build the project, but won't execute the program or build the project. It only happens after changing the properties, the code seems to be alright.

Code (If it has something to do with it,  taken from the second tutorial link):


--- Code: ---#include <iostream>
using namespace std;
#include <SDL2/SDL.h>

int main(int argc, char* argv[])
{
    SDL_Init(SDL_INIT_EVERYTHING);
    cout << "Hello" << endl;
    SDL_Window* window;
    window = SDL_CreateWindow("MyWindowTitle", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
    640, 480, SDL_WINDOW_RESIZABLE);
    SDL_Delay(4000);
    SDL_DestroyWindow(window);
    SDL_Quit();
}

--- End code ---

I would appreciate your help!

Miguel Gimenez:
Post a full rebuild log, see this FAQ (you can get an error from Cloudflare, retry sone times)

pion:
Sorry, no matter how long I try the site doesnt load.

Miguel Gimenez:
In brief:
   - Open your project
   - Go to Settings -> Compiler -> Other settings and select "Full command line"
   - Select Build -> Rebuild
   - Select the "Build log" tab in the "Logs and others" window (not the "Build messages" one)
   - Right click in the tab and select "Copy contents to clipboard"
   - Paste the contents here using code tags


pion:
Here:


--- Code: ---
-------------- Clean: Debug in SDL2test (compiler: GNU GCC Compiler)---------------

Cleaned "SDL2test - Debug"

-------------- Build: Debug in SDL2test (compiler: GNU GCC Compiler)---------------

gcc.exe -Wall -g -I..\..\..\..\SDL2\SDL2-2.0.16\i686-w64-mingw32\include -c C:\Users\lr\Desktop\SDL2\sdl2.c -o obj\Debug\sdl2.o
gcc.exe -L..\..\..\..\SDL2\SDL2-2.0.16\i686-w64-mingw32\lib -o bin\Debug\SDL2.exe obj\Debug\sdl2.o  -lmingw32 -lSDL2main -lSDL2 
C:\Users\lr\Desktop\SDL2\sdl2.c: In function 'SDL_main':
C:\Users\lr\Desktop\SDL2\sdl2.c:14:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\SDL2\SDL2-2.0.16\i686-w64-mingw32\lib/libSDL2main.a when searching for -lSDL2main
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\SDL2\SDL2-2.0.16\i686-w64-mingw32\lib\libSDL2main.a when searching for -lSDL2main
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\SDL2\SDL2-2.0.16\i686-w64-mingw32\lib/libSDL2main.a when searching for -lSDL2main
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2main
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\SDL2\SDL2-2.0.16\i686-w64-mingw32\lib/libSDL2.dll.a when searching for -lSDL2
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\SDL2\SDL2-2.0.16\i686-w64-mingw32\lib/libSDL2.a when searching for -lSDL2
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\SDL2\SDL2-2.0.16\i686-w64-mingw32\lib\libSDL2.a when searching for -lSDL2
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\SDL2\SDL2-2.0.16\i686-w64-mingw32\lib/libSDL2.dll.a when searching for -lSDL2
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\SDL2\SDL2-2.0.16\i686-w64-mingw32\lib/libSDL2.a when searching for -lSDL2
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 1 second(s))
3 error(s), 1 warning(s) (0 minute(s), 1 second(s))
 


--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version