Error ld returned 1 exit status как исправить linux

The collect2: error: ld returned 1 exit status error is fixed by shutting down the program running in the background. Read this complete guide to learn more.

Why is the collect error ld returned exit status happeningThe collect2: error: ld returned 1 exit status error message is easily fixed by removing an existing executable file inside your document. It is possible to remove the existing file that is running in the background by accessing the thread tools inside your system. The complete process is easy to do and only consists of a couple of steps.

If you want to become an expert at fixing this undefined reference in your program, keep reading this complete guide that contains all the details.

Contents

  • Why Is the collect2: Error: Ld Returned 1 Exit Status Happening?
  • How To Fix This Error Inside Your Program
    • – Listing All the Possible Methods for Debugging This Error
    • – A Common Error in the Gem Native Extension
    • – Using the Debugging Library Syntax for the collect2 Error
    • – Facing This Error in Dev C++
  • FAQs
    • – What Is collect2 Exe?
    • – What Does Error 1d Returned 1 Exit Status Mean?
    • – How To Combine Two Files in C++?
  • Final Conclusion and Further Notes

Why Is the collect2: Error: Ld Returned 1 Exit Status Happening?

This specific collect2: error: ld returned 1 exit status error message appears due to previous errors in your document, especially when working with C++. It represents one of the most common errors web developers face but it is also one of the easiest ones to fix. In other words, this error is there to indicate that the linking step in the process of creating faced certain problems.

This is going to create an undefined reference because the exit status is more than the value of zero. You can run multiple steps to create a search thread that is going to eliminate the problem. We are going to list and explain the various methods you can use to fix this error in your document. Continue reading the following section of this article to learn more about the debugging process.

How To Fix This Error Inside Your Program

The easiest and most common method of fixing this error requires you to completely delete the existing executable file that is running in the background of your program. However, as is the case with most other bugs, this solution might not work for everyone and every single time. Lucky for you, programming languages allow users to fix an error in multiple ways, in case any of the previous ones does not work.

This is called a process of debugging, where you are trying to completely remove an error you have encountered in your program. No matter how serious the error may be, the debugging process always starts with an inspection of the problem. After that, locate where the error is coming from and apply all the necessary changes to the code.

Let us now learn something more about the ways of debugging this error.

– Listing All the Possible Methods for Debugging This Error

In this part of the guide, we are going to list the possible methods for debugging and also briefly explain their function. Let us take a deep dive at the following list that shows the most common ways of fixing this error:

  • Deleting the existing executable file inside your program: The file may have failed because it is locked in a different location, such as an antivirus.
  • It is possible to try and rename that specific executable file in your program. Then, you are supposed to restructure the contents, and you are done. Renaming the file helps the program to create an additional executable file.
  • In case none of this works, you should try restarting your computer and redo the first step. This solution shows that debugging does not always have to be complicated.

In theory, this is all it takes to completely remove this error from your syntax. However, it is always best to learn from examples. That is why in the following section of this article, we are going to show you example codes to easily fix this error.

– A Common Error in the Gem Native Extension

Many web developers face certain problems once working with extensions for their browsers. One such bug appears when you are trying to install a gem inside the native extension on your browser.

The reason why we are explaining the native extension is that the collect2 error usually appears during the process of installing a gem. To better understand what this means, you should take a look at the complete syntax.

Take a closer look at the following code that is going to initiate the collect2 error:

Building a proper native extension.  This might take a while…

ERROR:  Error installing json:
ERROR: Failed to generate gem native extension.
/home/foobar/.rvm/ruby-2.4.7/bin/ruby -r ./siteconf134617815-3312439-1i9lahdrj.rb extconf.rb
creating Makefile
make “DESTDIR=” clean
make “DESTDIR=”
compiling generator.c
linking shared-object json/ext/generator.so
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [generator.so] Error 1
make failed, exit code 2

Gem files will remain installed in /home/foobar/.rvm/gems/ruby-2.4.7/gems/json-1.8.3 for inspection.

Results logged to /home/foobar/.rvm/gems/ruby-2.4.7/extensions/x86_64-linux/2.2.0/json-1.8.3/gem_make.out

As you can see, this is the complete code for the collect2 error inside your program. There is certainly something you can do to the syntax to debug this error and make the program functional again. Indeed, we are going to change some things in the library and this is going to completely remove the error. Take a look at the following section of this article to learn more.

– Using the Debugging Library Syntax for the collect2 Error

As previously explained, you are supposed to change certain things inside the library to fix this error. For this, you are going to need the gmp function to locate the correct files and return the incorrect status. Open the code with the cache search gmp function and include all the additional tools inside.

The following syntax shows how to properly use the gmp function to fix this error:

$ apt-cache search gmp
libgmp-dev – Multiprecision arithmetic library developers tools
libgmp10 – Multiprecision arithmetic library
libgmp10-doc – Multiprecision arithmetic library example code
libgmp3-dev – Multiprecision arithmetic library developers tools
libgmpxx4ldbl – Multiprecision arithmetic library (C++ bindings)
[…]

Be aware that the syntax may be subject to changes. As this example shows, the annoying collect2 error does not have to be complicated to locate and fix. However, pay attention to the exact location of the gmp function because this may sometimes be the difference between a correctly and incorrectly executed code. Let us now learn other things about this common error in your program.

– Facing This Error in Dev C++

As previously explained, the collect2 error may usually appear once working with Dev C++. It refers to a specific reference to a name where the linker cannot define the way it looks based on the object files. This also applies to all the libraries that make up your document.

Lucky for you, fixing the error is done in the same manner as previously taught. All you have to do is to follow the steps discussed in this article and the problem is going to disappear. To learn more about this error, continue reading the FAQ section of this article.

FAQs

Here are the answers to some of your questions regarding this error.

– What Is collect2 Exe?

Collect2 represents a utility that web developers use to arrange certain initialization functions during the start time. In other words, it is used to link the program and the adequate functions, while creating a table inside a temporary file. Then, it is going to create a second link with the program but include a different file.

– What Does Error 1d Returned 1 Exit Status Mean?

The returned 1 status refers to an error in your document that is created due to previous errors. It is used as an indicator to point out that certain linking steps during the building process have bugs. To fix the error, you are supposed to refer to all the previous functions and locate the part of the program that is operating incorrectly.

