Author Message

<  dev-c++  ~  how to install and open devcpp projects in codeblocks

PostPosted: Fri Mar 28, 2008 10:47 pm
User avatarSite AdminJoined: Mon Feb 05, 2007 9:31 pmPosts: 1806Location: brooklyn
here at eyebeam, we've been experimenting with using codeblocks as an alternative to devcpp. big props to friedrich for getting us going. it's based on the same compiler (mingw) but as an IDE has some obvious benifits:

a) active community
b) significantly less buggy
c) just had a new release

we will release 0.05 w/ codeblocks as opposed to devcpp, since devcpp has serious limitations

here's a step by step tutorial to get up and running, and inport your devcpp projects in codeblocks.

click the images to see big ones


a) download code::blocks binary (latest release)

http://www.codeblocks.org/downloads/5

note: download WITH mingw.

Image

b) install

Image

c) setup

you don't have to change anything

Image

d) associate c++ files?

I chose not too, since code::blocks is not my primary IDE

Image

e) add files to mingw

similar to devcpp, we will have to add a few libraries to devcpp. you can download the files : here.
in the zip there are two folders, you need to put the contents of them into the contents of folders in mingw.

-- add the contents of the folder "add_to_codeblocks_mingw_include" into "C:\Program Files\CodeBlocks\MinGW\include"
(or wherever your app\mingw\include is)

-- add the contents of the folder "add_to_codeblocks_mingw_lib" into "C:\Program Files\CodeBlocks\MinGW\lib"
(or wherever your app\mingw\lib is)

Image

f) import your devcpp project

file -> import

Image

g) choose compiler (mingw / gnu gcc)

just choose the top one:

Image

h) the default sorting looks terrible

this is an example of the default sorting, which separates cpp and h files:

Image

i) we suggest to change it to this

if you unclick "categorize by file types" things look like normal.

Image

j) need to do one more thing to compile

if we compile now, we get link errors. right click target and say "go to build options"

Image

k) get to the linker settings

navigate to the linker settings. make sure you are not highlighting "default" in the top left. highlight the name of the target.

Image

l) change the lower links to "-l"

before
Image

after
Image

m) now we can compile!!

Image




hope that's helpful for anyone looking for a devcpp alternative ---
please let me know if that works, or you have issues, etc.


take care!!
zach


Last edited by zach on Sun Jun 01, 2008 6:17 pm, edited 1 time in total.

Offline Profile
PostPosted: Sat Mar 29, 2008 5:07 am
User avatarJoined: Fri Mar 02, 2007 3:21 pmPosts: 40
thank you for the tips, i just tried it,everything seems working fine,but when i hit the "run" button within the codeblock,it gave me the error message in the console.

however if i'm going to dictionary where the "fontsExample" is,the Executable file just working good as normal.

am i missing something,or took the wrong step?
btw, the example i'm using is from the 0.04.
Image
Image
Image[/img]


Offline Profile
PostPosted: Sat Mar 29, 2008 11:12 am
User avatarSite AdminJoined: Mon Feb 05, 2007 9:31 pmPosts: 1806Location: brooklyn
oh snaps, I missed one step :oops: thanks for the feedback

(step k-2...)

under project (menu) -> options -> build targets -> execution working direcctory

change it to say "bin" (I think it will say ".")

this changes the "current working directory" that the compiler is running from.... thus, looking for data folder will work.

(the same problem occurs in eclipse and VS too)



hope that helps -- I'll make an image for it in a sec.

take care - zach


Offline Profile
PostPosted: Sat Mar 29, 2008 12:20 pm
Joined: Mon Oct 29, 2007 1:11 amPosts: 81Location: Utrecht, The Netherlands
I get the error "cannot find -lstrmbase"
Also "cannot find -lz"

I did copy the required files to the lib folder in the mingw folder.


Last edited by companje on Sat Mar 29, 2008 12:31 pm, edited 1 time in total.

Offline Profile
PostPosted: Sat Mar 29, 2008 12:22 pm
User avatarSite AdminJoined: Mon Feb 05, 2007 9:31 pmPosts: 1806Location: brooklyn
in your libs folder do you have:
"C:\Program Files\CodeBlocks\MinGW\lib\libSTRMBASE.a"
?

when you copy, be sure to read the directions (copy the contents of one folder into the contents of the other folder)

it it with every example, or just video grabbing ones -- I'll check too
(I don't know if I've checked all examples) -- just checked, works for me


I'd make sure you have put the libs in the right place and that you have done the adding "-l" step described above.

take care
zach


Offline Profile
PostPosted: Sat Mar 29, 2008 12:35 pm
Joined: Mon Oct 29, 2007 1:11 amPosts: 81Location: Utrecht, The Netherlands
Hi Zach,

libSTRMBASE.a is directly in my "C:\Program Files\CodeBlocks\MinGW\lib" folder, not in a subfolder.

I'm testing with the 'emptyExample' of of0.05_devcpp


