C++ program compiliation failed

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



Hi,
I have three c++ files: main.cpp, and querystring.{h,cpp}

querystring.h contains the definition for the QueryString class
and querystring.cpp contains the implementation.

querystring.cpp and main.cpp both have the statement #include "querystring.h"

Now when I run the compiler, I get a weird error-

$ g++ main.cpp querystring.cpp -o out
/tmp/ccxJ7C28.o: In function `main':
main.cpp:(.text+0x3e): undefined reference to `QueryString::QueryString()'
collect2: ld returned 1 exit status

How am I supposed to compile the program? i.e. in general a multifile
program having .hs and .cpps

-- 
Regards,
Nilesh Govindarajan
Facebook: http://www.facebook.com/nilesh.gr
Twitter: http://twitter.com/nileshgr
Website: http://www.itech7.com
VPS Hosting: http://www.itech7.com/a/vps


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux