<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#3333FF" bgcolor="#FFFFFF">
<font face="DejaVu Sans Mono">Dear List<br>
<br>
I have a small program which contains the code shown on page 1058
of<br>
Stroustrup's TC++PL (4th ed.) just above the 37.2.1 section. I
omitted<br>
the line which initialises (and declares) pat1.<br>
<br>
If I compile the file main.cpp to regex using this command:<br>
clang++ -g -std=c++11 -stdlib=libc++ -o regex main.cpp<br>
I get no warnings, no errors, in fact no console output from
clang++.<br>
When the program is run, it produces "\w+\d*" on the console.<br>
<br>
Now, if I compile with this command:<br>
clang++ -g -std=c++11 -o main.o -c main.cpp<br>
and then link with this command:<br>
clang++ -g -stdlib=libc++ -o regex main.o<br>
again, I get no output from clang++. Unfortunately, when the
output<br>
program is run, it fails with "Segmentation violation".<br>
<br>
Does this mean that when I start writing programs which are made
up<br>
of many source files, I shall be unable to compile the individual
files?<br>
<br>
I am trying to use Code::Blocks as the IDE for clang++. The
commands it<br>
issues are peculiar and, especially, the linker is, I reckon, just
plain<br>
wrong. The point is that the Code::Blocks binary also fails with a<br>
Segmentation violation.<br>
<br>
So what's going wrong? Can clang++ act, not only as a compiler,
but also a<br>
linker? And is it possible to use a debugger from the LLVM stable
rather than<br>
GNU gdb?<br>
<br>
Looking forward to progessing on these points.<br>
<br>
</font>
<pre class="moz-signature" cols="72">--
Sian Mountbatten <<a class="moz-txt-link-abbreviated" href="http://www.poenikatu.co.uk">www.poenikatu.co.uk</a>>
Learning C++!!!
I'm an FSF member (no. 10888)
Help us support software freedom! <a class="moz-txt-link-freetext" href="http://www.fsf.org/jf?referrer=10888">http://www.fsf.org/jf?referrer=10888</a>
</pre>
</body>
</html>