Offline Profile
PostPosted: Sat Mar 29, 2008 12:46 pm
User avatarSite AdminJoined: Mon Feb 05, 2007 9:31 pmPosts: 1806Location: brooklyn
have no idea -- for me it's worked fine on several machines

can you :

a) upload a zip of your project (including the .cbp file)
b) make sure that you got the libs in your lib folder, ie do you have these file:

C:\Program Files\CodeBlocks\MinGW\lib\libz.a
C:\Program Files\CodeBlocks\MinGW\lib\libSTRMBASE.a

c) make sure that you did the "-l" step for the libs above and that it looks like the "after" image

thanks!
zach


Offline Profile
PostPosted: Sat Mar 29, 2008 12:49 pm
Joined: Mon Oct 29, 2007 1:11 amPosts: 81Location: Utrecht, The Netherlands
Hi Zach,

I think I found something. There was another MinGW folder somewhere on my system. And somehow CodeBlocks was using that one instead of the one within the CodeBlocks folder.

I deleted the one located at C:\MinGW and that solved the problem. I don't know why CodeBlocks used that version. It wasn't in the environment PATH. But deleting it helped.

Rick


Last edited by companje on Sat Mar 29, 2008 12:56 pm, edited 1 time in total.

Offline Profile
PostPosted: Sat Mar 29, 2008 12:51 pm
User avatarSite AdminJoined: Mon Feb 05, 2007 9:31 pmPosts: 1806Location: brooklyn
ah -- interesting !! that's explains alot.

If you can, do you think you can you let us know how you noticed that (a screenshot or something) so that others don't get tripped up.. if you can't no worries, but if there is a panel that identifies that, would be useful to know.

thanks!
zach


Offline Profile
PostPosted: Sun Mar 30, 2008 5:57 am
User avatarJoined: Fri Mar 02, 2007 3:21 pmPosts: 40
i'm glad, :D ,working now! thxs for the help!


Offline Profile
PostPosted: Wed Jun 04, 2008 12:43 am
Joined: Thu Mar 01, 2007 11:57 pmPosts: 71Location: London
I was getting a compile error because a bug in MinGW. I found the solution here:

http://forums.codeblocks.org/index.php? ... ;topicseen

Basically you need to download and override:

gcc-core
gcc-g++

After that, it compiles correctly.


Cheers, chr


Offline Profile
PostPosted: Tue Mar 31, 2009 7:45 pm
Joined: Mon Mar 30, 2009 9:27 pmPosts: 10Location: Mexico
well, finally i already istalled Code Blocks due to the problem that i had with Devc++ , i followed all the steps to install it and to import a project, copying the folder contents inside of the right place, etc... im having this issue now, have a look...

i start since when i import the project:

as you can see i can not see the project files using Dev C++ files

Image



But if i use all files i got this:

Image


Then when i import the polygonExample file i got this


Image

I dont see the GNU GCC Compiler "detected".. even other one...




after that Codeblocks ask me this:
Image

I just click ok and the porject appears like that:

Image


Then i click right the name of the project to see the build options , i get this:
Image


if i click on debugwin32 or releasewin32 i see the link libraries, but i never see on the side other linker options:
Image



_________________
Chers!!
Offline Profile
PostPosted: Tue Mar 31, 2009 7:52 pm
User avatarSite AdminJoined: Mon Feb 05, 2007 9:31 pmPosts: 1806Location: brooklyn
this is a link for the codeblock download on the download page -- I don't think you want to import a visual studio project, since the compiler for CB, mingw/gcc, can't use visual studio libraries (which is what you are getting when you import VS files).

just download the windows codeblocks package and you should be good to go :)

take care!
zach


Offline Profile
PostPosted: Tue Mar 31, 2009 7:52 pm
Joined: Mon Mar 30, 2009 9:27 pmPosts: 10Location: Mexico
i forgot to tell you that at the end , i click on build to compile the project, it runs, and runs, and finally i get this result:
Image


If some one know the reason , i miss something in one step at the moment to install the program or copying the files, or putting the files project in the right place, i really dont know, thanks if you see my "sos" message, im not an expert in open frameworks, but i already uninstal Dev c++ due to the problem that it has in the last version, now im trying codeblocks and i really want to start with open frameworks, thanks for your time guys, see you........



_________________
Chers!!
Offline Profile
PostPosted: Tue Mar 31, 2009 8:02 pm
User avatarSite AdminJoined: Mon Feb 05, 2007 9:31 pmPosts: 1806Location: brooklyn
codeblock won't compile and imported visual studio project -- that's why you see link errors -- just download the codeblocks package on the download page:

http://www.openframeworks.cc/versions/p ... n32_cb.zip

have fun !
zach


Offline Profile

Display posts from previous:  Sort by:

All times are UTC
Page 1 of 2
18 posts
Go to page 1, 2  Next
Users browsing this forum: No registered users and 0 guests
Search for:
Post new topic  Reply to topic
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron