Linking errors

Forum for development in the C++ programming language.

Linking errors

Postby SimonH » 12 Aug 2014, 13:19

Hi,
i recently started basic developing with the Eye Tribe camera but i got some newbish errors i guess.

I tried some basic gaze tracking with the SDK but i got plenty linking errors like this:

1>TET.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: __thiscall gtl::GazeApi::~GazeApi(void)" (??1GazeApi@gtl@@QAE@XZ)" in Funktion "__unwindfunclet$??0MyGaze@@QAE@XZ$0".
1>TET.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: void __thiscall gtl::GazeApi::add_listener(class gtl::IGazeListener &)" (?add_listener@GazeApi@gtl@@QAEXAAVIGazeListener@2@@Z)" in Funktion ""public: __thiscall MyGaze::MyGaze(void)" (??0MyGaze@@QAE@XZ)".
1>TET.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: bool __thiscall gtl::GazeApi::connect(bool)" (?connect@GazeApi@gtl@@QAE_N_N@Z)" in Funktion ""public: __thiscall MyGaze::MyGaze(void)" (??0MyGaze@@QAE@XZ)".
1>TET.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: __thiscall gtl::GazeApi::GazeApi(bool)" (??0GazeApi@gtl@@QAE@_N@Z)" in Funktion ""public: __thiscall MyGaze::MyGaze(void)" (??0MyGaze@@QAE@XZ)".
1>TET.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: void __thiscall gtl::GazeApi::disconnect(void)" (?disconnect@GazeApi@gtl@@QAEXXZ)" in Funktion ""public: virtual __thiscall MyGaze::~MyGaze(void)" (??1MyGaze@@UAE@XZ)".
1>TET.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: void __thiscall gtl::GazeApi::remove_listener(class gtl::IGazeListener &)" (?remove_listener@GazeApi@gtl@@QAEXAAVIGazeListener@2@@Z)" in Funktion ""public: virtual __thiscall MyGaze::~MyGaze(void)" (??1MyGaze@@UAE@XZ)".

I dont know what i forgot to link / compile / or else i did wrong.

Would be great if someone knows a solution!

Thanks in advance!
SimonH
 
Posts: 4
Joined: 07 Aug 2014, 15:30

Re: Linking errors

Postby SimonH » 12 Aug 2014, 15:13

ok i made everything new from start and now it works.... don´t know what was wrong...

sooo its partly solved... i guess :-P
SimonH
 
Posts: 4
Joined: 07 Aug 2014, 15:30

Re: Linking errors

Postby Micky » 05 Jan 2015, 20:49

Basically, there are two ways of integrating the EyeTribe GazeApi into C++ projects:
  1. Either build the C++ GazeApi first, then include the public header files, and link with the prebuilt GazeApi library
  2. Include all GazeApi source files into your own project
@SimonH: What you experienced in the first attempt, with the unresolved externals, was simply that you were missing all the GazeApi objects.
User avatar
Micky
 
Posts: 12
Joined: 05 Jan 2015, 16:23

Re: Linking errors

Postby john.jrhunglin » 03 Jul 2015, 16:15

Dear Micky:

Regarding method 2 (Include all GazeApi source files into your own project), does it mean that
1. gazeapi.cpp
2. gazeapi_observable.hpp
3. gazeapi_parser.cpp
4. gazeapi_parser.hpp
5. gazeapi_socket.cpp
6. gazeapi_socket.hpp

should be included in the project?

Thanks in advance.
John



Micky wrote:Basically, there are two ways of integrating the EyeTribe GazeApi into C++ projects:
  1. Either build the C++ GazeApi first, then include the public header files, and link with the prebuilt GazeApi library
  2. Include all GazeApi source files into your own project
@SimonH: What you experienced in the first attempt, with the unresolved externals, was simply that you were missing all the GazeApi objects.
john.jrhunglin
 
Posts: 2
Joined: 05 Oct 2014, 06:45

Re: Linking errors

Postby mariac.alvarezl » 31 Mar 2016, 09:46

Dears,

I'm developing an interface controlled with The eye tribe, i use Visual Studio 2013 C ++


I realized the following
1. Install Boost libraries(1_56_0)
2. Use CMake GUI to generate project files
3. Build the C++ SDK with Visual Studio 2013

*When i buil the C++ SDK with CMake I see BOOST_DIR Not found, but I get to create the project in Visual Studio 2013

And I add a new item in the solution "GazeApiLib" the name is "Source.cpp" when I compile get the message
"Unable to start program"

Image

