CMake?

993 views
Skip to first unread message

Davis Ford

unread,
Sep 9, 2012, 3:13:03 PM9/9/12
to cppu...@googlegroups.com
Hi all,

I'm reading through the book Test Driven Development for Embedded C http://pragprog.com/book/jgade/test-driven-development-for-embedded-c

I've been messing around with a few sample projects experimenting with CppUTest and Unity.  I'm about to start a new dev. project and the dev. environment will be likely be heterogeneous -- some Mac, Win, Linux.

Instead of screwing with a lot of headache trying to get Makefiles to work on all these different environments, I'm thinking about using CMake http://www.cmake.org/ -- I want to try to set up a simple demo project that builds with CMake and uses CppUTest for a test framework.

Has anyone here used CMake at all -- even better have you used it with CppUTest?  

If I get a simple skeleton project working, I'll throw it up on github if anyone is interested.

Bas Vodde

unread,
Sep 9, 2012, 11:20:08 PM9/9/12
to cppu...@googlegroups.com

Hi David,

I'm aware of CMake, though never actively used it.

Right now, the idea is to move to GNU Autotools in the future rather than CMake. The main reason is that the portability of GNU Autotools *seems* better and it has more widely support than CMake. However, the GNU Autotools conversion hasn't been done yet :(

Do feel free to put something together and put it on github. We could perhaps also include CMakefile and, as Autotools files aren't there yet, it might be an improvement already!

Tnx

Bas

Davis Ford

unread,
Sep 10, 2012, 10:34:43 AM9/10/12
to cppu...@googlegroups.com
Hi Bas,

Thanks for the feedback.  I realize that people can get zealous about build tools, and there are camps on either side of the autotools vs. cmake debate.  I haven't worked with either enough to construct a strong opinion.  I hacked out a quick CMake project yesterday and it seems fairly straightforward.  I like the library finder capability http://www.cmake.org/cmake/help/cmake_tutorial.html#s2 - I think this could be very useful for linker mocking.  I also think it has some nice features to help dual targeting.

I don't really care for the syntax so much, but it is fairly simple and easy to get used to.

I aim to build a skeleton project in the next few days that builds with CMake and supports running tests through CppUTest.  When I get something together, I'll post a link to the repo -- perhaps someone will find it useful.

Andreas Stenius

unread,
Sep 10, 2012, 11:56:13 AM9/10/12
to cppu...@googlegroups.com
Hi,

I've no experience with CMake, but have been using autotools for a
dual-target project for a while now. The autotools syntax can be
awkard at times. And the configuration is more or less spread out in a
phletora (bogus word, I know) of files.

The dual-target support is nice, though. I have a single source tree,
and an arbitrary number of build trees, each with it's own set of
options used to <configure> it. Rebuilding stuff as needed, works
really well.

//Andreas

2012/9/10 Davis Ford <davi...@gmail.com>:

RM

unread,
Sep 12, 2012, 12:56:55 AM9/12/12
to cppu...@googlegroups.com
Hello David,
 
I too have recently started working my way through Grenning's book. I have been unable to get the CppUTest to build - (pg 25, make -f MakeFileCppUTest.mk). I have attached a snip below. 
 
Unity builds okay.
 
I am working on the Eclipse(Galileo)-Cygwin platform on Vista 32bit. I can get unity to work but not CppUTest.
 
CppUTest works well on the VS 2010 Express. And that is what I am using to progress thru the book. I would like to use Eclipse. I would greatly appreciate any help I can get to do so.
 
Regards
RM
 
This is a snip of the make output:
 
CppUTest/lib/libCppUTest.a(JUnitTestOutput.o): In function `_ZN15JUnitTestOutput20writeTestGroupToFileEv':
/cygdrive/h/UnitTest-TDD-Grenning/code/CppUTest/src/CppUTest/JUnitTestOutput.cpp:213: undefined reference to `___gxx_personality_sj0'
/cygdrive/h/UnitTest-TDD-Grenning/code/CppUTest/src/CppUTest/JUnitTestOutput.cpp:213: undefined reference to `__Unwind_SjLj_Register'
/cygdrive/h/UnitTest-TDD-Grenning/code/CppUTest/src/CppUTest/JUnitTestOutput.cpp:214: undefined reference to `__Unwind_SjLj_Resume'
/cygdrive/h/UnitTest-TDD-Grenning/code/CppUTest/src/CppUTest/JUnitTestOutput.cpp:220: undefined reference to `__Unwind_SjLj_Unregister'
collect2: ld returned 1 exit status
CppUTest/build/MakefileWorker.mk:328: recipe for target `BookCode_CppUTest_tests' failed
make: *** [BookCode_CppUTest_tests] Error 1
rmn@rmn-PC /cygdrive/h/UnitTest-TDD-Grenning/code
$

