I'm getting a linker error when I try to build a small C program on CentOS 8.1.  I'm new to Linux development, and to using make, and I haven't been able to solve the error.  The linker is failing to resolve a function that's defined in a static library.  I built the static library from the sample code for the APUE book.    I'm able to build my program, if I use a makefile that's provided with the APUE sample code.  But I'm trying to get it to build with a simpler makefile that I wrote.  The program is:  #include "apue.h"  int main(void) {     err_exit(8, "hello world");     exit(0); }   The relevant line from the header file is:  void    err_exit(int, const char *, ...) __attribute__((noreturn));   The makefile is:  runme: testprog.o     gcc -ansi -Wall -o runme -L. -lapue testprog.o  testprog.o: testprog.c     gcc -c -ansi -Wall -o testprog.o -I. -DLINUX -D_GNU_SOURCE testprog.c   The error is:  $ make gcc -ansi -Wall -o runme -L. -lapue testprog.o testprog.o: In function main': testprog.c:(.text+0x14): undefined reference toerr_exit' collect2: error: ld returned 1 exit status make: *** [Makefile:2: runme] Error 1  Any suggestions would be appreciated.
Why does the order in which libraries are linked sometimes cause errors in GCC?
When closing a question as a duplicate, it is becoming harder and harder to search for a good original as the pool of questions and answers grows and grows.  While the new dupe closing dialog is a huge step forward, it doesn't always work - if you've spent some time on the site, you know there are perfect answers to many new questions but you can't always find them. Or can't be bothered to, as your time is limited.  A way to further improve this could be introducing a vote for canonical answers.  It could, for example, work like this:   Answers get a new icon, the "canonical vote" (signified here by a cannon because I can't think of anything that makes sense right now.)     Only users with a certain minimum rep (maybe 1k+ or 2k+) see this icon. The icon would work like the favourite icon: You can toggle it on or off at any time. The hover message for the icon could read e.g.      This is a "canonical answer": It answers the question asked in the most extensive and general way, and is very likely to benefit other users with the same problem.    Questions that contain an answer with three or more canonical votes get special  treatment:      They show up on the top in search results; maybe even under a special heading ("Questions with canonical answers")  They show up prominently in the "close as dupe" dialog (i.e. the canonical votes influence the metric that is used to determine the questions shown there).  There could be some rewards for users whose answers receive "canonical" votes - maybe a badge if ten of your answers get at least three canonical votes, or a counter of canonical answers in your profile. It would be really interesting as it's a badge that you can't game your way to, but this whole rewarding part is entirely optional.  would be a great safeguard against over-use of this feature.    Dupe (but sans cannon):       Related: Suppose that $X_1, \ldots, X_n \sim N(0,1)$ are independent random variables. I am interested in finding a constant C that satisfies:  $$ E\left[\max_{1\leq i\leq n}|X_i|\right] \leq C \sqrt{log\  n} $$  I know one method is to employ the moment generating function trick, then take logs of both sides. However, I was wondering if there exists a more direct method. thanks! Why MOSFET source is indicated with arrow ? Is it possible to reconstruct the Hamiltonian from knowledge of its ground state wave function? Is it possible to "construct" the Hamiltonian of a system if its ground state wave function (or functional) is known? I understand one should not expect this to be generically true since the Hamiltonian contains more information (the full spectrum) than a single state vector. But are there any special cases where it's possible to obtain the Hamiltonian? Some examples would be really helpful. Changing CSV layer attribute value from text to number in QGIS? I read in a CSV file for linking to a .shp file.   All the variables that are just numbers came in as text.   How do I change the text variables to numeric in QGIS? Is there a non written rule to which person to use in the PhD thesis, 5 years of using "We" in the papers have brought me to the innate necessity to do it every time I describe something.  Recently, though, one of my lab-mates told me that I should use I, since it is your work, if the thesis were co-written, then it would be a different story.  Is there any standard in your universities, or do you have any preferred practice. On the photos where the lens flare is present, my Nikon D7000 is drawing strange labyrinth-looking artifacts. Here's an example.  The first image is a screenshot of a little part of the original photo zoomed 2:1 in Lightroom.  The second image is the same photo with Lightroom's contrast, clarity and sharpening set to the maximum to make the labyrinth pattern more visible.      This affects only some of the photos presenting lens flare. Here, for instance, the lens flare is present and light conditions are very close to the first photo, but there is no labyrinth pattern, only usual noise (screenshot of a part of a photo at 1:1 with contrast, clarity and sharpening set to the maximum):    Notes:   I can see this pattern only on some of the photos when the sun is in the frame or nearly in the frame. It is present with any lens I tested. The actual photo was shot at f/8, ISO 200, 1/640 s. I've seen this pattern in photos shot at ISO 100 as well. The photo is in RAW format, so this is not a JPEG artifact.   What is that? How do I avoid it? Photons acting as carriers of both attractive and repulsive forces I understand, in basic terms, how a photon, whilst not being electrically charged itself, is viewed as creating electrical repulsion by means of positive momomentum transfer between two negatively charged electrons.  In most introductory quantum mechanics and basic quantum field theory textbooks this repulsive momementum transfer picture is almost always used as a (in classical terms) billiard ball type illustration for electrical repulsion, the Compton effect and so on.  As a photon is a photon is a photon..... I would like to know how it also has the ability to produce atttraction and how negative momentum transfer (such as that between a positively charged object, say a positron and an electron) is explained in any sort of visualisable picture. I'm guessing this may involve Feymann diagrams and the use of time reversal but I'm on shaky ground from there on. At a movie theater, the whimsical manager announces that a free ticket will be given to the first person in line whose birthday is the same as someone in line who has already bought a ticket.  You have the option of choosing any position in the line. Assuming that you don't know anyone else's birthday, and that birthdays are uniformly distributed throughout the year (365 days year), what position in line gives you the best chance of getting free ticket? Successfully connected to a bluetooth speaker, but how do i direct sound there? A Particular Two-Variable System in a Group Suppose $a$ and $b$ are elements of a group $G$. If $a^{-1}b^{2}a=b^{3}$ and $b^{-1}a^{2}b=a^{3}$, prove $a=e=b$.   I've been trying to prove but still inconclusive. Please prove to me.  Thanks very much for proof. Does anyone have a recommendation for a book to use for the self study of real analysis? Several years ago when I completed about half a semester of Real Analysis I, the instructor used "Introduction to Analysis" by Gaughan.   While it's a good book, I'm not sure it's suited for self study by itself.  I know it's a rigorous subject, but I'd like to try and find something that "dumbs down" the material a bit, then between the two books I might be able to make some headway. How to reduce the size of VMware disk My Ubuntu image VMware disk has grown to 5GB physical file size. It's a dynamically growing disk with the maximum capacity of 8GB. I cleaned some stuff inside Linux distro and now inside it occupies 3GB. Obviously the physical file size didn't shrink back automatically. Is there a way (if possible free of charge) to shrink this disk back to ~3GB?  I need this to fit the image on the DVD. Default class inheritance access I'm preparing a document using the book class. In the table of contents, the space between the subsection number and title is too wide. How to reduce it? Yesterday I was filming a scene with my phone but suddenly the application crashed and when I try to open the m4v generated it says that is corrupted.  I have downloaded the video files (around 36MB) on my PC and I am trying to open and repair it. Can you suggest me a way to do it?  FFMPEG info  As suggested in comments I try check what FFMPEG says me about that file with this command  ffmpeg.exe -i VID_20120425_144739.m4v -c:v copy -c:a copy out.mp4 2&gt; log.txt   Here it is the result:  ffmpeg version N-40126-ga4b58fd Copyright (c) 2000-2012 the FFmpeg developers   built on Apr 26 2012 03:29:50 with gcc 4.6.3   configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib   libavutil      51. 47.100 / 51. 47.100   libavcodec     54. 15.100 / 54. 15.100   libavformat    54.  3.100 / 54.  3.100   libavdevice    53.  4.100 / 53.  4.100   libavfilter     2. 72.100 /  2. 72.100   libswscale      2.  1.100 /  2.  1.100   libswresample   0. 11.100 /  0. 11.100   libpostproc    52.  0.100 / 52.  0.100 [mov,mp4,m4a,3gp,3g2,mj2 @ 003fc940] moov atom not found VID_20120425_144739.m4v: Invalid data found when processing input   Latest two lines are displayed in red. Installing Crystal Reports 8.5 on Windows 7 I have successfully installed Crystal Reports 8.5 on my Windows 7 desktop, but when I try to launch the application i get this:    Any experience with this?  Besides the obvious "update to as newer version", does anyone have any suggestions? How can I tell which cards or sets are currently legal in various formats? Does light reflect if incident at exactly the critical angle? A lot of textbooks and exam boards claim that light incident at exactly the critical angle is transmitted along the media boundary (i.e. at right-angles to the normal), but this seems to violate the principle of reversibility in classical physics.  How would a photon or ray travelling in the reverse direction "know" when to enter the higher refracting medium?  It can't know, so I conclude that such light is simply reflected?  Is this correct? File being used by another process after using File.Create()