I tested with other versions of Boost (1_60_0 / 1_55_0) and I keep getting errors.

Please help me. Thank you
mariac.alvarezl
 
Posts: 2
Joined: 03 Mar 2016, 22:07

Re: Linking errors

Postby Martin » 05 Apr 2016, 18:06

Hi Maria,

I've forwarded your message to the developer responsible for the C++ SDK, he will get back to you shortly.
Martin
 
Posts: 567
Joined: 29 Oct 2013, 15:20

Re: Linking errors

Postby Micky » 06 Apr 2016, 09:53

Make sure to follow the C++ 3rdparty build guidelines located at https://github.com/EyeTribe/tet-cpp-client#build

It is worth noting that during step 1) (Install Boost Libraries) you need to download the boost source code and run bootstrap before proceeding to step 2). Running bootstrap will build the boost libraries, which is required before cmake can locate boost.
User avatar
Micky
 
Posts: 12
Joined: 05 Jan 2015, 16:23

Re: Linking errors

Postby mariac.alvarezl » 08 Apr 2016, 02:40

Micky wrote:Make sure to follow the C++ 3rdparty build guidelines located at https://github.com/EyeTribe/tet-cpp-client#build

It is worth noting that during step 1) (Install Boost Libraries) you need to download the boost source code and run bootstrap before proceeding to step 2). Running bootstrap will build the boost libraries, which is required before cmake can locate boost.



Thanks for the reply
I realized again and again with different libraries Boost

1. Download the boost libraries and installed the "Developer Command Prompt for VS2013" ls two ways
(First bootstrap -> then \ b2.) Or
(First bootstrap-> then bjam toolset = 12.0 msvc-variant = debug, release threading = multi link = static)
the "stage" folder was created
2. Download the .zip https://github.com/EyeTribe/tet-cpp-client
* I built the project with CMake, indicating the address where the Boost libraries were created.
3. I opened the file built in VS2013 and have 3 solutions:

ALL_BUILD
 - External Dependencies
 - CMakeKist.txt
GazeApiLib
 -external Dependencies (within several files)
-header Files
  gazeapi.h
  gazeapi_interfaces.h
  gazeapi_observable.hpp
  gazeapi_parser.hpp
  gazeapi_socket.hpp
  gazeapi_types.h
-source Files
  gazeapi.cpp
  gazeapi_parser.cpp
  gazeapi_socket.cpp

 and within GazeApiLib (Source Files) create a code file name "Source" with:

**********************************************************************************
#include <gazeapi.h>
#include <gazeapi_types.h>
#include <gazeapi_interfaces.h>

// --- MyGaze definition
MyGaze class: public GTL :: IGazeListener
{
public:
MyGaze ();
~ MyGaze ();
private:
// IGazeListener
void on_gaze_data (GTL :: GazeData gaze_data const &);
private:
GTL :: GazeApi m_api;
};

// --- MyGaze Implementation
MyGaze :: MyGaze ()
{
// Connect to the server in push mode on the default TCP port (6555)
if (m_api.connect (true))
{
// Enable notifications GazeData
m_api.add_listener (* this);
}
}

MyGaze :: ~ MyGaze ()
{
m_api.remove_listener (* this);
m_api.disconnect ();
}

void MyGaze :: on_gaze_data (GTL :: GazeData const & gaze_data)
{
if (gaze_data.state & gtl GazeData :: :: GD_STATE_TRACKING_GAZE)
{
GTL :: const Point2D & smoothedCoordinates = gaze_data.avg;

// Move GUI point, do hit-testing, log coordinates, etc.
}
}
********************************************************************************************
The Eye Tribe connect the USB 3.0 port, then build the project without errors. But when running I get the message

"Unable to start program"
'C: \ Users \ MaríaCecilia \ Desktop \ tet-cpp-client-master \ build \ Release \ ALL_BUILD'
The system can not find the file specified.

I do not know how to fix this error. Please help and apologize for any inconvenience caused.
Thank you.
mariac.alvarezl
 
Posts: 2
Joined: 03 Mar 2016, 22:07

Re: Linking errors

Postby Micky » 08 Apr 2016, 09:05

Cmake creates several build targets besides the user defined ones. The 'all', 'install', and 'zero' are such targets, and are utility targets that neither turn into executables nor libraries on their own.

As the name suggests making the GazeApiLib target yields a library, a static one. Build the install target in debug and release and link against the produced .lib in your own projects.
User avatar
Micky
 
Posts: 12
Joined: 05 Jan 2015, 16:23


Return to C++



cron