Hello,
Some time ago I used wxDevCpp in a project I used to work and created also a small introductory course of C++ OO with wxWidgets in it. Now I'm a Linux only professional and as some colleagues asked me to redo the course, so the obvious choice was Code::Blocks.
But as I tried to convert my course projects to Code::Blocks, I'm getting some linking problems. I think it should be some C::B tweak I couldn't find. Can someone please point me in the right direction ? The problem goes like this:
I'm trying to teach OO together with wxWidgets, so the course starts with basic things and elaborate to the point where I create a small calculator. In the first day I have 2 classes in a folder called day1:
-Oper which has 2 variables (oper1 and oper 2) and the respectives gets and sets. These are the operands that will be used for the calculations.
-Operations which extends from Oper and has the 4 basic operations in the following folder stucture:
-day1 (has the Operations.h and Operations.cpp files)
|---op (sub-folder that has the Oper.h and Oper.cpp files)
Operations.h includes Oper.h like this:
#include "op/Oper.h"
in this project, all works fine. It builds, links and runs correctly. The problem is when I try to elaborate this in the next project. This time the objective is to show the multiply tables for a certain number. So I have a class called MultiplyTable with 2 methods: Show(int n) and ShowAll() which use the classes I created above.
This class is in the root project folder. So now I got the following folder struncture:
-day1 (has the Operations.h and Operations.cpp files)
|---op (sub-folder that has the Oper.h and Oper.cpp files)
-day2 (has the MultiplyTable.h and MultiplyTable.cpp files)
So I have an #include "Operations.h" in the MultiplyTable.h file. In order for it to be found I included the day1 folder in the project's search directories and (after this didn't work) also tried to change the include to #include "../day1/Operations.h"
My problem is that this project compiles ok, but it won't link complaining that it has undefined references both to Oper.h anb Operations.h's methods.
I'm working in Ubuntu 8.04, using C::B version svn 6031 and GCC 4.2.4
Thnx,
Nelson Teixeira,
Fortaleza, Brasil
Any help is welcome,
Nelson Teixeira,
Fortaleza, Brasil