Wednesday, November 14, 2007

Linker error and sipXtapi

If you get the following error:

Invoking: GCC C++ Linker
g++ -L../../src/.libs/ -L../../src/libs/ -lQtGui -lQtCore -o"my_sipXezPhone" ./fred.o ./main.o ./moc_myqtapp.o ./myqtapp.o

./myqtapp.o: In function `myQtApp::show()':
/root/sipXtapi/sipXcallLib/workspace/my_sipXezPhone/Debug/../myqtapp.cpp:115: undefined reference to `sipxInitialize'
collect2: ld returned 1 exit status

It because the linker cannot find the object file. Do the following

Add the following path to the linker library search path: directory where sipxtapi is installed/sipXcallib/src/.libs/

Add the following entry to the linker libraries: sipXcall

In Eclipse, it would look like this:

A couple of webpages that helped me get to the solution:

http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/gcc/Link-Options.html

Relevant text:

-l library
Search the library named library when linking. (The second alternative with the library as a separate argument is only for POSIX compliance and is not recommended.)

It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified. Thus, foo.o -lz bar.o searches library z after file foo.o but before bar.o. If bar.o refers to functions in z, those functions may not be loaded.

The linker searches a standard list of directories for the library, which is actually a file named liblibrary.a. The linker then uses this file as if it had been specified precisely by name.

The directories searched include several standard system directories plus any that you specify with -L.

Normally the files found this way are library files—archive files whose members are object files. The linker handles an archive file by scanning through it for members which define symbols that have so far been referenced but not defined. But if the file that is found is an ordinary object file, it is linked in the usual fashion. The only difference between using an -l option and specifying a file name is that -l surrounds library with lib and .a and searches several directories.

http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html

4 comments:

ninest123 said...

replica watches, kate spade outlet, louis vuitton outlet, prada outlet, ray ban sunglasses, oakley sunglasses, ralph lauren pas cher, replica watches, jordan shoes, oakley sunglasses, polo ralph lauren outlet, louboutin pas cher, longchamp pas cher, louboutin outlet, longchamp, tiffany jewelry, nike air max, uggs on sale, ugg boots, nike free, louboutin shoes, ray ban sunglasses, ugg boots, nike outlet, air jordan pas cher, louboutin, oakley sunglasses, cheap oakley sunglasses, christian louboutin outlet, louis vuitton, prada handbags, tory burch outlet, louis vuitton outlet, tiffany and co, burberry, nike roshe run, nike free, polo ralph lauren outlet, air max, longchamp outlet, sac longchamp, oakley sunglasses, michael kors, louis vuitton, chanel handbags, ray ban sunglasses, nike air max, louis vuitton, gucci outlet, longchamp outlet

ninest123 said...

michael kors, nike roshe, true religion outlet, timberland, nike blazer, north face, ugg boots, ugg boots, michael kors, mulberry, michael kors outlet, oakley pas cher, michael kors, burberry outlet online, hollister pas cher, nike free run uk, hermes, hogan, lululemon, hollister, coach outlet, sac guess, michael kors outlet, lacoste pas cher, tn pas cher, converse pas cher, michael kors outlet, michael kors outlet, true religion jeans, nike air max, vans pas cher, abercrombie and fitch, coach outlet, burberry, replica handbags, michael kors outlet, coach purses, nike air max, new balance pas cher, ralph lauren uk, vanessa bruno, true religion jeans, ray ban uk, north face, ray ban pas cher, true religion jeans, air force, nike air max, kate spade handbags, michael kors

ninest123 said...

bottega veneta, louboutin, insanity workout, wedding dresses, beats by dre, soccer shoes, timberland boots, nfl jerseys, hollister, hollister, gucci, baseball bats, herve leger, nike trainers, ray ban, instyler, asics running shoes, mac cosmetics, abercrombie and fitch, celine handbags, converse, p90x workout, mcm handbags, new balance, vans shoes, iphone cases, north face outlet, longchamp, reebok shoes, nike huarache, birkin bag, vans, mont blanc, nike air max, jimmy choo shoes, lululemon, nike roshe, north face outlet, oakley, chi flat iron, valentino shoes, ghd, babyliss, ralph lauren, nike air max, converse outlet, ferragamo shoes, soccer jerseys, hollister, giuseppe zanotti

ninest123 said...

wedding dresses, juicy couture outlet, swarovski, doudoune canada goose, moncler, canada goose uk, swarovski crystal, pandora jewelry, ugg,ugg australia,ugg italia, coach outlet, moncler, canada goose, canada goose outlet, supra shoes, karen millen, pandora charms, replica watches, louis vuitton, pandora jewelry, montre pas cher, canada goose outlet, bottes ugg, barbour, thomas sabo, juicy couture outlet, moncler, lancel, louis vuitton, canada goose, louis vuitton, moncler, moncler outlet, hollister, canada goose, ugg boots uk, toms shoes, barbour jackets, sac louis vuitton pas cher, canada goose, louis vuitton, pandora charms, links of london, moncler, ugg,uggs,uggs canada, moncler, marc jacobs, ugg pas cher, moncler

  • Book reviews