Project

General

Profile

/usr/bin/ld: cannot find -lwtfcgi

Added by Gage Herrmann over 13 years ago

I am getting this) linker error when trying to compile:

Linking CXX executable wtHello.wt
/usr/bin/ld: cannot find -lwtfcgi                                               
collect2: ld returned 1 exit status
make[2]: *** [source/wtHello.wt] Error 1
make[1]: *** [source/CMakeFiles/wtHello.wt.dir/all] Error 2
make: *** [all] Error 2

And here is the CMakeLists.txt in my build folder:

SET(WT_PROJECT_SOURCE
wtHello.cpp
)

SET(WT_PROJECT_TARGET wtHello.wt)

ADD_EXECUTABLE(${WT_PROJECT_TARGET} ${WT_PROJECT_SOURCE})

TARGET_LINK_LIBRARIES(${WT_PROJECT_TARGET} ${WT_CONNECTOR} wt)

INCLUDE_DIRECTORIES(/usr/local/include/Wt)

I cant see what I'm doing wrong. Does anything stand out as incorrect to anyone?

Also, does anyone know of a good beginner's CMake tutorial?


Replies (1)

RE: /usr/bin/ld: cannot find -lwtfcgi - Added by Wim Dumon over 13 years ago

You probably installed wt in /usr/local; add the following statement:

LINK_DIRECTORIES(/usr/local/lib)

Your INCLUDE_DIRECTORIES statement should probably point to /usr/local/include. We generally recommend to include the Wt directory in the #include statement:

#include <Wt/WApplication>

If you run make with VERBOSE=1, you will see all commands that cmake generated, which is easier to identify the source of the problem:

make VERBOSE=1
    (1-1/1)