Code::Blocks (http://www.codeblocks.org/) is an alternative C++ IDE for Ubuntu platform. It is a free C++ IDE and you do not need to configure Wine to get Visual C++ runs on your Linux OS. Although the user interface probably will be slightly different from Visual C++ but the features and main functionalities are almost the same.
However, CodeBlocks seems having problem in getting the header file if the .cpp file includes the header file for compilation as well. For example, in the PatientAccount.cpp file:
You will get the following error when compiling the PatientAccount.cpp file:
/home/yee/CodeBlocks/Assignment1/src/PatientAccount.cpp|1|fatal error: PatientAccount.h: No such file or directory
You need to provide the absolute path to tell the compiler where to find the header file:
You have to configure the project build and add the directory where the header file is located. The steps are as below:-
- Project > Build options > Search Directories tab
- Choose the Policy dropdown list with the option: Prepend target options to project options”
- Click the button ‘Add’ to search and add the directory (e.g. ‘include’ directory)
- Another popup with the question “Keep this as a relative path?” and click ‘Yes’ to add the directory.
Note: The location of the settings probably varies depending on the Code::Blocks version. The workaround and solution is applicable for version 10.05.