3

I'm trying to ask a question in the automake tag, but the Stack Overflow filter rejects it complaining about code that is not correctly formatted. there is not enough information to determine what input text is being complained about, and I believe that all of my 'code' has been properly formatted - initially with four spaces and then with pre/post tagging. Is there any way that I can identify where the error is?

I'm trying to learn automake (Autotools by John Calcotte) and am stumped on creating a check program to test my C++ library. A partial listing of the program is given below. The example in the text shows creation of a test program using a shell script testing the output of the test program. I have a program, linked to the library, which when executed tests the library functionality. Do I have to create the test program using noinst and then execute using a shell script? Any scripting examples or references to examples would help.

The errors are:


    src/Makefile.am:27: warning: variable 'check_SOURCES' is defined but no program or
    src/Makefile.am:27: library has 'check' as canonical name (possible typo)

Create a library

lib_LIBRARIES      = libslip.a
libslip_a_SOURCES  = $(sources) $(privateHeaders)</code></pre>

Header files for testing SLIP

testHead=TestGlobal.h TestHeader.hp TestIO.h TestMisc.h TestOperators.h TestReader.h TestReplace.h TestSequencer.h
TestUtilities.h

Source files for testing SLIP

testCPP=Test.cpp TestGlobal.cpp TestHeader.cpp TestIO.cpp TestMisc.cpp  TestOperators.cpp TestReader.cpp TestReplace.cpp
TestSequencer.cpp TestUtilities.cpp

Test Program

check_PROGRAMS = Test check_SOURCES = $(testHead) $(testCPP) TESTS = $(check_PROGRAMS)</code></pre>
6
  • Never new we had an automake forum. Or any forum at all, for that matter. Commented Mar 7, 2015 at 0:09
  • Tried all of indenting 4 spaces, surrounding the code blocks with {} and tried, but did not use, Ctl+K. When I clicked 'Post' I got an error message indicating some detected text was code and must be identified as code. My question is how do I determine which block(s) is being complained about?
    – lostbits
    Commented Mar 7, 2015 at 0:20
  • OK. What do you call the thingie that I posted too. If not a 'forum' then what?
    – lostbits
    Commented Mar 7, 2015 at 0:36
  • It's a Q&A site, mark SE. In contrast to forums, open-ended discussions are strongly discouraged. Commented Mar 7, 2015 at 0:38
  • Ok, so do I say the automake Q&A tag? Doesn't make sense. I understand your point but the question remains is how do I refer to the use of some tag?
    – lostbits
    Commented Mar 7, 2015 at 0:42
  • "With (or in) the automake-tag" is fine. Though I would go with "An automake question." Commented Mar 7, 2015 at 0:44

1 Answer 1

4

Get rid of all the <pre><code> elements (and the corresponding close elements). Indent the code lines four or more spaces (depending on indentation levels), or simply copy/paste the code from your favorite editor, select it, and use the { } toolbar button (or hit Ctrl+K) to format as code.

Here's the properly formatted post (below the horizontal line):


I'm trying to learn automake (Autotools by John Calcotte) and am stumped on creating a check program to test my C++ library. A partial listing of the program is given below. The example in the text shows creation of a test program using a shell script testing the output of the test program. I have a program, linked to the library, which when executed tests the library functionality. Do I have to create the test program using noinst and then execute using a shell script? Any scripting examples or references to examples would help.

The errors are:

src/Makefile.am:27: warning: variable 'check_SOURCES' is defined but no program or
src/Makefile.am:27: library has 'check' as canonical name (possible typo)

Here is the make file:

# Create a library
lib_LIBRARIES      = libslip.a
libslip_a_SOURCES  = $(sources) $(privateHeaders)

# Header files for testing SLIP
testHead = TestGlobal.h TestHeader.hp TestIO.h TestMisc.h TestOperators.h \
    TestReader.h TestReplace.h TestSequencer.h TestUtilities.h

# Source files for testing SLIP
testCPP = Test.cpp TestGlobal.cpp TestHeader.cpp TestIO.cpp TestMisc.cpp \
    TestOperators.cpp TestReader.cpp TestReplace.cpp TestSequencer.cpp  TestUtilities.cpp

# Test Program
check_PROGRAMS   = Test
check_SOURCES    = $(testHead) $(testCPP)
TESTS            = $(check_PROGRAMS)
2
  • Just tried sorrounding all my code blocks (from "The error..." to $(check_PROGRAMS) and posting was successful (I'm a happy camper). The underlying issue of detecting which 'code' block was objected to still remains. I don't understand your comment on wrapping. Wrapping proceeded correctly as expected, that is, the output contains a scroll bar. Are you saying if the line is too long then I should manually insert a carriage return?
    – lostbits
    Commented Mar 7, 2015 at 0:29
  • @ArthurSchwarez: The neccessity of that scroll-bar is the issue I wanted to draw to your attention. Wrapping avoids it by breaking too-long lines into acceptably-short lines. Always make your post as short and concise as possible, and avoid scrolling like the plague. Especially the nested kind. Commented Mar 7, 2015 at 0:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .