Recent Posts

Pages: 1 2 3 [4] 5 6 7 8 9 10
31
General (but related to Code::Blocks) / Use of logos in templates
« Last post by Buongiorno on Yesterday at 02:28:06 am »
Hello,

   I saw there is templates with logos. Are the use of logos (DirectX, Java and others) licensed, authorized or something like this?
32
Using Code::Blocks / Re: Disabling PCH for a single file
« Last post by nji on July 03, 2020, 09:28:28 pm »
That problem arises when inserting sqlite amalgamation (C) into
an wxWidget project (C++).
The latter has project wide PCH usage and this doesn't work for
the sqlite code.
I meanwhile tried to disable PCH usage in the advanced properties
of sqlite.c, adding  -DNOPCH to
Code: [Select]
$compiler $options $includes -c $file -o $objectBut no effect, it still uses pch.
The command line is like this
Code: [Select]
gcc.exe  -DNOPCH -Wall -pipe -mthreads -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -DWX_PRECOMP -g -ID:\develop\wxWidgets\include -ID:\develop\wxWidgets\lib\gcc_dll\mswu -c D:\develop\sqlite-amalgamation-3310100\sqlite3.c -o obj\Debug\sqlite-amalgamation-3310100\sqlite3.o
33
Using Code::Blocks / Re: SDL2 with CodeBlocks 20.03
« Last post by omnishambles on July 03, 2020, 03:35:01 pm »
Quick reply - your project worked perfectly on my machine. Thanks!

I don't understand how CB works yet, but clearly some settings relating to libraries, search paths, etc. are set in the project file as opposed to CB's settings menus. Per-project settings as opposed to global CB settings I guess. Haven't got time to look closely now, but I'm very pleased that it works at all, and will look at this over the weekend. Many thanks again.

On the licence issue, I see what you mean about Lazy Foo. I use tutorials to learn principles from rather than copy/paste from, so that shouldn't be a problem. I'll use the libsdl docs as a starting point anyway.
34
Using Code::Blocks / Re: SDL2 with CodeBlocks 20.03
« Last post by stahta01 on July 03, 2020, 03:28:56 pm »
Most people use "Lazy Foo"; but, I did not like the license.
I tried to use https://www.willusher.io/pages/sdl2/ but decided to stop when something else happened in my life.

Since "Lazy Foo" uses C and www.willusher.io uses C++ you likely will want to use "Lazy Foo".
But, if this is for commercial use you likely want to find another place to learn SDL2!
Unless the license for "Lazy Foo" has changed since 5 years, ago.

Tim S.


35
Using Code::Blocks / Re: SDL2 with CodeBlocks 20.03
« Last post by stahta01 on July 03, 2020, 03:16:47 pm »
36
Using Code::Blocks / Re: SDL2 with CodeBlocks 20.03
« Last post by omnishambles on July 03, 2020, 03:08:19 pm »
Re reply#4, I definitely would want to use the wizard instead of setting things up manually as you describe. That's exactly what I want to avoid if at all possible. However, if the wizard doesn't support C there may be no choice. It sounds like it's going to be a long and winding road so I'll have to leave it until the weekend. Thanks for offering to help.
37
Using Code::Blocks / Re: SDL2 with CodeBlocks 20.03
« Last post by omnishambles on July 03, 2020, 02:54:05 pm »
Thanks for your help. In answer to your reply #3, I did a rebuild and the build log is as follows. (I just noticed your edit to reply #3 but am posting this anyway - I'll respond to reply #4 later).

-------------- Clean: Debug in codeblocks_sdltest2 (compiler: GNU GCC Compiler)---------------

Cleaned "codeblocks_sdltest2 - Debug"

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

gcc.exe -Wall -g  -c C:\data\source_code\c\codeblocks_sdltest2\main.c -o obj\Debug\main.o
gcc.exe  -o bin\Debug\codeblocks_sdltest2.exe obj\Debug\main.o   
C:\data\source_code\c\codeblocks_sdltest2\main.c:2:10: fatal error: SDL.h: No such file or directory
 #include <SDL.h>
          ^~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
38
Using Code::Blocks / Re: SDL2 with CodeBlocks 20.03
« Last post by stahta01 on July 03, 2020, 02:12:04 pm »
If you do not wish to use the Wizard than you need to add all the search paths both linker and include.
And, you need to add the defines and libraries.

I think that rename the main.cpp to main.c is easier.
Save as main.cpp to new name of  main.c
Add main.c to project.
Remove main.cpp from project.

If you wish to not use the Wizard for an SDL2 project; I would instead use it for an blank CB project and add everything by hand. I am will to help you add the needed things to a blank/empty CB project.

Tim S.
39
Using Code::Blocks / Re: SDL2 with CodeBlocks 20.03
« Last post by stahta01 on July 03, 2020, 02:07:41 pm »
Post a full rebuild log so I can see the include folders that are being used.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Edit: The above is useful; but, too early till you try to add the includes needed.

Tim S.
40
Using Code::Blocks / Re: SDL2 with CodeBlocks 20.03
« Last post by omnishambles on July 03, 2020, 02:02:50 pm »
I'm writing this with other readers in mind (including future me) so my answers are a bit verbose. '...' denotes irrelevant directories.

1. 64-bit. From the CB site I installed codeblocks-20.03mingw-setup.exe. C:\...\codeblocks\MinGW\bin\gcc.exe -v says Target: x86_64-w64-mingw32

2. In Settings / Global Variables I created the variable 'SDL2' and set its base value to C:\...\x86_64-w64-mingw32. (CB changed the variable to lowercase sdl2)

3. Did File / New / Project / SDL2 project / project name = codeblocks_sdltest1. It asked where SDL2 is installed and offered $(#sdl2) which I accepted as-is. Accepted the compiler/build defaults. It created a C++ project with a main.cpp, but I need C. The wizard didn't give a C/C++ choice.

Looking at main.cpp, the relevant parts for a skeleton C equivalent seem to be:
#include <SDL.h>
int main( int argc, char * argv[] )

So I created a new project (console application, C) with main.c:
#include <stdio.h>
#include <SDL.h>
int main(int argc,char *argv[]) {
    printf("Hello world!\n");
    return 0;
}

Which failed to build with:
C:\...\codeblocks_sdltest2\main.c|2|fatal error: SDL.h: No such file or directory|

The following all failed in the same way:
#include <SDL2/SDL.h>
#include <SDL2\SDL.h>
#include <include/SDL2/SDL.h>
#include <include\SDL2\SDL.h>

SDL.h exists, at C:\...\x86_64-w64-mingw32\include\SDL2\SDL.h
The global variable sdl2 is still set to C:\...\x86_64-w64-mingw32

If I do any more I'll just be guessing and hacking which is what I wanted to avoid, so I'm stuck at this point. Any ideas?
Pages: 1 2 3 [4] 5 6 7 8 9 10