[pdal] unit test linkage

Michael P. Gerlek mpg at flaxen.com
Fri Mar 2 14:40:46 EST 2012


While it is clear I have no idea what I am doing, I think I've got it working.

Two other probs I've found:

I sometimes(?) get an warning saying main() is multiply defined when linking pdalboost.lib, due to unit_test_main.cpp and cpp_main.cpp, but it seems not to matter, since we're not using main() from that library anyway. Might be able to fix with judicious use of the BOOST_TEST_NO_MAIN macro.

There is also a serious problem that the boost lib is compiled "in parallel" with the pdal sources themselves -- when in fact src depends on boost lib -- so there is a time-dependent linkage error. We have now:

	./CMakeLists.txt:
		add_subdirectory(boost)
		add_subdirectory(src

but, conceptually at least, we want it more like

	./CMakeLists.txt:
		add_subdirectory(src
	./src/CMakeLists.txt:
		add_subdirectory(boost)

-mpg


> -----Original Message-----
> From: pdal-bounces at lists.osgeo.org [mailto:pdal-bounces at lists.osgeo.org] On Behalf Of Kirk McKelvey
> Sent: Friday, March 02, 2012 11:29 AM
> To: pdal at lists.osgeo.org
> Subject: RE: [pdal] unit test linkage
> 
> All I can say is you are on the right track.  I've encountered similar errors before and thought I resolved them by defining
> BOOST_TEST_DYN_LINK (or was it by UNdefining it?).  Note that whenever you change your mind you have to set this flag not just in
> the pdal_test compile, but also rebuild pdalboost so it is generating the right symbols.  But if that is not fixing it then it must be
> something deeper.
> 
> -----Original Message-----
> From: pdal-bounces at lists.osgeo.org [mailto:pdal-bounces at lists.osgeo.org] On Behalf Of Michael P. Gerlek
> Sent: vendredi 2 mars 2012 13:01
> To: pdal at lists.osgeo.org
> Subject: [pdal] unit test linkage
> 
> I think I see the problem-
> 
> pdaltest.exe contains main(), via an include from the boost unit test world.  main() references a boost function, unit_test_main(),
> which is contained in pdalboost.lib, which is no longer visible from / accessible by pdaltest.exe, due to the funky linkage constraints we
> now have.
> 
> Specifically, pdal.dll exports some pdal things, but not the underlying boost test functions.
> 
> Not yet sure how to fix this.  I can pull some code from boost test out into pdaltest.exe's source tree, but that just pushes the
> problem one level deeper.
> 
> I tried making an fakemain() inside pdal.dll, which calls the boost test code, and which is properly exported out to pdaltest.exe's
> world, but it still didn't link for some reason.
> 
> Will keep banging head against keyboard until it works.
> 
> -mpg
> 
> 
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pdal
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pdal



More information about the pdal mailing list