Davis Ford

unread,
Sep 12, 2012, 3:34:41 PM9/12/12
to cppu...@googlegroups.com
Hi RM,

Sorry, I can't help you much with your make failure. I'm new to
CppUTest myself.

I'm not trying to push CMake or anything -- but it does claim to be
able to auto-generate not only Makefiles but also project files for
Visual Studio and Eclipse. This guy has a series of videos that
demonstrate this:
http://playcontrol.net/ewing/screencasts/getting_started_with_cmake_.html
-- disclaimer: I have no idea how well it works...never tried it.

I prefer to use Sublime Text 2 www.sublimetext.com/2 with the
SublimeClang plugin https://github.com/quarnster/SublimeClang as an
IDE. There's also a CMake plugin, and Sublime Text 2 supports
Makefile out of the box. If you've never heard of / tried Sublime
Text 2, give it a shot -- free to use with nag screen. I develop in a
ton of different languages, and it works for all of them.

I start a new project tomorrow. The target(s) will be Arduino (AVR
compiler) and Raspberry PI (Arm compiler), and I also want to support
dual target for building / running tests locally on dev machine. I've
been researching various toolchains / testing frameworks the last
couple days, and I think I'm settled on using CMake + Make + CppUTest.

RM Nair

unread,
Sep 13, 2012, 1:29:13 AM9/13/12
to cppu...@googlegroups.com
Hi David,

Thanks for the inputs. Will give Sublime a try.

Regards
RM

Bas Vodde

unread,
Sep 14, 2012, 12:24:26 AM9/14/12
to cppu...@googlegroups.com

Hi RM,

Uuuhm. Not sure what the linker error is about. It seems the -lstdc++ is missing somewhere. Its on cygwin right?

Is it the latest from the trunk?

Bas

Bas Vodde

unread,
Sep 14, 2012, 12:26:18 AM9/14/12
to cppu...@googlegroups.com

Hi Davis,

(sorry for getting your name wrong earlier!)

I've got no interest in going in a CMake vs autotools discussion either. The main reasons for chosing autotools it its portability and dual targetting support. From what I know, CMake is less strong in that area.

But, if we can have both CMake and autotools files, that would be fine too. It'll mainly be a question about support.

Bas

RM Nair

unread,
Sep 14, 2012, 2:14:44 AM9/14/12
to cppu...@googlegroups.com
(Changed the subject line)

Hello Bas

I have libstdc++ version 4.5.3-3.

The following libstdc++*.* files are there in the directory
C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.3
1. libstdc++.a
2. libstdc++.dll.a
3. libstdc++.dll.a-gdb.py
4. libstdc++.la

C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.3 is in the windows path environment
variable.

The Cygwin-bash command env, has /usr/lib/gcc/i686-pc-cygwin

Regards
RM

> -----Original Message-----
> From: cppu...@googlegroups.com [mailto:cppu...@googlegroups.com] On
Behalf Of
> Bas Vodde
> Sent: Friday, September 14, 2012 9:54 AM
> To: cppu...@googlegroups.com
> Subject: Re: CMake?
>
>

Davis Ford

unread,
Sep 14, 2012, 7:26:29 AM9/14/12
to cppu...@googlegroups.com
Hi Bas,

I wasn't looking to suggest a different build tool for the CppUTest project - my original post was more to find out if anyone had created a skeleton project with cmake that builds and runs tests with CppUTest.  That's what I'm building, and I'm just going to link against CppUTest anyway after it is already built -- and it can be built with standard Make or Autoconf or whatever.

FWIW: my investigation seemed to indicate better portability the other way around, but it isn't anything of consequence at this point.  

Bas Vodde

unread,
Sep 14, 2012, 9:50:54 PM9/14/12
to cppu...@googlegroups.com

Hola,

> I wasn't looking to suggest a different build tool for the CppUTest project - my original post was more to find out if anyone had created a skeleton project with cmake that builds and runs tests with CppUTest. That's what I'm building, and I'm just going to link against CppUTest anyway after it is already built -- and it can be built with standard Make or Autoconf or whatever.

Oki!

>
> FWIW: my investigation seemed to indicate better portability the other way around, but it isn't anything of consequence at this point.

