PDA

View Full Version : undefined reference to libtorrent



nhs_0702
3rd April 2010, 05:45
when i build my source code use libtorrent error message:



release/main.o:main.cpp: (.text+0x7d7 ) : undefined reference to `libtorrent:: create_torrent::create_torrent(libtorrent::file_st orage&, int)'
release/main.o:main.cpp: (.text+0x80a ) : undefined reference to `libtorrent:: create_torrent::add_tracker(std::string const&, int)'
release/main.o:main.cpp : (.text+0x8c9) : undefined reference to `libtorrent:: create_torrent::set_creator(char const*)'
release/main.o:main.cpp : (.text+0xa89) : undefined reference to `libtorrent: :create_torrent::generate() const'
release/main.o:main.cpp : (.text+0xab7) : undefined reference to `libtorrent:: entry::destruct()'
release/main.o:main.cpp : (.text+0xbf7 ): undefined reference to `libtorrent: :create_torrent::add_url_seed(std::string const&)'
release/main.o:main.cpp :(.text+0xfe3) : undefined reference to `libtorrent::entry::destruct()'

vishwajeet.dusane
3rd April 2010, 11:43
Hi

Have u added libtorrent library path and name in your .pro file ?

use

LIBS += -llibtorrent -L<PATH OF YOUR LIBRARY>

nhs_0702
3rd April 2010, 16:28
but i dont known Build LibTorrent to .lib on Mingw,if you known build libtorrent to .lib on mingw,can you help me ?,thank

my .pro


#-------------------------------------------------
#
# Project created by QtCreator 2010-04-02T03:14:15
#
#-------------------------------------------------

QT -= gui

TARGET = MakeTorrent
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += C:/Users/BotNetVN/Desktop/boost_1_42_0 C:/Users/BotNetVN/Desktop/SVN/3rdPartyLibs/libtorrent/include C:/Users/BotNetVN/Desktop/boost_1_42_0 C:/Users/BotNetVN/Desktop/SVN/3rdPartyLibs/libtorrent/zlib
LIBS+= "F:/libboost_filesystem-mgw44-mt-1_42.lib"
LIBS+= "F:/boost_filesystem-mgw44-1_42.lib"
LIBS+= "F:/boost_filesystem-mgw44-mt-1_42.lib"
LIBS+= "F:/libboost_system-mgw44-1_42.lib"