Author Topic: Using Code Block for First time?  (Read 11220 times)

Offline Newbie C++

  • Single posting newcomer
  • *
  • Posts: 7
Using Code Block for First time?
« on: October 10, 2010, 11:51:43 pm »
Hello everyone

I have install Code Block and do I have install the C++ Complier somewhere?

I going to used Code block for SDL programming...

Is there Code Block Tutorial showing me how to install C++ Complier and also SDL too?


Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: Using Code Block for First time?
« Reply #1 on: October 11, 2010, 12:55:10 am »
I think your OS is Open Solaris, isn't it ?
Kernel Extremist - PedroM power ©

Offline Newbie C++

  • Single posting newcomer
  • *
  • Posts: 7
Re: Using Code Block for First time?
« Reply #2 on: October 11, 2010, 01:24:33 am »
My OS is Window 7 Ultimate :)


Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: Using Code Block for First time?
« Reply #3 on: October 11, 2010, 09:46:36 am »
Ok, this helps. :)

You have two choices :
- Install Code::Blocks and a compiler separately (so download codeblocks-10.05-setup.exe, and a compiler of your choice)
- Install Code::Blocks and MinGW + gcc + all the stuff you need (so download codeblocks-10.05mingw-setup.exe which contains a compiler etc...)

Both are available on the download page : http://www.codeblocks.org/downloads/26
If you have installed codeblocks-10.05mingw-setup.exe, you already have GCC/G++ installed. :)

For SDL, I recommend you to look at the official site and at their FAQ.
« Last Edit: October 11, 2010, 10:00:30 am by Folco »
Kernel Extremist - PedroM power ©

Offline Newbie C++

  • Single posting newcomer
  • *
  • Posts: 7
Re: Using Code Block for First time?
« Reply #4 on: October 12, 2010, 01:03:01 am »
thank you :)

I was doing Console Applacations tutorial (there is links below it)

http://www.cprogramming.com/code_blocks/

but i just got one error saying

Id.exe - cannot find lSDLmain

what does that mean?

Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: Using Code Block for First time?
« Reply #5 on: October 12, 2010, 01:26:47 am »
Did you read the doc here ? http://www.libsdl.org/
Kernel Extremist - PedroM power ©

Offline Newbie C++

  • Single posting newcomer
  • *
  • Posts: 7
Re: Using Code Block for First time?
« Reply #6 on: October 14, 2010, 07:28:33 pm »
here what i have done



when I run the program and i get the error like this :(


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Using Code Block for First time?
« Reply #7 on: October 14, 2010, 09:09:38 pm »
when I run the program and i get the error like this :(

Well - the linker clearly tells you what's wrong: It cannot find the library you are asking to link against. So you need to provide the path with to library to the linker under "search directories". While you are at it, move the libraries to the right place under "link libraries" and not "other linker options".
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Newbie C++

  • Single posting newcomer
  • *
  • Posts: 7
Re: Using Code Block for First time?
« Reply #8 on: October 15, 2010, 05:11:53 pm »
the Console app work great :)  Thank you :)

I am working on SDL images but I get the error saying this


what I am doing wrong?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Using Code Block for First time?
« Reply #9 on: October 15, 2010, 05:38:50 pm »
This is just a guess; but is the SDL Library you installed compatible with MinGW GCC?
The errors look like it might be MSVC based library install instead of MinGW GCC library.
What Compiler are you using?

Tim S.
« Last Edit: October 15, 2010, 05:42:40 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Newbie C++

  • Single posting newcomer
  • *
  • Posts: 7
Re: Using Code Block for First time?
« Reply #10 on: October 15, 2010, 06:09:37 pm »
Hiya,

I got the wrong library which you were right as it was MSVC Based library......
So I have install the MinGW GCCC Library and

now it is working fine.....thank you so much :)

Code block IDE With SDL is like a dream....unlike those Viusal express c++ which is like system hogs to me!

Offline Newbie C++

  • Single posting newcomer
  • *
  • Posts: 7
Re: Using Code Block for First time?
« Reply #11 on: October 15, 2010, 06:11:44 pm »
how do I get rid of Console window as I have made the window with Images on it but there is console window behide it.... :?