Interesting. Well…. if you want to port to Windows, then I believe CMake is better. But AFAIK for different unix-clones, autotools support is better.

I'd love to see a reference to where they say it is different! It is important as embedded software often uses some unix-clone… so the different unix portability would be more important from CppUTest perspective.

Thanks,

Bas

Bas Vodde

unread,
Sep 16, 2012, 2:49:20 AM9/16/12
to cppu...@googlegroups.com

HI RM,

Unfortunately, I don't have any cygwin this week, I'll have some cygwin machines next week and will check.

What I meant is that the linker option -lstdc++ might be missing. Don't think so as it would lead to more linker errors, but was the only thing I could think of just by looking at your mail. Will try to look at it next week.

Thanks!

Bas

Terry Yin

unread,
Sep 16, 2012, 9:22:53 AM9/16/12
to cppu...@googlegroups.com
Hi,

The old mail became a little messy and I cannot find out what really is the problem.

I have the latest cygwin & cpputest, they worked just fine. If you describe you problem again I may help since I have everything ready here.

br, Terry
--
-terry
-------------------------
Blog: http://terryyin.blogbus.com/
twitter: http://twitter.com/terryyin

RM Nair

unread,
Sep 16, 2012, 11:41:10 PM9/16/12
to cppu...@googlegroups.com
Hi Bas,

What I sent was just the last few lines. There is yards of the stuff. But
each one of them has the same pattern. Each one protest about
___gxx_personality_sj0', __Unwind_SjLj_Register', and
__Unwind_SjLj_Unregister'. Just these three in every case.

I have a little while ago downloaded CppUTest-v3.3 unzipped it in to
rmn@rmn-PC /cygdrive/h/TDD-Frameworks-CppUTest

and run
$ make -f Makefile

The results are the same.

RM Nair

unread,
Sep 16, 2012, 11:51:10 PM9/16/12
to cppu...@googlegroups.com

Hello Terry,

 

I have a little while ago posted a response to Bas.

 

Here’s a screen capture of the last of the messages. As I mentioned, there is “yards” of the stuffL

 

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:184: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:185: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:186: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:186: undefined reference to `__Unwind_SjLj_Unregister'

lib/libCppUTest.a(TestOutput.o): In function `_ZN10TestOutput26printFileAndLineForFailureERK11TestFailure':

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:190: undefined reference to `___gxx_personality_sj0'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:190: undefined reference to `__Unwind_SjLj_Register'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:191: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:192: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:192: undefined reference to `__Unwind_SjLj_Unregister'

lib/libCppUTest.a(TestOutput.o): In function `_ZN10TestOutput52printErrorInFileOnLineFormattedForWorkingEnvironmentE12SimpleStringi':

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:210: undefined reference to `___gxx_personality_sj0'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:210: undefined reference to `__Unwind_SjLj_Register'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:212: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:214: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestOutput.cpp:214: undefined reference to `__Unwind_SjLj_Unregister'

lib/libCppUTest.a(UtestPlatform.o): In function `_Z41PlatformSpecificRunTestInASeperateProcessP10UtestShellP10TestPluginP10TestResult':

/cygdrive/h/TDD-Frameworks-CppUTest/src/Platforms/Gcc/UtestPlatform.cpp:77: undefined reference to `___gxx_personality_sj0'

/cygdrive/h/TDD-Frameworks-CppUTest/src/Platforms/Gcc/UtestPlatform.cpp:77: undefined reference to `__Unwind_SjLj_Register'

/cygdrive/h/TDD-Frameworks-CppUTest/src/Platforms/Gcc/UtestPlatform.cpp:89: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/Platforms/Gcc/UtestPlatform.cpp:91: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/Platforms/Gcc/UtestPlatform.cpp:95: undefined reference to `__Unwind_SjLj_Unregister'

lib/libCppUTest.a(TestHarness_c.o): In function `CHECK_EQUAL_C_INT_LOCATION':

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestHarness_c.cpp:45: undefined reference to `___gxx_personality_sj0'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestHarness_c.cpp:45: undefined reference to `__Unwind_SjLj_Register'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestHarness_c.cpp:46: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestHarness_c.cpp:46: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestHarness_c.cpp:46: undefined reference to `__Unwind_SjLj_Unregister'