– How To Combine Two Files in C++?

You can start combining two files in C++ by creating two separate source files on your server. The process of combining two C++ files is important because you can combine two different programs and functions. Since the collect2 error usually appears during this process, it is important to understand how the files are merged together.

There are several steps you are supposed to closely follow, as shown in the following list:

  1. Create two separate C++ source files on your server.
  2. Both files should be saved inside the same location on the server.
  3. Open the Command Prompt tool and run the various commands from your files.
  4. The tool is going to merge the two separate source files together and comply their functions.
  5. Install the C++ Complier Program to run the newly-created file without any bugs.

This is all it takes to create a complex C++ file without facing any collect2 errors in your server. You can use this method for any two C++ files.

This section wraps everything important you were supposed to know about the collect2 error in your document. Let us now summarize the details.

Final Conclusion and Further Notes

This specific exit status error message is easily fixed by removing an existing executable file inside your document. Let us take a deep dive at the following list that contains all the important details from this article:

  • The collect2 error is easily fixed by shutting down a program that is running in the background
  • Web developers usually face this problem once working with Dev C++ and other files
  • The Gem native extension usually displays this error alongside the complete syntax but it can be easily fixed
  • It is important to know the meaning of collect2 to debug the error more efficiently
  • It is possible to merge two C++ source files in five basic steps without caring about this error

How to fix collect error ld returned exit status errorWeb developers are constantly struggling with the collect2 error inside their syntax and are unable to debug it. Lucky for you, now you know all the details to remove this error from your document without affecting the rest of the syntax.

  • Author
  • Recent Posts

Position is Everything

Position Is Everything: Your Go-To Resource for Learn & Build: CSS,JavaScript,HTML,PHP,C++ and MYSQL.

Position is Everything

I tried to search for that bug online, but all the posts are for C++.

This is the message:

test1.o: In function `ReadDictionary':
/home/johnny/Desktop/haggai/test1.c:13: undefined reference to `CreateDictionary'
collect2: error: ld returned 1 exit status
make: *** [test1] Error 1

It is super simple code, and I can’t understand what the problem is:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dict.h"
#include "hash.h"


pHash ReadDictionary() {
    /* This function reads a dictionary line by line from the standard input. */
    pHash dictionary;
    char entryLine[100] = "";
    char *word, *translation;

    dictionary = CreateDictionary();
    while (scanf("%s", entryLine) == 1) { // Not EOF
        word = strtok(entryLine, "=");
        translation = strtok(NULL, "=");
        AddTranslation(dictionary, word, translation);
    }
    return dictionary;
}

