Code::Blocks Forums
User forums => Help => Topic started by: Sidhartha on February 14, 2012, 09:45:56 pm
-
Hi All,
I'm now to codeblocks... traditionally I've used EMACS and the terminal debugger... but it's time to move on!!!
Question... I have small C++ "project" (not a true project in CodeBlocks terms). About 4 .cpp files with associated headers, a main.cpp a makefile and a dictionary file that the c++ project reads (literally a dictionary text file).
My question... how do I get this into Codeblocks so that it complies & runs correctly. I realise I can start an empty project and import the files.
Do I also have to import the makefile & dictionary file? I'm not entirely clear how I run a project from an existing makefile.
A few pointers in the right direction would be appreciated!
Many Thanks
-
It is possible to use (almost) any build system "unconverted" (see Code::Blocks and Makefiles (http://wiki.codeblocks.org/index.php?title=Code::Blocks_and_Makefiles)), however, it is generally better to fully transfer the build, allowing Code::Blocks to manage it (especially when the project is small, and therefor relatively easy to convert).
(Working under the assumption your project does not use any external libraries.) Use the wizard to create an empty console project. Click Project->Add files... and select all of your *.cpp and *.h files. I would also suggest adding the dictionary text file simply for ease of access. Leave the makefile out (or even delete if you plan to never go back :)), unless you have decided not to fully convert.
See also:
- Creating a new project (http://wiki.codeblocks.org/index.php?title=Creating_a_new_project)
- I would like to compile a project using some non-standard libraries. (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F)