lib/libCppUTest.a(TestHarness_c.o): In function `CHECK_EQUAL_C_CHAR_LOCATION':

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestHarness_c.cpp:55: undefined reference to `___gxx_personality_sj0'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestHarness_c.cpp:55: undefined reference to `__Unwind_SjLj_Register'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestHarness_c.cpp:56: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestHarness_c.cpp:56: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/TestHarness_c.cpp:56: undefined reference to `__Unwind_SjLj_Unregister'

lib/libCppUTest.a(CommandLineTestRunner.o): In function `_ZN21CommandLineTestRunner11RunAllTestsEiPPKc':

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:52: undefined reference to `___gxx_personality_sj0'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:52: undefined reference to `__Unwind_SjLj_Register'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:68: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:68: undefined reference to `__Unwind_SjLj_Unregister'

lib/libCppUTest.a(CommandLineTestRunner.o): In function `_ZN21CommandLineTestRunner15runAllTestsMainEv':

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:72: undefined reference to `___gxx_personality_sj0'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:72: undefined reference to `__Unwind_SjLj_Register'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:75: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:82: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:82: undefined reference to `__Unwind_SjLj_Unregister'

lib/libCppUTest.a(CommandLineTestRunner.o): In function `_ZN21CommandLineTestRunner17initializeTestRunEv':

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:86: undefined reference to `___gxx_personality_sj0'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:86: undefined reference to `__Unwind_SjLj_Register'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:87: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:88: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:90: undefined reference to `__Unwind_SjLj_Unregister'

lib/libCppUTest.a(CommandLineTestRunner.o): In function `_ZN21CommandLineTestRunner11runAllTestsEv':

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:94: undefined reference to `___gxx_personality_sj0'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:94: undefined reference to `__Unwind_SjLj_Register'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:104: undefined reference to `__Unwind_SjLj_Resume'

/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:107: undefined reference to `__Unwind_SjLj_Unregister'

collect2: ld returned 1 exit status