int main() {
    pHash dicti;
...

Now this is the header file dict.h:

#ifndef _DICT_H_
#define _DICT_H_

#include "hash.h"

pHash CreateDictionary();
...

#endif

And here is the dict.c file:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hash.h"
#include "dict.h"


pHash CreateDectionary()
{
    pHash newDict;
    newDict = HashCreate(650, HashWord, PrintEntry, CompareWords, GetEntryKey, DestroyEntry);
    return newDict;
}

And if you want to check file hash.h:

#ifndef _HASH_H_
#define _HASH_H_

// Type definitions //
typedef enum {FAIL = 0, SUCCESS} Result;
typedef enum {SAME = 0, DIFFERENT} CompResult;

typedef struct _Hash Hash, *pHash;

typedef void* pElement;
typedef void* pKey;

// Function types //
typedef int (*HashFunc) (pKey key, int size);
typedef Result (*PrintFunc) (pElement element);
typedef CompResult (*CompareFunc) (pKey key1, pKey key2);
typedef pKey (*GetKeyFunc) (pElement element);
typedef void (*DestroyFunc)(pElement element);
...

// Interface functions //

#endif

Maybe it will be easier if I give you the files here?

Anyway, I will be happy for tips on how to understand the problem.

I tried to search for that bug online, but all the posts are for C++.

This is the message:

test1.o: In function `ReadDictionary':
/home/johnny/Desktop/haggai/test1.c:13: undefined reference to `CreateDictionary'
collect2: error: ld returned 1 exit status
make: *** [test1] Error 1

It is super simple code, and I can’t understand what the problem is:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dict.h"
#include "hash.h"


pHash ReadDictionary() {
    /* This function reads a dictionary line by line from the standard input. */
    pHash dictionary;
    char entryLine[100] = "";
    char *word, *translation;

    dictionary = CreateDictionary();
    while (scanf("%s", entryLine) == 1) { // Not EOF
        word = strtok(entryLine, "=");
        translation = strtok(NULL, "=");
        AddTranslation(dictionary, word, translation);
    }
    return dictionary;
}

int main() {
    pHash dicti;
...

Now this is the header file dict.h:

#ifndef _DICT_H_
#define _DICT_H_

#include "hash.h"

pHash CreateDictionary();
...

#endif

And here is the dict.c file:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hash.h"
#include "dict.h"


pHash CreateDectionary()
{
    pHash newDict;
    newDict = HashCreate(650, HashWord, PrintEntry, CompareWords, GetEntryKey, DestroyEntry);
    return newDict;
}

And if you want to check file hash.h:

#ifndef _HASH_H_
#define _HASH_H_

// Type definitions //
typedef enum {FAIL = 0, SUCCESS} Result;
typedef enum {SAME = 0, DIFFERENT} CompResult;

typedef struct _Hash Hash, *pHash;

typedef void* pElement;
typedef void* pKey;

// Function types //
typedef int (*HashFunc) (pKey key, int size);
typedef Result (*PrintFunc) (pElement element);
typedef CompResult (*CompareFunc) (pKey key1, pKey key2);
typedef pKey (*GetKeyFunc) (pElement element);
typedef void (*DestroyFunc)(pElement element);
...

// Interface functions //

#endif

Maybe it will be easier if I give you the files here?

Anyway, I will be happy for tips on how to understand the problem.

Содержание

  1. Qt ошибка: collect2: error: ld returned 1 exit status
  2. CMake linking error (collect2: ld returned 1 exit status)
  3. 1 Answer 1
  4. linux assembly «collect2: ld returned 1 exit status»
  5. 1 Answer 1
  6. Using C Library/runtime
  7. Can’t compile C++ in Ubuntu using GCC — Include/Library Problems (collect2: ld returned 1 exit status)
  8. 3 Answers 3
  9. collect2: error: ld returned 1 exit status (-lcudnn)
  10. Edit 1
  11. Problem
  12. Description
  13. What I tried
  14. 2 Answers 2

Qt ошибка: collect2: error: ld returned 1 exit status

Kubuntu LTS 18.04 новая, Qt 5.11

Всем привет! Поставил новую Kubuntu и Qt, сделал новый проект, только с MainWindow. Сначала ругался линковщик, вылечил установив

и еще время от времени вылезает такая ошибка

Ошибка где-то выше должна быть. Полный выхлоп дай.

Покажи что выдает.

Зачем от рута запускал креатор? Делай теперь

Сделал. Ничего не выдает В некоторых проектах были проблемы с девайсами, система не давала работать с ними без прав. Запускал и без рута, ошибка остается

Дай полный вывод с ошибкой.

Извиняюсь, надо было сразу дать инфу из консоли сборки

Народ, я нашел ответ, кому интересно почитать или различается система, здесь: http://doc.qt.io/qt-5/linux.html , а кому некогда, для Debian/Ubuntu (apt-get):

Cпасибо за помощь

Причина в том, что Qt 5 раздулся, разжирел, у него сильно усложнился деплой и теперь он требует OpenGL там, где он нахер не нужен.

Если ты попробуешь заюзать Qt 4, то оно просто соберётся. Так как зависимости от OpenGL там нет.

Все верно, недавно ставил Qt на Lubuntu.

Из соображения — лишь бы было,

поставил, вроде, версию 5.4. Оно там не требовалось.

Источник

CMake linking error (collect2: ld returned 1 exit status)

The project structure below is a simplified example.

./CMakeLists.txt

CommBase/CMakeLists.txt

NetWork/CMakeLists.txt

MessageDispatch/CMakeLists.txt

DemoServer/CMakeLists.txt

Linking CXX executable DemoServer

I’m hoping this is a really simple lack of understanding of how CMake handles dependencies. This compiles without error, but fails during linking

NetWork is dependent on CommBase, MessageDispatch dependent on NetWork and CommBase,how can i specify in DemoServer

1 Answer 1

There are a few issues here, some more critical than others. Roughly in order of importance:

add_library allows you to define the library as either STATIC or SHARED , but not both.

target_link_libraries links the dependencies in the order they appear in the command. You should specify them from most-dependent to least. So, in your DemoServer CMakeLists.txt, it should be

However, from the docs:

Library dependencies are transitive by default. When this target is linked into another target then the libraries linked to this target will appear on the link line for the other target too.

In other words, you should have TARGET_LINK_LIBRARIES(NetWork CommBase) in NetWork (you already do), TARGET_LINK_LIBRARIES(MessageDispatch NetWork) in MessageDispatch, and just TARGET_LINK_LIBRARIES(DemoServer MessageDispatch) for the Demo.

CMAKE_BUILD_TYPE would normally be set by the user via the command line (or CMake GUI). It should probably only be set inside the CMakeLists.txt if the user hasn’t already done so, or if it’s set to an invalid value. If you set or change the value, it would be good to tell the user via a message . You probably shouldn’t be setting it in 2 different places.

aux_source_directory is not recommended as a means to gather lists of source files. The recommended way is to hard-code the file paths into your CMakeLists.txt, so if the source list changes, CMake automatically re-runs.

link_directories is rarely required, and shouldn’t contain a hard-coded absolute path.

add_dependencies is not required if you have already specified these dependencies via a target_link_libraries call.

Источник

linux assembly «collect2: ld returned 1 exit status»

I entered the source code on a web site of online coding.

But I got error below the source code.

I think I omitted «main».

Since I learned Intel assmbly, I don’t know how to fix it.

Could you help me?

Thank you for helping me in advance.

/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o: In function _start’: (.text+0x18): undefined reference to main’ collect2: ld returned 1 exit status

1 Answer 1

If you are just using GCC as a linker and don’t care about the C runtime then you can exclude it (as Jester pointed out) by passing -nostdlib to gcc . You then need to provide a _start symbol so the code would look like:

You’d assemble and link it like this:

Alternatively you can link directly with ld so you could also do this:

This would generate a 32-bit Linux executable called file

Using C Library/runtime

Although I don’t think the following is what you intended, someone may find the following information useful:

You can use GCC and have the C library available to your assembly code by renaming _START to main . The C runtime contains an entry point called _start that handles initialization and then calls a function called main . You can take advantage of the C library but main has to setup the stack frame correctly and properly clean it up and return when finished since main will be treated as a C function. The code would look something like this:

This example uses both int 0x80 system call to write standard output, and uses C printf to do the same. You can assemble and link to an executable called file with:

Источник

Can’t compile C++ in Ubuntu using GCC — Include/Library Problems (collect2: ld returned 1 exit status)

I guess I’m not linking something right?

I want to call ABC.cpp which needs XYZ.h and XYZ.cpp . All are in my current directory and I’ve tried #include as well as #include «XYZ.h» .

Running $ g++ -I. -l. ABC.cpp at the Ubuntu 10 Terminal gives me:

Here’s a summary of ABC.cpp:

I’m using GNU Compiler version g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3 .

This is my first post; I hope I included everything that someone would need to know to help me. I have actually read the «Related Questions» and the Gough article listed in one of the responses, as well as searched around for the error message. However, I still can’t figure out how it applies to my problem.

Thanks in advance!

3 Answers 3

When you run g++ -I. -l. ABC.cpp you are asking the compiler to create an executable out of ABC.cpp . But the code in this file replies on a function defined in XYZ.cpp , so the executable cannot be created due to that missing function.

You have two options (depending on what it is that you want to do). Either you give the compiler all of the source files at once so that it has all the definitions, e.g.

or, you use the -c option compile to ABC.cpp to object code (.obj on Windows, .o in Linux) which can be linked later, e.g.

Which will produce ABC.o which can be linked later with XYZ.o to produce an executable.

Edit: What is the difference between #including and linking?

Understanding this fully requires understanding exactly what happens when you compile a C++ program, which unfortunately even many people who consider themselves to be C++ programmers do not. At a high level, the compilation of a C++ program goes through three stages: preprocessing, compilation, and linking.

Preprocessing

Every line that starts with # is a preprocessor directive which is evaluated at the preprocessing stage. The #include directive is literally a copy-and-paste. If you write #include «XYZ.h» , the preprocessor replaces that line with the entire contents of XYZ.h (including recursive evaluations of #include within XYZ.h ).

The purpose of including is to make declarations visible. In order to use the function GetOneGaussianByBoxMuller , the compiler needs to know that GetOneGaussianByBoxMuller is a function, and to know what (if any) arguments it takes and what value it returns, the compiler will need to see a declaration for it. Declarations go in header files, and header files are included to make declarations visible to the compiler before the point of use.

Compiling

This is the part where the compiler runs and turns your source code into machine code. Note that machine code is not the same thing as executable code. An executable requires additional information about how to load the machine code and the data into memory, and how to bring in external dynamic libraries if necessary. That’s not done here. This is just the part where your code goes from C++ to raw machine instructions.

Unlike Java, Python, and some other languages, C++ has no concept of a «module». Instead, C++ works in terms of translation units. In nearly all cases, a translation unit corresponds to a single (non-header) source code file, e.g. ABC.cpp or XYZ.cpp . Each translation unit is compiled independently (whether you run separate -c commands for them, or you give them to the compiler all at once).

When a source file is compiled, the preprocessor runs first, and does the #include copy-pasting as well as macros and other things that the preprocessor does. The result is one long stream of C++ code consisting of the contents of the source file and everything included by it (and everything included by what it included, etc. ) This long stream of code is the translation unit.

When the translation unit is compiled, every function and every variable used must be declared. The compiler will not allow you to call a function for which there is no declaration or to use a global variable for which there is no declaration, because then it wouldn’t know the types, parameters, return values, etc, involved and could not generate sensible code. That’s why you need headers — keep in mind that at this point the compiler is not even remotely aware of the existence of any other source files; it is only considering this stream of code produced by the processing of the #include directives.

In the machine code produced by the compiler, there are no such things as variable names or function names. Everything must become a memory address. Every global variable must be translated to a memory address where it is stored, and every function must have a memory address that the flow of execution jumps to when it is called. For things that are defined (i.e. for functions, implemented) in the translation unit, the compiler can assign an address. For things that are only declared (usually as a result of included headers) and not defined, the compiler does not at this point know what the memory address should be. These functions and global variables for which the compiler has only a declaration but not a definition/implementation, are called external symbols, and they are presumed to exist in a different translation unit. For now, their memory addresses are represented with placeholders.

For example, when compiling the translation unit corresponding to ABC.cpp , it has a definition (implementation) of ABC , so it can assign an address to the function ABC and wherever in that translation unit ABC is called, it can create a jump instruction to that address. On the other hand, although its declaration is visible, GetOneGaussianByBoxMuller is not implemented in that translation unit, so its address must be represented with a placeholder.

The result of compiling a translation unit is an object file (with the .o suffix on Linux).

Linking

One of the main jobs of the linker is to resolve external symbols. That is, the linker looks through a set of object files, sees what their external symbols are, and then tries to find out what memory address should be assigned to them, replacing the placeholder.

In your case the function GetOneGaussianByBoxMuller is defined in the translation unit corresponding to XYZ.cpp , so inside XYZ.o it has been assigned a specific memory address. In the translation unit corresponding to ABC.cpp , it was only declared, so inside ABC.o , it is only a placeholder (external symbol). The linker, if given both ABC.o and XYZ.o will see that ABC.o needs an address filled in for GetOneGaussianByBoxMuller , find that address in XYZ.o , and replace the placeholder in ABC.o with it. Addresses for external symbols can also be found in libraries.

If the linker fails to find an address for GetOneGaussianByBoxMuller (as it does in your example where it is only working on ABC.o , as a result of not having passed XYZ.cpp to the compiler), it will report an unresolved external symbol error, also described as an undefined reference.

Finally, once the compiler has resolved all external symbols, it combines all of the now-placeholder-free object code, adds in all the loading information that the operating system needs, and produces an executable. Tada!

Источник

collect2: error: ld returned 1 exit status (-lcudnn)

Edit 1

I forgot to mention that I want to use the theano library.

After I reached out to the admin, the cudnn modules were provided by them. However, I am still getting the same error.

So, most probably, I have a link problem, however, I can’t find it where.

Problem

I am struggling with ld: cannot find -lcudnn .

Description

I want to use Cuda and CuDnn for my project. I am working in a cluster, Cuda is installed in the cluster already (p.s. I don’t have root permissions). So I copy the Cuda files into my local folder and install Cudnn as instructed on the official website. However, ld cannot find libcudnn.so .

What I tried

If I add the library path of libcudnn.so manually

Here is my LD_LIBRARY_PATH

ld somehow ignores LD_LIBRARY_PATH . Since I do not have the root permissions, I cannot either create a symbolic link or make changes in ldconfig . So, setting LD_LIBRARY_PATH is the only way I can fix it.

Thanks for your help.

2 Answers 2

(This could have been a comment but I don’t have enough reputation for that; I am talking only about the general linker etc usage, I don’t know about the cuda or cudnn projects and what build tools they use, etc)

If I add the library path of libcudnn.so manually

This is a link line with no object files to link and create an executable with.

This shows you got the right path into -L .

This will be fixed once you use a proper link line perhaps by incorporating the -L path you have correctly specified above into the build process e.g. the Makefile or whatever else is appropriate.

ld somehow ignores LD_LIBRARY_PATH. Since I do not have the root permissions, I cannot either create a symbolic link or make changes in ldconfig. So, setting LD_LIBRARY_PATH is the only way I can fix it.

Источник

Hi,

I had some cpp scripts which used to work! I changed my Ubuntu and therefore I installed the opencv from git. Now when I make the same files I receive this error:

g++ -c -m64 -pipe -O2 -std=c++0x -Wall -W -fPIE -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I. -I/usr/local/include -o main.o main.cpp
g++ -c -m64 -pipe -O2 -std=c++0x -Wall -W -fPIE -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I. -I/usr/local/include -o dbscan.o dbscan.cpp
g++ -m64 -Wl,-O1 -o opticalFlowVideo main.o dbscan.o pkg-config --libs opencv libavformat libavcodec libswscale libavutil
/usr/bin/ld: cannot find -lippicv
collect2: error: ld returned 1 exit status
make: *** [opticalFlowVideo] Error 1

The same scrit still works on my older system with an older branch of Opencv.

This is my system specifications:

Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty

And this is my opencv libs:

pkg-config —libs opencv
-L/usr/local/lib -lopencv_cudabgsegm -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_stitching -lopencv_cudafeatures2d -lopencv_superres -lopencv_cudacodec -lopencv_videostab -lopencv_cudaoptflow -lopencv_cudalegacy -lopencv_cudawarping -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn -lopencv_dpm -lopencv_fuzzy -lopencv_hdf -lopencv_line_descriptor -lopencv_optflow -lopencv_plot -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_rgbd -lopencv_viz -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lippicv -lopencv_highgui -lopencv_videoio -lopencv_photo -lopencv_imgcodecs -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_imgproc -lopencv_cudaarithm -lopencv_core -lopencv_cudev

Thanks in advance

I want to install nexalign (can be downloaded from here) on ubuntu 13.10. I previously installed it on ubuntu 10 without any problem. The error I got is:

gcc   -O9 -Wall -Dthread -lpthread main.o mapping.o interface.o input.o sarray.o mem.o output.o pattern_searching.o pattern_searching_solid.o string_matching.o time.o misc.o bt.o mapping_output.o hash.o r_output.o mapping_solid.o pattern_searching_short.o sort_mapping.o cluster_mapping.o -o nexalign
mapping.o: In function `mapping':
mapping.c:(.text+0x21e): undefined reference to `pthread_create'
mapping.c:(.text+0x276): undefined reference to `pthread_join'
mapping.c:(.text+0x410): undefined reference to `pthread_create'
mapping.c:(.text+0x65e): undefined reference to `pthread_create'
mapping_solid.o: In function `mapping_solid':
mapping_solid.c:(.text+0x1f4): undefined reference to `pthread_create'
mapping_solid.c:(.text+0x23b): undefined reference to `pthread_join'
mapping_solid.c:(.text+0x3dc): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make: *** [all] Error 1

When I change the 5th line (LD = -lpthread as LD = -l) in make file the program was installed without any errors. I have basic knowledge in C/C++.

Do I miss anything by converting the 5th line to «LD = -l»? Or do you have any suggestions?

I searched «ask ubuntu portal» to find answer, but I did not get a helpful one.

thanks.

Maythux's user avatar

Maythux

81.3k54 gold badges235 silver badges268 bronze badges

asked Mar 5, 2014 at 9:12

m.i.cosacak's user avatar

-lpthread is an option to specify linking against the posix thread library. If your compilation works without specifying that library, it is probably included by default already, so you don’t «miss» anything.

According to this, your original makefile is probably incorrect, that is why you get the error message.

Community's user avatar

answered Jul 13, 2014 at 3:39

noleti's user avatar

noletinoleti

4,00325 silver badges24 bronze badges

I am trying to compile ChatScript V7.55 on Ubuntu 16.04 but I got this error message:

collect2: error: ld returned 1 exit status
Makefile:107: recipe for target ‘binary’ failed
make: *** [binary] Error 1

What is this and how can I fix?

This is the whole result after tried this command: make server

************ LINUX VERSION ************
g++ constructCode.o duktape/duktape.c evserver.o csocket.o cs_ev.c dictionarySystem.o englishTagger.o factSystem.o json.o functionExecute.o english.o infer.o javascript.o jsmn.o markSystem.o mongodb.o os.o outputSystem.o patternSystem.o postgres.o privatesrc.o scriptCompile.o spellcheck.o secure.o systemVariables.o tagger.o testing.o textUtilities.o tokenSystem.o topicSystem.o userCache.o userSystem.o variableSystem.o mainSystem.o -L/usr/lib64 -lrt -lcurl  --verbose -pthread -DLOCKUSERFILE=1  -DEVSERVER=1 -DEVSERVER_FORK=1  -DDISCARDPOSTGRES=1 -DDISCARDMONGO=1 -DDISCARDMYSQL=1  -Ievserver -o ../BINARIES/ChatScript
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -I evserver -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D_REENTRANT -D LOCKUSERFILE=1 -D EVSERVER=1 -D EVSERVER_FORK=1 -D DISCARDPOSTGRES=1 -D DISCARDMONGO=1 -D DISCARDMYSQL=1 duktape/duktape.c -quiet -dumpbase duktape.c -mtune=generic -march=x86-64 -auxbase duktape -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccz9862e.s
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 evserver
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c3fdb80f2154421ceaf9e22c85325a8d
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -v -I evserver --64 -o /tmp/ccm8SVai.o /tmp/ccz9862e.s
GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -I evserver -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D_REENTRANT -D LOCKUSERFILE=1 -D EVSERVER=1 -D EVSERVER_FORK=1 -D DISCARDPOSTGRES=1 -D DISCARDMONGO=1 -D DISCARDMYSQL=1 cs_ev.c -quiet -dumpbase cs_ev.c -mtune=generic -march=x86-64 -auxbase cs_ev -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccz9862e.s
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 evserver
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c3fdb80f2154421ceaf9e22c85325a8d
In file included from cs_ev.c:5:0:
evserver/ev.c:1254:31: warning: ‘ev_default_loop_ptr’ initialized and declared ‘extern’
   EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */
                               ^
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -v -I evserver --64 -o /tmp/ccRZyE1l.o /tmp/ccz9862e.s
GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccIwnEUp.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o ../BINARIES/ChatScript /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. constructCode.o /tmp/ccm8SVai.o evserver.o csocket.o /tmp/ccRZyE1l.o dictionarySystem.o englishTagger.o factSystem.o json.o functionExecute.o english.o infer.o javascript.o jsmn.o markSystem.o mongodb.o os.o outputSystem.o patternSystem.o postgres.o privatesrc.o scriptCompile.o spellcheck.o secure.o systemVariables.o tagger.o testing.o textUtilities.o tokenSystem.o topicSystem.o userCache.o userSystem.o variableSystem.o mainSystem.o -lrt -lcurl -lstdc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
evserver.o: In function `evsrv_do_chat(Client_t*)':
evserver.cpp:(.text+0x161a): undefined reference to `LogChat(long, char*, char*, char*, int, char*, char*)'
mainSystem.o: In function `InitSystem(int, char**, char*, char*, char*, USERFILESYSTEM*, void (*)(char*), void (*)(char*))':
mainSystem.cpp:(.text+0x2687): undefined reference to `ReadTopicFiles(char*, unsigned int, int)'
mainSystem.cpp:(.text+0x273d): undefined reference to `ReadTopicFiles(char*, unsigned int, int)'
collect2: error: ld returned 1 exit status
Makefile:107: recipe for target 'binary' failed
make: *** [binary] Error 1

This is the make file contents too: https://github.com/bwilcox-1234/ChatScript/blob/master/SRC/Makefile

I ran ./autogen.sh inside the ../SRC/evserver and this is the results:

libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.ac:6: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:6: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
configure.ac:10: installing './compile'
configure.ac:6: installing './missing'
Makefile.am: installing './depcomp'

After that ran ./configure inside ../SRC/evserver and this is the result:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
configure: WARNING: Libtool does not cope well with whitespace in `pwd`
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %sn
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking sys/inotify.h usability... yes
checking sys/inotify.h presence... yes
checking for sys/inotify.h... yes
checking sys/epoll.h usability... yes
checking sys/epoll.h presence... yes
checking for sys/epoll.h... yes
checking sys/event.h usability... no
checking sys/event.h presence... no
checking for sys/event.h... no
checking port.h usability... no
checking port.h presence... no
checking for port.h... no
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/eventfd.h usability... yes
checking sys/eventfd.h presence... yes
checking for sys/eventfd.h... yes
checking sys/signalfd.h usability... yes
checking sys/signalfd.h presence... yes
checking for sys/signalfd.h... yes
checking for inotify_init... yes
checking for epoll_ctl... yes
checking for kqueue... no
checking for port_create... no
checking for poll... yes
checking for select... yes
checking for eventfd... yes
checking for signalfd... yes
checking for clock_gettime... yes
checking for nanosleep... yes
checking for library containing floor... -lm
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

This is make server result after them:

************ LINUX VERSION ************
g++ constructCode.o duktape/duktape.c evserver.o csocket.o cs_ev.c dictionarySystem.o englishTagger.o factSystem.o json.o functionExecute.o english.o infer.o javascript.o jsmn.o markSystem.o mongodb.o os.o outputSystem.o patternSystem.o postgres.o privatesrc.o scriptCompile.o spellcheck.o secure.o systemVariables.o tagger.o testing.o textUtilities.o tokenSystem.o topicSystem.o userCache.o userSystem.o variableSystem.o mainSystem.o -L/usr/lib64 -lrt -lcurl  --verbose -pthread -DLOCKUSERFILE=1  -DEVSERVER=1 -DEVSERVER_FORK=1  -DDISCARDPOSTGRES=1 -DDISCARDMONGO=1 -DDISCARDMYSQL=1  -Ievserver -o ../BINARIES/ChatScript
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -I evserver -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D_REENTRANT -D LOCKUSERFILE=1 -D EVSERVER=1 -D EVSERVER_FORK=1 -D DISCARDPOSTGRES=1 -D DISCARDMONGO=1 -D DISCARDMYSQL=1 duktape/duktape.c -quiet -dumpbase duktape.c -mtune=generic -march=x86-64 -auxbase duktape -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccY9JQBg.s
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 evserver
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c3fdb80f2154421ceaf9e22c85325a8d
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -v -I evserver --64 -o /tmp/ccBVYgwH.o /tmp/ccY9JQBg.s
GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -I evserver -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D_REENTRANT -D LOCKUSERFILE=1 -D EVSERVER=1 -D EVSERVER_FORK=1 -D DISCARDPOSTGRES=1 -D DISCARDMONGO=1 -D DISCARDMYSQL=1 cs_ev.c -quiet -dumpbase cs_ev.c -mtune=generic -march=x86-64 -auxbase cs_ev -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccY9JQBg.s
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 evserver
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c3fdb80f2154421ceaf9e22c85325a8d
In file included from cs_ev.c:5:0:
evserver/ev.c:1254:31: warning: ‘ev_default_loop_ptr’ initialized and declared ‘extern’
   EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialis
                               ^
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -v -I evserver --64 -o /tmp/ccWFo098.o /tmp/ccY9JQBg.s
GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/cc9oL8PA.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o ../BINARIES/ChatScript /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. constructCode.o /tmp/ccBVYgwH.o evserver.o csocket.o /tmp/ccWFo098.o dictionarySystem.o englishTagger.o factSystem.o json.o functionExecute.o english.o infer.o javascript.o jsmn.o markSystem.o mongodb.o os.o outputSystem.o patternSystem.o postgres.o privatesrc.o scriptCompile.o spellcheck.o secure.o systemVariables.o tagger.o testing.o textUtilities.o tokenSystem.o topicSystem.o userCache.o userSystem.o variableSystem.o mainSystem.o -lrt -lcurl -lstdc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Makefile:107: recipe for target 'binary' failed
make: *** [binary] Error 1

I am trying to compile ChatScript V7.55 on Ubuntu 16.04 but I got this error message:

collect2: error: ld returned 1 exit status
Makefile:107: recipe for target ‘binary’ failed
make: *** [binary] Error 1

What is this and how can I fix?

This is the whole result after tried this command: make server

************ LINUX VERSION ************
g++ constructCode.o duktape/duktape.c evserver.o csocket.o cs_ev.c dictionarySystem.o englishTagger.o factSystem.o json.o functionExecute.o english.o infer.o javascript.o jsmn.o markSystem.o mongodb.o os.o outputSystem.o patternSystem.o postgres.o privatesrc.o scriptCompile.o spellcheck.o secure.o systemVariables.o tagger.o testing.o textUtilities.o tokenSystem.o topicSystem.o userCache.o userSystem.o variableSystem.o mainSystem.o -L/usr/lib64 -lrt -lcurl  --verbose -pthread -DLOCKUSERFILE=1  -DEVSERVER=1 -DEVSERVER_FORK=1  -DDISCARDPOSTGRES=1 -DDISCARDMONGO=1 -DDISCARDMYSQL=1  -Ievserver -o ../BINARIES/ChatScript
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -I evserver -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D_REENTRANT -D LOCKUSERFILE=1 -D EVSERVER=1 -D EVSERVER_FORK=1 -D DISCARDPOSTGRES=1 -D DISCARDMONGO=1 -D DISCARDMYSQL=1 duktape/duktape.c -quiet -dumpbase duktape.c -mtune=generic -march=x86-64 -auxbase duktape -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccz9862e.s
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 evserver
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c3fdb80f2154421ceaf9e22c85325a8d
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -v -I evserver --64 -o /tmp/ccm8SVai.o /tmp/ccz9862e.s
GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -I evserver -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D_REENTRANT -D LOCKUSERFILE=1 -D EVSERVER=1 -D EVSERVER_FORK=1 -D DISCARDPOSTGRES=1 -D DISCARDMONGO=1 -D DISCARDMYSQL=1 cs_ev.c -quiet -dumpbase cs_ev.c -mtune=generic -march=x86-64 -auxbase cs_ev -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccz9862e.s
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 evserver
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
    compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c3fdb80f2154421ceaf9e22c85325a8d
In file included from cs_ev.c:5:0:
evserver/ev.c:1254:31: warning: ‘ev_default_loop_ptr’ initialized and declared ‘extern’
   EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */
                               ^
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -v -I evserver --64 -o /tmp/ccRZyE1l.o /tmp/ccz9862e.s
GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-L/usr/lib64' '-v' '-pthread' '-D' 'LOCKUSERFILE=1' '-D' 'EVSERVER=1' '-D' 'EVSERVER_FORK=1' '-D' 'DISCARDPOSTGRES=1' '-D' 'DISCARDMONGO=1' '-D' 'DISCARDMYSQL=1' '-I' 'evserver' '-o' '../BINARIES/ChatScript' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccIwnEUp.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o ../BINARIES/ChatScript /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. constructCode.o /tmp/ccm8SVai.o evserver.o csocket.o /tmp/ccRZyE1l.o dictionarySystem.o englishTagger.o factSystem.o json.o functionExecute.o english.o infer.o javascript.o jsmn.o markSystem.o mongodb.o os.o outputSystem.o patternSystem.o postgres.o privatesrc.o scriptCompile.o spellcheck.o secure.o systemVariables.o tagger.o testing.o textUtilities.o tokenSystem.o topicSystem.o userCache.o userSystem.o variableSystem.o mainSystem.o -lrt -lcurl -lstdc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
evserver.o: In function `evsrv_do_chat(Client_t*)':
evserver.cpp:(.text+0x161a): undefined reference to `LogChat(long, char*, char*, char*, int, char*, char*)'
mainSystem.o: In function `InitSystem(int, char**, char*, char*, char*, USERFILESYSTEM*, void (*)(char*), void (*)(char*))':
mainSystem.cpp:(.text+0x2687): undefined reference to `ReadTopicFiles(char*, unsigned int, int)'
mainSystem.cpp:(.text+0x273d): undefined reference to `ReadTopicFiles(char*, unsigned int, int)'
collect2: error: ld returned 1 exit status
Makefile:107: recipe for target 'binary' failed
make: *** [binary] Error 1

This is the make file contents too:

.PHONY = all clean binary server debugserver standalone pgserver debugpgserver mongoserver debugmongoserver foreignserver mongotreetaggerserver 


server: DEFINES+= -DLOCKUSERFILE=1  -DEVSERVER=1 -DEVSERVER_FORK=1  -DDISCARDPOSTGRES=1 -DDISCARDMONGO=1 -DDISCARDMYSQL=1 
server: PGLOAD= -pthread
server: INCLUDEDIRS=-Ievserver
server: all
server: EXECUTABLE=../BINARIES/ChatScript
server: CFLAGS=-c  -std=c++11 -Wall  -funsigned-char  -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing 

debugserver: DEFINES+= -DLOCKUSERFILE=1 -DDISCARDPOSTGRES=1 -DDISCARDMONGO=1 -DDISCARDMYSQL=1  -DDEBUG -DEVSERVER=1 -DEVSERVER_FORK=1 
debugserver: PGLOAD= -pthread
debugserver: INCLUDEDIRS=-Ievserver
debugserver: all
debugserver: EXECUTABLE=../BINARIES/ChatScriptDebug
debugserver: CFLAGS=-c -std=c++11 -Wall  -funsigned-char  -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing -g

standalone: DEFINES+=  -DDISCARDSERVER=1 -DDISCARDPOSTGRES=1 -DDISCARDMONGO=1 -DDISCARDMYSQL=1 -DEVSERVER=1 -DEVSERVER_FORK=1
standalone: PGLOAD= -pthread
standalone: INCLUDEDIRS=-Ievserver
standalone: all
standalone: EXECUTABLE=../BINARIES/ChatScript
standalone: CFLAGS=-c -std=c++11  -Wall  -funsigned-char  -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing 

pgserver: DEFINES+= -DLOCKUSERFILE=1 -DEVSERVER=1 -DEVSERVER_FORK=1 -DDISCARDMONGO=1 -DDISCARDMYSQL=1
pgserver: PGLOAD= -lpq -pthread
pgserver: all
pgserver: EXECUTABLE=../BINARIES/ChatScriptpg
pgserver: INCLUDEDIRS=-Ievserver -Ipostgres
pgserver: CFLAGS=-c -std=c++11 -Wall  -funsigned-char  -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing 

debugpgserver: DEFINES+= -DLOCKUSERFILE=1  -DDEBUG -DEVSERVER=1 -DEVSERVER_FORK=1  -DDISCARDMONGO=1  
debugpgserver: PGLOAD= -lpq -pthread
debugpgserver: INCLUDEDIRS=-Ievserver
debugpgserver: all
debugpgserver: EXECUTABLE=../BINARIES/ChatScriptpgDebug
debugpgserver: CFLAGS=-c -std=c++11 -Wall  -funsigned-char  -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing -g

mongoserver: DEFINES+= -DLOCKUSERFILE=1 -DEVSERVER=1 -DEVSERVER_FORK=1 -DDISCARDPOSTGRES=1 -DDISCARDMYSQL=1
mongoserver: PGLOAD= -pthread
mongoserver: all
mongoserver: EXECUTABLE=../BINARIES/ChatScriptMongo
mongoserver: INCLUDEDIRS=-Iinclude -I/usr/local/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0
mongoserver: CFLAGS=-c -std=c++11  -Wall  -funsigned-char  -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing -g

debugmongoserver: DEFINES+= -DLOCKUSERFILE=1  -DDEBUG -DEVSERVER=1 -DEVSERVER_FORK=1  -DDISCARDPOSTGRES=1  -DDISCARDMYSQL=1
debugmongoserver: PGLOAD= -lpq -pthread
debugmongoserver: all
debugmongoserver: INCLUDEDIRS=-Iinclude -I/usr/local/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0
debugmongoserver: EXECUTABLE=../BINARIES/ChatScriptMongoDebug
debugmongoserver: CFLAGS=-c -std=c++11 -Wall  -funsigned-char  -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing -g

foreignserver: DEFINES+= -DLOCKUSERFILE=1  -DEVSERVER=1 -DEVSERVER_FORK=1  -DDISCARDPOSTGRES=1 -DDISCARDMONGO=1 -DDISCARDMYSQL=1 -DTREETAGGER=1
foreignserver: PGLOAD= -pthread -L../treetagger -L../BINARIES -ltreetagger
foreignserver: INCLUDEDIRS=-Ievserver
foreignserver: all
foreignserver: EXECUTABLE=../BINARIES/ChatScriptForeign
foreignserver: CFLAGS=-c -std=c++11 -Wall  -funsigned-char  -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing 

mongotreetaggerserver: DEFINES+= -DLOCKUSERFILE=1  -DEVSERVER=1 -DEVSERVER_FORK=1  -DDISCARDPOSTGRES=1  -DDISCARDMYSQL=1 -DTREETAGGER=1
mongotreetaggerserver: PGLOAD= -pthread -L../treetagger -L../BINARIES -ltreetagger
mongotreetaggerserver: INCLUDEDIRS=-Iinclude -I/usr/local/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0
mongotreetaggerserver: all
mongotreetaggerserver: EXECUTABLE=../BINARIES/ChatScriptMongoForeign
mongotreetaggerserver: CFLAGS=-c -std=c++11 -Wall  -funsigned-char  -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing 

UNAME := $(shell uname)

CC=g++

ifeq ($(UNAME), Linux)
$(info ************ LINUX VERSION ************)
LDFLAGS= -L/usr/lib64 -lrt -lcurl  --verbose $(PGLOAD)
mongoserver: LDFLAGS+= -lcrypt -lsasl2 -L/usr/local/lib -lmongoc-1.0 -lbson-1.0 
debugmongoserver: LDFLAGS+= -lcrypt -lsasl2 -L/usr/local/lib -lmongoc-1.0 -lbson-1.0 
mongotreetaggerserver: LDFLAGS+= -lcrypt -lsasl2 -L/usr/local/lib -lmongoc-1.0 -lbson-1.0 
endif

ifeq ($(UNAME), Darwin)
OSXRELEASE := $(shell defaults read loginwindow SystemVersionStampAsString)
$(info ************ MAC VERSION $OSXRELEASE detected ************)
LDFLAGS=-mmacosx-version-min=$(OSXRELEASE) -lcurl $(PGLOAD)  
CFLAGS=-mmacosx-version-min=$(OSXRELEASE) -c  -Wall  -funsigned-char -Wno-write-strings -Wno-char-subscripts 
endif

ifeq ($(UNAME), FreeBSD)
$(info ************ FREEBSD VERSION ************)
DEFINES+= -DFREEBSD=1
INCLUDEDIRS+= -I/usr/local/include
LDFLAGS= -L/usr/local/lib -lrt -lcurl -lev  --verbose $(PGLOAD)
mongoserver: LDFLAGS+= -lgcrypt -lsasl2 -lmongoc-1.0 -lbson-1.0 
debugmongoserver: LDFLAGS+= -lgcrypt -lsasl2 -lmongoc-1.0 -lbson-1.0 
mongotreetaggerserver: LDFLAGS+= -lgcrypt -lsasl2 -lmongoc-1.0 -lbson-1.0 
endif

SOURCES=constructCode.cpp duktape/duktape.c evserver.cpp csocket.cpp cs_ev.c dictionarySystem.cpp englishTagger.cpp factSystem.cpp json.cpp functionExecute.cpp english.cpp infer.cpp javascript.cpp jsmn.cpp markSystem.cpp mongodb.cpp os.cpp outputSystem.cpp patternSystem.cpp postgres.cpp privatesrc.cpp scriptCompile.cpp spellcheck.cpp secure.cpp systemVariables.cpp tagger.cpp testing.cpp textUtilities.cpp tokenSystem.cpp topicSystem.cpp userCache.cpp userSystem.cpp variableSystem.cpp mainSystem.cpp 
OBJECTS=$(SOURCES:.cpp=.o)

all: $(SOURCES) binary

clean:
    -rm -f $(EXECUTABLE)
    -rm -f ../$(EXECUTABLE)
    -rm -f *.o

binary: $(OBJECTS)
    $(CC) $(OBJECTS) $(LDFLAGS) $(DEFINES) $(INCLUDEDIRS) -o $(EXECUTABLE)

.cpp.o:
    $(CC) $(CFLAGS) $(DEFINES) $(INCLUDEDIRS) $< -o $@

Понравилась статья? Поделить с друзьями:
  • Error launching the game 0x00000002 не удается найти указанный файл
  • Error launching the editor the application path does not exist unity
  • Error launching the application please check the system requirements avx yakuza 3
  • Error launching pycharm failed to load jvm dll
  • Error launching libguestfs appliance