Undefined reference

General questions regarding the usage of CodeLite
CodeLite Curious
Posts: 1
Joined: Wed Apr 11, 2018 12:24 pm
Genuine User: Yes
IDE Question: C++

Undefined reference

Postby Blink123123 » Wed Apr 11, 2018 4:59 pm


I am using CodeLite to test my attempts at some C++ coding, however I have an issue with imports.

I have created a new workspace with a new wxWidgets frame as GUI.
Then I added another static library project (The default one not the wxWidgets enabled project nor the MSVC one).
Then I create a simple class inside my static library.

The problem occurs when I reference it in wxWidgets:
If I use #include "Proj/Class.h"
I get "undefined reference to Class::Class()" and "undefined reference to Class::~Class()"
However if I use #include "Proj/Class.cpp" everything compiles good.

Now I checked and found that this is an issue with the linker or something but everything looks good and the cpp file should be included but its not.
I'm using a fresh VM install with Ubuntu Xenial on it with ONLY CodeLite installed so I don't think any 3rd party issue is present.
User avatar
CodeLite Plugin
Posts: 5778
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++

Re: Undefined reference

Postby eranif » Wed Apr 11, 2018 9:34 pm

This is a C++ issue and not CodeLite issue.

Some hints:
Yous should not include .cpp files...
Make sure that the class 'Class.cpp' is part of your project and is compiled.
Make sure you have read the HOW TO POST thread

Who is online

Users browsing this forum: No registered users and 14 guests