build/MakefileWorker.mk:437: recipe for target `CppUTest_tests' failed

make: *** [CppUTest_tests] Error 1

 

 

Regards

RM

 

From: cppu...@googlegroups.com [mailto:cppu...@googlegroups.com] On Behalf Of Terry Yin
Sent: Sunday, September 16, 2012 6:53 PM
To: cppu...@googlegroups.com
Subject: Re: Linker Problems

 

Hi,

 

The old mail became a little messy and I cannot find out what really is the problem.

 

I have the latest cygwin & cpputest, they worked just fine. If you describe you problem again I may help since I have everything ready here.

 

br, Terry

On Sun, Sep 16, 2012 at 2:49 PM, Bas Vodde <ba...@odd-e.com> wrote:


HI RM,

Unfortunately, I don't have any cygwin this week, I'll have some cygwin machines next week and will check.

What I meant is that the linker option -lstdc++ might be missing. Don't think so as it would lead to more linker errors, but was the only thing I could think of just by looking at your mail. Will try to look at it next week.

Thanks!

Bas

[RM] Removed earlier conversation

Bas Vodde

unread,
Nov 12, 2012, 1:23:08 AM11/12/12
to cppu...@googlegroups.com

Hi RM,

Did these still got resolved?

We're tried to compile the latest version on cygwin and it worked fine, so it is hard to debug the problem via email :(

Thanks,

Bas

Terry Yin

unread,
Nov 12, 2012, 4:58:27 AM11/12/12
to cppu...@googlegroups.com
I'm horribly sorry for asking a question then later missing the reply. Hope everything is fine now.

RM Nair

unread,
Nov 15, 2012, 7:00:58 AM11/15/12
to cppu...@googlegroups.com

Hello Terry,

 

Sorry to say the situation is very much what it was. The test harness works quite well in Visual Studio. So, I am developing my code in Visual Studio with CppUTest and then “porting” the code, as and when required, to Eclipse. Bit of a bind but still …

RM Nair

unread,
Nov 15, 2012, 7:00:58 AM11/15/12
to cppu...@googlegroups.com
Hello Bas,

What windows platform are you running it on? I will get the same one and see
if things improve.

Regards
RM


-----Original Message-----
From: cppu...@googlegroups.com [mailto:cppu...@googlegroups.com] On Behalf
Of Bas Vodde
Sent: 12 November 2012 11:53
To: cppu...@googlegroups.com
Subject: Re: Linker Problems


/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:7
2: undefined reference to `__Unwind_SjLj_Register'
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:7
5: undefined reference to `__Unwind_SjLj_Resume'
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
2: undefined reference to `__Unwind_SjLj_Resume'
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
2: undefined reference to `__Unwind_SjLj_Unregister'
> lib/libCppUTest.a(CommandLineTestRunner.o): In function
`_ZN21CommandLineTestRunner17initializeTestRunEv':
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
6: undefined reference to `___gxx_personality_sj0'
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
6: undefined reference to `__Unwind_SjLj_Register'
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
7: undefined reference to `__Unwind_SjLj_Resume'
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
8: undefined reference to `__Unwind_SjLj_Resume'
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:9
0: undefined reference to `__Unwind_SjLj_Unregister'
> lib/libCppUTest.a(CommandLineTestRunner.o): In function
`_ZN21CommandLineTestRunner11runAllTestsEv':
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:9
4: undefined reference to `___gxx_personality_sj0'
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:9
4: undefined reference to `__Unwind_SjLj_Register'
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:1
04: undefined reference to `__Unwind_SjLj_Resume'
>
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:1

Bas Vodde

unread,
Nov 18, 2012, 1:03:52 AM11/18/12
to cppu...@googlegroups.com

Hi,

We're run it on Windows 7 with a fresh installed cygwin…

Bas

Bas Vodde

unread,
Dec 27, 2012, 4:41:54 AM12/27/12
to cppu...@googlegroups.com

Hiya RM,

I've changed the build system to using autoconf and compiled on cygwin. This now should work fine.

If you pull the latest code and compile using:

configure
make

Then it ought to work on cygwin too. (Make sure you use configure first as we still also have the old Makefile.)

Let me know if this helps!

Thanks,

Bas

RM Nair

unread,
Dec 31, 2012, 1:10:53 AM12/31/12
to cppu...@googlegroups.com
Hello Bas

I downloaded cpputest-cpputest-v3.3-76-ga5118d9.zip

Unzipped to C:\UnitTestFramework-cpputest-v3.3-76-ga5118d9

Ran ./configure
RM@RM-Lenovo /cygdrive/c/UnitTestFramework-cpputest-v3.3-76-ga5118d9
$ ./configure

The summary report
----------------------------------------------------------------

CppUTest Version 3.3

Features configured in CppUTest:
Memory Leak Detection: yes
Compiling extensions: yes
Disable CppUTest compile/link flags: yes

Using Standard C++ Library: yes
Using Standard C Library: yes

Generating map file: no
Compiling w coverage info: no

Use 'real' GTest: no
Able to use GMock: no


----------------------------------------------------------------

Then I ran the command make as follows

RM@RM-Lenovo /cygdrive/c/UnitTestFramework-cpputest-v3.3-76-ga5118d9
$ make
make all-am
make[1]: Entering directory
`/cygdrive/c/UnitTestFramework-cpputest-v3.3-76-ga5118d9'
CXX libCppUTest_a-CommandLineArguments.o
cc1plus: error: unrecognized command line option "-Wsign-conversion"
cc1plus: error: unrecognized command line option
"-Wno-disabled-macro-expansion"
cc1plus: error: unrecognized command line option "-Wno-global-constructors"
cc1plus: error: unrecognized command line option
"-Wno-exit-time-destructors"
cc1plus: error: unrecognized command line option "-Wno-weak-vtables"
Makefile:888: recipe for target `libCppUTest_a-CommandLineArguments.o'
failed
make[1]: *** [libCppUTest_a-CommandLineArguments.o] Error 1
make[1]: Leaving directory
`/cygdrive/c/UnitTestFramework-cpputest-v3.3-76-ga5118d9'
Makefile:596: recipe for target `all' failed
make: *** [all] Error 2

I guess I am still out of luck:-(

Regards
RM


-----Original Message-----
From: cppu...@googlegroups.com [mailto:cppu...@googlegroups.com] On Behalf
Of Bas Vodde
Sent: 27 December 2012 15:12
To: cppu...@googlegroups.com
Subject: Re: Linker Problems


Hiya RM,

I've changed the build system to using autoconf and compiled on cygwin. This
now should work fine.

If you pull the latest code and compile using:

configure
make

Then it ought to work on cygwin too. (Make sure you use configure first as
we still also have the old Makefile.)

Let me know if this helps!

Thanks,

Bas


On 15 Nov, 2012, at 8:00 PM, RM Nair <aare...@gmail.com> wrote:

> Hello Terry,
>
> Sorry to say the situation is very much what it was. The test harness
works quite well in Visual Studio. So, I am developing my code in Visual
Studio with CppUTest and then "porting" the code, as and when required, to
Eclipse. Bit of a bind but still .
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:7
2: undefined reference to `__Unwind_SjLj_Register'
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:7
5: undefined reference to `__Unwind_SjLj_Resume'
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
2: undefined reference to `__Unwind_SjLj_Resume'
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
2: undefined reference to `__Unwind_SjLj_Unregister'
> > lib/libCppUTest.a(CommandLineTestRunner.o): In function
`_ZN21CommandLineTestRunner17initializeTestRunEv':
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
6: undefined reference to `___gxx_personality_sj0'
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
6: undefined reference to `__Unwind_SjLj_Register'
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
7: undefined reference to `__Unwind_SjLj_Resume'
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:8
8: undefined reference to `__Unwind_SjLj_Resume'
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:9
0: undefined reference to `__Unwind_SjLj_Unregister'
> > lib/libCppUTest.a(CommandLineTestRunner.o): In function
`_ZN21CommandLineTestRunner11runAllTestsEv':
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:9
4: undefined reference to `___gxx_personality_sj0'
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:9
4: undefined reference to `__Unwind_SjLj_Register'
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:1
04: undefined reference to `__Unwind_SjLj_Resume'
> >
/cygdrive/h/TDD-Frameworks-CppUTest/src/CppUTest/CommandLineTestRunner.cpp:1

Bas Vodde

unread,
Dec 31, 2012, 1:14:36 AM12/31/12
to cppu...@googlegroups.com

Hi RM,

That is very strange as the configure script checks for those.

Could you send me the whole configure output?

Bas

RM Nair

unread,
Jan 1, 2013, 7:13:59 AM1/1/13
to cppu...@googlegroups.com
Hello Bas

A very Happy New Year to You.

I have attached the complete o/p of the configure script. Hope it helps.
LinkerProblems_ConfigureMssgs.txt

Bas Vodde

unread,
Jan 2, 2013, 3:40:45 AM1/2/13
to cppu...@googlegroups.com

Hi,

Thanks, the config file was interesting, especially:

checking whether CC and CXX supports -Wno-global-constructors... yes
checking whether CC and CXX supports -Wno-exit-time-destructors... yes
checking whether CC and CXX supports -Wno-weak-vtables… yes

Which checked your compiler support on these and concluded that your compiler supported these flags.

Anyways, the compiler support check does use the C compiler and these are obvious C++ checks. So, I did made some changes to the configure script that *might* catch the problem this time.

I put them on the main line. Could you grab the latest one again and configure; make again?

Thanks!

Bas
> <LinkerProblems_ConfigureMssgs.txt>

RM Nair

unread,
Jan 6, 2013, 3:28:16 AM1/6/13
to cppu...@googlegroups.com
Hello Bas,

I checked the downloads available at
https://github.com/cpputest/cpputest/downloads. As they are 5 months old, I
do not think you are referring to any one of them.

Please guide me as to how I should grab the latest version from the main
line.

Regards
RM


> -----Original Message-----
> From: cppu...@googlegroups.com [mailto:cppu...@googlegroups.com] On
Behalf Of
> Bas Vodde
> Sent: Wednesday, January 02, 2013 2:11 PM
> To: cppu...@googlegroups.com
> Subject: Re: Linker Problems
>
>
> Hi,
>
> Thanks, the config file was interesting, especially:
>
> checking whether CC and CXX supports -Wno-global-constructors... yes
> checking whether CC and CXX supports -Wno-exit-time-destructors... yes
> checking whether CC and CXX supports -Wno-weak-vtables. yes

Bas Vodde

unread,
Jan 6, 2013, 5:13:58 AM1/6/13
to cppu...@googlegroups.com

Hi RM,

Now, indeed.

You can download the latest source as zip from here:
http://cpputest.github.com/cpputest/

I figured thats what you did earlier also. Now I made a bit of changed to the configure file though.

Let me know if it works.

Bas

RM Nair

unread,
Jan 6, 2013, 11:35:55 PM1/6/13
to cppu...@googlegroups.com
Hello Bas,

Still no joy :-(

The configure and make messages are attached.
Configure&MakeMssgs.txt

Bas Vodde

unread,
Jan 7, 2013, 12:44:45 AM1/7/13
to cppu...@googlegroups.com

Oh, some joy at least :)

The problem has changed, so it suggests that what I did actually sort-of helped :)

I'm sort-of amused by this, as it seems to be that the CC compiler on your machine isn't giving an error when its passing an unknown -Wno flag.

If you check the configure output, it says:

checking whether CC and CXX supports -Weverything… no

Which means, it checked CC on -Weverything and discovered CC doesn't support it.

But then:

checking whether CC and CXX supports -Wno-disabled-macro-expansion… yes

which checks CC on whether -Wno-disabled-macro-expansion exists, and it says YES!

But then:

cc1plus: error: unrecognized command line option "-Wno-disabled-macro-expansion"

The CCX compiler is unhappy about it.

I'll do an additional fix on this and get back to you very soon.

Thanks,

Bas
> <Configure&MakeMssgs.txt>

RM Nair

unread,
Jan 7, 2013, 1:07:19 AM1/7/13
to cppu...@googlegroups.com
Hello Bas,

1. I noticed one message says, "fatal: Not a git repository: './.git'"

Could that be a problem?

2. Maybe, I could use the same GCC as in your Cygwin configuration.

The GCC with my cygwin:


rmn@rmn-PC ~
$ which gcc
/usr/bin/gcc

rmn@rmn-PC ~
$ gcc --version
gcc (GCC) 4.5.3

Regards
RM

> -----Original Message-----
> From: cppu...@googlegroups.com [mailto:cppu...@googlegroups.com] On
Behalf Of
> Bas Vodde
> Sent: Monday, January 07, 2013 11:15 AM
> To: cppu...@googlegroups.com
> Subject: Re: Linker Problems
>
>
> Oh, some joy at least :)
>
> The problem has changed, so it suggests that what I did actually sort-of
helped :)
>
> I'm sort-of amused by this, as it seems to be that the CC compiler on your
machine isn't
> giving an error when its passing an unknown -Wno flag.
>
> If you check the configure output, it says:
>
> checking whether CC and CXX supports -Weverything. no
>
> Which means, it checked CC on -Weverything and discovered CC doesn't
support it.
>
> But then:
>
> checking whether CC and CXX supports -Wno-disabled-macro-expansion. yes

Bas Vodde

unread,
Jan 7, 2013, 1:22:21 AM1/7/13
to cppu...@googlegroups.com
Hi,

1. I noticed it too. No idea yet what that is :)

2. Yeah, perhaps. It should work with CC though.

But, could you give that a try:

configure CC=gcc
make

Shouldn't make a difference, but … well.. lets see :)

Bas

Bas Vodde

unread,
Jan 7, 2013, 2:00:24 AM1/7/13
to cppu...@googlegroups.com

Hiya,

I've updated again.

Related to #1. I think I found the problem and it shouldn't give this error anymore.

That doesn't solve the -Wno problem though. I've added more diagnostics in the configure script. Could you run it one more time and send the output again. Also please do try the earlier recommendation of doing configure CC=gcc

If this doesn't work, then I'll send you a debug configure script as this problem is really weird and doesn't happen on my own cygwin.

Thanks!

Bas

RM Nair

unread,
Jan 7, 2013, 3:50:03 AM1/7/13
to cppu...@googlegroups.com
Still no joy.
Configure&MakeMssgs-CC=gcc.txt
Configure&MakeMssgs-1.txt

Bas Vodde

unread,
Jan 7, 2013, 4:29:52 AM1/7/13
to cppu...@googlegroups.com

Hiya,

Well… a bit more information again.

I've edited the configure script to give us a bit more information (the compiler output when it tried to check the flags).

Would you mind copying this configure script, running it ones and sending me the output? I'm still quite puzzled why some compiler flags are marked as ok while they are actually not ok.

Thanks!

Bas


configure

RM Nair

unread,
Jan 8, 2013, 2:32:30 AM1/8/13
to cppu...@googlegroups.com
Hello Bas,

I changed the file name to configure and ran
./configure
make

The output is attached.

Regards
RM

> -----Original Message-----
> From: cppu...@googlegroups.com [mailto:cppu...@googlegroups.com] On
Behalf Of
> Bas Vodde
> Sent: Monday, January 07, 2013 3:00 PM
> To: cppu...@googlegroups.com
> Subject: Re: Linker Problems
>
>
> Hiya,
>
> Well. a bit more information again.
Configure&MakeMssgs-2.txt

Bas Vodde

unread,
Jan 20, 2013, 10:37:05 PM1/20/13
to cppu...@googlegroups.com

Hi RM,

Ok…strange. THe compiler doesn't seem to give an error.

Could you compile a "hello world" program written in C (not C++) and then pass these parameters:

"gcc -Werror -Wsign-conversion hello.c"

And tell me whether it gives a compiler error?

If it doesn't, then it means that gcc seems to shallow these compiler options whereas g++ probably fails on them…

Thanks!

Bas
> <Configure&MakeMssgs-2.txt>

RM Nair

unread,
Jan 21, 2013, 1:39:41 AM1/21/13
to cppu...@googlegroups.com
Hello Bas,

Here's the result

**************************************************************************8
rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ ls
Debug main.c Release

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ which gcc
/usr/bin/gcc

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ gcc -version
gcc: unrecognized option '-version'
gcc: no input files

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ gcc --version
gcc (GCC) 4.5.3
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ gcc -Werror -Wsign-conversion main.c

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ ls
a.exe Debug main.c Release

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ a
bash: a: command not found

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ a.exe
bash: a.exe: command not found

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ ./a
Hello World
rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$
*************************************************************************
Regards
RM

PS: As you can see I get confused switching from Win to Linux:-(


> -----Original Message-----
> From: cppu...@googlegroups.com [mailto:cppu...@googlegroups.com] On
Behalf Of
> Bas Vodde
> Sent: Monday, January 21, 2013 9:07 AM
> To: cppu...@googlegroups.com
> Subject: Re: Linker Problems
>
>
> Hi RM,
>
> Ok.strange. THe compiler doesn't seem to give an error.
>
> Could you compile a "hello world" program written in C (not C++) and then
pass these
> parameters:
>
> "gcc -Werror -Wsign-conversion hello.c"
>
> And tell me whether it gives a compiler error?
>
> If it doesn't, then it means that gcc seems to shallow these compiler
options whereas
> g++ probably fails on them.

Bas Vodde

unread,
Jan 21, 2013, 1:42:16 AM1/21/13
to cppu...@googlegroups.com

Hiya,

And if you rename the source for file to .cpp then it will give an error, correct?

Interesting behavior of this gcc version :) Seems I'll need to fix the configure script to check for C and C++ separately. Then it ought to work. Hope to do that this week.

Thanks for holding on so long :)

Bas

RM Nair

unread,
Jan 21, 2013, 6:35:20 AM1/21/13
to cppu...@googlegroups.com
Yes Bas, it does give an error please see below:

The first one is with a CPP Hello World

The next is with the main.c renamed to main.cpp


rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorldinCpp
$ cat main.cpp
#include <iostream>
#include <string>

using namespace std;

int main (int argc, char **argv)
{
string myName;

cout << "Enter name: ";
cin >> myName;
cout << "Hello " + myName << endl;

return 0;
}

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorldinCpp
$ gcc -Werror -Wsign-conversion main.cpp
gcc: error trying to exec 'cc1plus': execvp: No such file or directory

****************************************************************************
**
rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorldinCpp
$ cd ../HelloWorld

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ ls
a.exe Debug main.c Release

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ mv main.c main.cpp

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ ls
a.exe Debug main.cpp Release

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ gcc -Werror -Wsign-conversion main.cpp
gcc: error trying to exec 'cc1plus': execvp: No such file or directory

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$


Regards,

Bas Vodde

unread,
Jan 21, 2013, 6:47:09 AM1/21/13
to cppu...@googlegroups.com

Hiya,

Uhm, but that is not the error it is suppose to give :P

Could you try to use "g++" instead of "gcc" ?

Bas

RM Nair

unread,
Jan 23, 2013, 12:03:24 AM1/23/13
to cppu...@googlegroups.com
Hello Bas,

**************************************************

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ g++ --version
g++ (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ g++ -Werror main.cpp

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ ls
a.exe Debug main.cpp Release

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ ./a.exe
Hello World
rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ g++ -Werror -Wsign-conversion main.cpp
cc1plus: error: unrecognized command line option "-Wsign-conversion"

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$
**************************************************

Gcc with just -Werror
**************************************************

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$ gcc -Werror main.cpp
gcc: error trying to exec 'cc1plus': execvp: No such file or directory

rmn@rmn-PC /cygdrive/f/EclipseWorkspaceC_Cpp/HelloWorld
$
*****************************************************

Bas Vodde

unread,
Jan 23, 2013, 12:10:28 AM1/23/13
to cppu...@googlegroups.com

Thanks!

I know what to try next. It'll be some changes to the configure script and need to refactor out the duplication to make it easy.

Will try to do this soon-ish and will let you know!

Bas

RM Nair

unread,
Jan 23, 2013, 1:04:36 AM1/23/13
to cppu...@googlegroups.com
Thanks Bas. Really appreciate your dogged pursuit of a defect that, I think,
has been experienced by just me.
Reply all
Reply to author
Forward
0 new messages