Project

General

Profile

Actions

Support #2531

closed

undefined reference to Session

Added by Bud T over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
01/01/2014
Due date:
% Done:

0%

Estimated time:

Description

Trying to compile an application based upon database tutorials, but getting these errors below. The same code compiles fine on Windows 7 machine using 3.3.0 and boost 1.47. Fails on Fedora 17 using 3.3.0 and boost 1.55.

...
Linking CXX executable app.wt
CMakeFiles/app.wt.dir/home/user/app/main/source/App.cpp.o: In function `App::~App()':
App.cpp:(.text._ZN2AppD2Ev[_ZN2AppD5Ev]+0x20): undefined reference to `Session::~Session()'
CMakeFiles/app.wt.dir/home/user/app/main/source/App.cpp.o: In function `main':
App.cpp:(.text.startup+0xee): undefined reference to `Session::configureAuth()'
CMakeFiles/app.wt.dir/home/user/app/main/source/App.cpp.o: In function `App::App(Wt::WEnvironment const&)':
App.cpp:(.text._ZN2AppC2ERKN2Wt12WEnvironmentE[_ZN2AppC5ERKN2Wt12WEnvironmentE]+0x71): undefined reference to `Session::Session(std::string const&)'
App.cpp:(.text._ZN2AppC2ERKN2Wt12WEnvironmentE[_ZN2AppC5ERKN2Wt12WEnvironmentE]+0x2f9): undefined reference to `Session::auth()'
App.cpp:(.text._ZN2AppC2ERKN2Wt12WEnvironmentE[_ZN2AppC5ERKN2Wt12WEnvironmentE]+0x306): undefined reference to `Session::users()'
App.cpp:(.text._ZN2AppC2ERKN2Wt12WEnvironmentE[_ZN2AppC5ERKN2Wt12WEnvironmentE]+0x348): undefined reference to `Session::passwordAuth()'
App.cpp:(.text._ZN2AppC2ERKN2Wt12WEnvironmentE[_ZN2AppC5ERKN2Wt12WEnvironmentE]+0x368): undefined reference to `Session::oAuth()'
App.cpp:(.text._ZN2AppC2ERKN2Wt12WEnvironmentE[_ZN2AppC5ERKN2Wt12WEnvironmentE]+0xa0f): undefined reference to `Session::~Session()'
collect2: error: ld returned 1 exit status
make[2]: *** [app.wt] Error 1
make[1]: *** [CMakeFiles/app.wt.dir/all] Error 2
make: *** [all] Error 2

As far as I can tell all libraries are linked:

SET(WT_PROJECT_TARGET app.wt)

SET(BOOST_LIBS boost_filesystem boost_system boost_signals boost_regex boost_thread boost_random boost_date_time boost_program_options)

SET(WT_CONNECTOR "wtfcgi" CACHE STRING "Connector used (wtfcgi)")

TARGET_LINK_LIBRARIES(${WT_PROJECT_TARGET} ${WT_CONNECTOR} ${BOOST_LIBS} wt wtfcgi wthttp wtdbo wtdbosqlite3 wtdbopostgres)
Actions #1

Updated by Bud T over 10 years ago

RESOLVED

The problem was that I forgot to add Session.h and Session.cpp references to the WT_PROJECT_SOURCE variable passed to ADD_EXECUTABLE in CMakeLists.txt.

Actions #2

Updated by Koen Deforche over 10 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF