Project

General

Profile

Actions

Bug #4829

closed

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

Added by Benjamin Summerton over 8 years ago. Updated over 8 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.

Actions #1

Updated by Koen Deforche over 8 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

Actions #2

Updated by Koen Deforche over 8 years ago

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

Also available in: Atom PDF