Re: Linking fails



On Tue, 09 Dec 2008 13:58:32 -0500, Martin Ambuhl wrote:
pete wrote:
Klaus Pirker wrote:
However, when I try to compile & link I get the following error
message:

/tmp/ccKOPY3f.o(.text+0x4d): In function `main': : undefined reference
to `_mm_clflush' collect2: ld returned 1 exit status

It means that _mm_clflush is neither
declared in <stdio.h>, nor in <emmintrin.h>.


Wrong. Wrong. Wild guesses again lead to silly answers. If the
identifier were not declared, that would lead to a compilation
diagnostic.

No, it would not, if the compiler does not issue diagnostics for implicit
function declarations. C90 compilers aren't required to, and plenty do not
by default.

The _linking_ diagnostic means that the function could not
be found in the files being linked, including any libraries used. This
usually signals failure to link a library required for that function.

In this case, I'd guess _mm_clflush is supposed to be defined as a macro
or an inline function in some header. No library would be required, but
you do need to include the correct header, because that is the only place
it would be defined.
.



Relevant Pages

  • Re: Write to file from DLL
    ... I personally don't use DLL, I just use static libraries; ... look out for variable declarations like INTEGER*4 and the like. ... the type size via compiler flag during compilation but it was ... only affecting explicitly declared variables ...
    (comp.lang.fortran)
  • Re: pgm object/source comparison
    ... There may be plenty of reasons why compilation fails, ... ILE, like default activation groups, objects ... I moved the libraries, files and ... >>> seems fairly obvious that the source code in those two don't match ...
    (comp.sys.ibm.as400.misc)
  • Re: vc++ mfc project build is extremely slow taking hours
    ... How sophisticated are the "third party" libraries. ... in slower compilation, but not an hour. ... How fast is your network and file server? ... I am using precompiled headers and the environment variables point to ...
    (microsoft.public.vc.mfc)
  • Re: C++ sucks for games
    ... In the event of sufficient declarations and inference unboxed ... > compilation is performed. ... subset to C translator like Thinlisp (which currently does fixnums ... does this), where the first word is a giant tag bit, and the other ...
    (comp.lang.lisp)
  • RE: Office 2007 "__missing_type__" while importing msword.olb
    ... the type library contains a reference to another type ... Because importing Office 2007 type ... libraries on a system with Office 2003 is not a supported behavior, ... the compilation directly, or fail in the first run, but pass in the second, ...
    (microsoft.public.office.developer.com.add_ins)