cppunit and multiple main() methods

tanner at real-time.com tanner at real-time.com
Thu Feb 20 17:08:44 GMT 2003


I'm trying to use cppunit with kdevelop-2.1.3 and I've run into a problem where
kdevelop doesn't like to have multiple main() methods.

There is 1 main() in the application and another main() in the test runner. The
problem is kdevelop wants to link everything together which is a problem.


My next problem is how can I get the test runner application to link to the
object files of the main application given my current directory setup?


.
|-- AUTHORS
|-- COPYING
|-- ChangeLog
|-- INSTALL
|-- LCU_SI.db
|-- LCU_SI.pro
|-- Makefile
|-- Makefile.am
|-- Makefile.dist
|-- Makefile.in
|-- README
|-- TODO
|-- acinclude.m4
|-- aclocal.m4
|-- admin
    <snip>
|-- application
    <all the .cpp and .h files>
|   |-- Tests
    <all the TEST .cpp and .h files>

In the Tests/Makefile.am I added:

bin_PROGRAMS = testRunner
testRunner_SOURCES = <all the tests .cpp files>
testRunner_LDADD = lcppunit -ldl

I get undefined references from the Test*.cpp files looking for the application
files, I don't know what to add to the Tests/Makefile.am to tell it to get the
object files for the application.

-- 
Bob Tanner <tanner at real-time.com>         | Phone : (952)943-8700
http://www.mn-linux.org, Minnesota, Linux | Fax   : (952)943-8500
Key fingerprint = AB15 0BDF BCDE 4369 5B42  1973 7CF1 A709 2CC1 B288

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list