help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Library Issue


From: Brian C
Subject: Library Issue
Date: Sat, 21 Apr 2007 23:41:21 -0400
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

Hello all,
I've run into an issue, and I'm not sure where the problem lies. I wrote some code at work during the week to pull down sport scores from a web page, and it compiles (IBM's compiler xlC) and works fine. I brought the code home to finish up on it, and it fails to compile w/ g++ (unchanged). Basically, the program is a single .cpp file with no namespace. It calls a class "mascot::BoardFetcher" to retrieve and parse the sports scores from a web-page. Inside of "mascot::BoardFetcher", it calls "dex::HttpSession" to pull down the web page.

When I compile the libraries dex & mascot, they compile fine. When I compile the program getscores, it fails on the link part with:

/dynamis/lib/libmascot.a(BoardFetcher.o): In function `mascot::BoardFetcher::Fetch(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': BoardFetcher.cpp:(.text+0x279): undefined reference to `dex::HttpSession::HttpSession(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool)' BoardFetcher.cpp:(.text+0x36e): undefined reference to `dex::HttpSession::~HttpSession()' BoardFetcher.cpp:(.text+0x387): undefined reference to `dex::HttpSession::~HttpSession()'
collect2: ld returned 1 exit status


Now, the twist is, if I copy the code from mascot::BoardFetcher where it creates an instance of dex::HttpSession and put it into the main program's code, it compiles fine.

        Any ideas?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]