Project

General

Profile

Bug #4829

Linking fails when compiling the "Hello, World!" application with clang++ and not g++

Added by Benjamin Summerton almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
03/26/2016
Due date:
% Done:

0%

Estimated time:

Description

I was following the tutorial here: http://www.webtoolkit.eu/wt/doc/tutorial/wt.html

When I compiled using clang, I got this:

me@computer:dir $ clang++ -o hello.wt hello.cpp -lwt -lwthttp
/tmp/hello-ea6db1.o:(.rodata._ZTV16HelloApplication[_ZTV16HelloApplication]+0x20): undefined reference to `Wt::WObject::id() const'
/tmp/hello-ea6db1.o:(.rodata._ZTV16HelloApplication[_ZTV16HelloApplication]+0x30): undefined reference to `Wt::WObject::objectName() const'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1

But when I switched clang out for g there were no issues and it compiled/linked fine.

#1

Updated by Koen Deforche almost 6 years ago

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche

Hey,

You cannot mix gcc and clang mostly because of the standard library, see http://libcxx.llvm.org/

If you want to use CLang, you need to build Wt and boost using clang too.

Koen

#2

Updated by Koen Deforche over 5 years ago

  • Status changed from Resolved to Closed
  • Target version set to 3.3.6

Also available in: Atom PDF