The 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.
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:
- Create two separate C++ source files on your server.
- Both files should be saved inside the same location on the server.
- Open the Command Prompt tool and run the various commands from your files.
- The tool is going to merge the two separate source files together and comply their functions.
- 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
Web 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: Your Go-To Resource for Learn & Build: CSS,JavaScript,HTML,PHP,C++ and MYSQL.
Содержание
- C компиляция: collect2: ошибка: ld возвращен 1 статус выхода
- ОТВЕТЫ
- Ответ 1
- Ответ 2
- Ответ 3
- Ответ 4
- Ответ 5
- Ответ 6
- Ответ 7
- Gcc collect2 exe error ld returned 1 exit status
- mironyuk
- Вложения
- Эдуард Анисимов
- mironyuk
- 03-05.7z
- Эдуард Анисимов
- mironyuk
- Эдуард Анисимов
- mironyuk
- Эдуард Анисимов
- mironyuk
- Эдуард Анисимов
- OpenSTM32 Community
- The STM32 Systems Resource
- SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs
- System Workbench for STM32
- collect2.exe: error: ld returned 1 exit status
C компиляция: collect2: ошибка: ld возвращен 1 статус выхода
Я попытался найти эту ошибку онлайн, но все сообщения для С++.
test1.o: В функции ReadDictionary’: /home/johnny/Desktop/haggai/test1.c:13: undefined reference to CreateDictionary ‘ collect2: error: ld возвращен 1 статус выхода make: *** [test1] Ошибка 1
супер простой код и не может понять, что проблема
теперь это заголовок dict.h
и если вы хотите проверить hash.h
Может быть, будет легче, если я дам вам файлы здесь?
В любом случае, я буду рад за советы о том, как понять проблему.
ОТВЕТЫ
Ответ 1
Ваша проблема — это опечатка в функции CreateD e ctionary(). Вы должны изменить ее на CreateD i ctionary(). collect2: error: ld return 1 статус выхода — та же проблема как на C, так и на С++, обычно это означает, что у вас есть неразрешенные символы. В вашем случае это опечатка, о которой я упоминал ранее.
Ответ 2
Ответ 3
У меня возникла эта проблема, и я попытался решить многие ее проблемы. Наконец, оказалось, что make clean и make снова решили. Причина в следующем: Я получил исходный код вместе с объектными файлами, скомпилированными ранее со старой версией gcc. Когда моя новая версия gcc хочет связать эти старые файлы объектов, она не может решить какую-либо функцию там. Случается со мной несколько раз, что дистрибуторы исходного кода не очищаются перед упаковкой, поэтому make clean сохранил день.
Ответ 4
иногда эта ошибка возникла, потому что не удалось скомпилировать ни в какой другой сборке. Лучший способ попробовать — сделать чистую и снова сделать весь код.
Ответ 5
При компиляции вашей программы вам необходимо включить dict.c, например:
gcc -o test1 test1.c dict.c
Кроме того, у вас есть опечатка в определении dict.c CreateDictionary , она говорит CreateDectionary ( e вместо i )
Ответ 6
обычно эта проблема возникала, когда мы вызывали функцию, которая не была определена в программном файле, поэтому, чтобы решить эту проблему, проверьте, вызывали ли вы такую функцию, которая не была определена в файле программы.
Ответ 7
Если вы используете Dev C++, то ваш .exe или означает, что ваша программа уже запущена, и вы пытаетесь запустить ее снова.
Источник
Gcc collect2 exe error ld returned 1 exit status
mironyuk
Marlin 2.0.8, COREXY, 3D TOUCH
все работало нормально. Не знаю, что сделал ,но ошибка при компиляции вылезает не зависимо от
-компа
-смены прошивки вплоть до чистой или родной заводской
-перезагрузки компа
-удаления полного VC и установки заново
В общем, мумукаюсь уже два дня, начинаю беситься.
Наверняка кто-то тоже сталкивался с такой проблемой, отзовитесь.
Прошивку прицепил.
Вложения
Эдуард Анисимов
mironyuk
03-05.7z
Эдуард Анисимов
mironyuk
я не программист, от слова Далеко, извините. Что я должен сделать с этим ромом? ну, и с предупреждениями?
Спасибо.
предупреждения и раньше были (это желтым, я понимаю), может не столько, как сейчас, но все работало. Вот начал автоуровень приделывать и кое что подкорректировал в прошиве, может и не туда ткнул где-то.
попробую вот так
Эдуард Анисимов
mironyuk
если под железкой понимается комп, то я делал на другом компе и тоже самое происходит
достал старую прошивку, предупреждений нет, переполнения ром тоже нет, но появилось новое чего то там в файле .ld
Эдуард Анисимов
А обновления PlatformIO перед этим не было?
Я столкнулся с тем, что писал на старом, на компе, где нет интернета. И всё работало.
Дома обновился и всё перестало работать.
А почему не пишете под CubeIDE?
А судя по логу, ему скрипт для F103VC не нравится.
mironyuk
я сносил два раза VC полностью и устанавливал, но вроде не писал мне VC что обновляет Платформио.
А почему не пишете под CubeIDE?\ я даже не знаю, что это, я далек от понимания языка С и пр. Просто обновил плату на 32 бит, за ней потянулся Марлин 2.0, ну и далее вопрос чем компилить, увидел VC и вперед.
А судя по логу, ему скрипт для F103VC не нравится. \ ну это «вдруг» сейчас ему не нравится, а всегда нравился, вроде.
ааааа, со старой прошивой сам баран — перенес ее в новую папку и обозвал кирилицей папку АРХИВ. блин, сам на эти грабли уже наступал. Так вот, когда АРХИВ переименовал в STORAGE, то все скомпилировалось!! Таакс, значит дело не в VC. Надо, наверное, сравнить построчно обе прошивы и найти разницу, в этой разнице и кроется ошибка или опять же русская буква закралась в команду.
Эдуард Анисимов
Вот про эту возможность я всегда забываю. Так как никогда ни пользователя, ни каталог для проекта не создаю кириллицей.
И в логах ошибки ничего не было. Поэтому и забыл.
А сравнивать построчно удобно TotalCommander. Файловый менеджер с кучей фич в максимальной комплектации.
Источник
The STM32 Systems Resource
SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs
With System Workbench for Linux , Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4. You can get more information from the ac6-tools website and download (registration required) various documents highlighting:
|
System Workbench for STM32
collect2.exe: error: ld returned 1 exit status
I met this issue building SMARTMIC project for Bluecoin in Eclipse Oxygen with SW4STM32 plugin. I was able to build this project in the same configuration and environment, but after a few days this issue appeared. Installed Eclipse Photon and SW4STM32 plugin, issue disappeared, but after a few days reappeared again. There is the same issue with other of the shelf ST projects as well (eg STSW-SPIN3201). Could anyone help please?
Also, there is a warning:
- warning “Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)”
This wasn’t there before. It is strange, because the target MCU has FPU.
There is a build log.
make all
Building file: D:/workspace/STM32CubeFunctionPack_SMARTMIC1_V1.1.1/Middlewares/ST/STM32_AcousticDB_Library/Lib/Acoustic_DB100.c
Invoking: MCU GCC Compiler
D:workspaceSTM32CubeFunctionPack_SMARTMIC1_V1.1.1ProjectsMultiApplicationsFP-AUD-SMARTMIC1SW4STM32STM32F446ME-BlueCoinDebug
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DARM_MATH_CM4 -DUSE_HAL_DRIVER -DSTM32_BLUECOIN -DSTM32F446xx -DUSE_COMPOSITE_VCP_AUDIO
Источник
Offline
Зарегистрирован: 08.09.2016
Образовалась одна проблема:
Если в коде использовать процедуру Tin();, то возникает ошибка:
C:UsersFDE7~1AppDataLocalTempccYndXXD.s: Assembler messages: C:UsersFDE7~1AppDataLocalTempccYndXXD.s:157: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:196: Error: unknown opcode `delay1' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:198: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:201: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:204: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:207: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:210: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:213: Error: unknown opcode `delay1' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:218: Error: unknown opcode `delay1' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:221: Error: unknown opcode `delay3' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:254: Error: unknown opcode `svprt' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:258: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:262: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:263: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:265: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:266: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:268: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:269: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:271: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:272: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:274: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:275: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:277: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:278: Error: unknown opcode `delay1' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:281: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:283: Error: unknown opcode `delay1' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:285: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:286: Error: unknown opcode `svprt' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:288: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:320: Error: unknown opcode `svprt' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:324: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:327: Error: unknown opcode `delay1' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:329: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:330: Error: unknown opcode `delay3' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:332: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:333: Error: unknown opcode `delay3' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:335: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:336: Error: unknown opcode `delay3' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:338: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:339: Error: unknown opcode `delay3' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:341: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:342: Error: unknown opcode `delay3' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:344: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:345: Error: unknown opcode `delay3' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:347: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:350: Error: unknown opcode `delay2' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:352: Error: unknown opcode `o1bs' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:353: Error: unknown opcode `svprt' C:UsersFDE7~1AppDataLocalTempccYndXXD.s:355: Error: unknown opcode `o1bs' lto-wrapper: C:UsersМихаAppDataLocalArduino15packagesarduinotoolsavr-gcc4.9.2-atmel3.5.3-arduino2/bin/avr-gcc returned 1 exit status c:/users/миха/appdata/local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe: lto-wrapper failed collect2.exe: error: ld returned 1 exit status exit status 1 Ошибка компиляции.
Если же закомментить вызов данной процедуры, то все нормально компилируется.
arduino uno(CH340G), Ide 1.6.7, Win 10
#include <SoftwareSerial.h> #include <TVout.h> #include <fontALL.h> SoftwareSerial mySerial(10, 11); // RX, TX TVout TV; /* struct weather_structure { const char* descript; float temp; float pressureHPA; float pressureMMHG; byte humidity; float speed; float deg; }; */ //weather_structure weather; String weather[7]; String Data; char DataChar; bool DataBool = false; bool writer = false; void Tin() { /* Data = weather[i]; for (int z = 0; z < Data.length(); z++) TV.print(Data[z]); */ } void writeData() { if (writer == false) { Serial.println(Data); writer = true; TV.clear_screen(); Serial.println("Weather"); TV.select_font(font8x8); TV.println("Weather"); TV.select_font(font4x6); TV.delay(2000); TV.clear_screen(); Serial.print("description: "); Serial.println(weather[0]); TV.print("description: "); Tin();//ТОТ САМЫЙ ВЫЗОВ TV.println(); Serial.print("temp: "); Serial.print(weather[1]); Serial.println(" celsius"); TV.print("temp: "); //TVprint(1); TV.println(" celsius"); Serial.print("humidity: "); Serial.println(weather[2]); TV.print("humidity: "); //TVprintln(weather[2]); Serial.print("pressure: "); Serial.print(weather[3]); Serial.print(" hPa or "); Serial.print(weather[4]); Serial.println(" mmHg"); TV.print("pressure: "); //TVprint(weather[3]); TV.print(" hPa or "); //TVprint(weather[4]); TV.println(" mmHg"); Serial.print("wind's speed: "); Serial.print(weather[5]); Serial.println(" kmph"); TV.print("wind's speed: "); //TVprint(weather[5]); TV.println(" kmph"); Serial.print("wind's direction: "); Serial.print(weather[6]); Serial.println(" degrees"); TV.print("wind's direction: "); //TVprint(weather[6]); TV.println(" degrees"); } } void setup() { // Open serial communications and wait for port to open: delay(1000); Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for native USB port only } // set the data rate for the SoftwareSerial port mySerial.begin(9600); TV.begin(NTSC, 120, 96); TV.select_font(font8x8); TV.println("Weather Loading"); TV.select_font(font4x6); } void loop() { // run over and over if (mySerial.available()) { while (DataChar != '#') { DataChar = (char)mySerial.read(); if (DataBool == true) Data = Data + DataChar; else if (DataChar == '!') DataBool = true; } int j = 2; for (int i = 0; i < 7; i++) { while (Data[j] != '&') { weather[i] = weather[i] + Data[j]; j++; } j++; } writeData(); } }
Программа получает инфу с esp через softSerial, разбирает её и должна вывести на монитор
I am trying some library files for esp8266. I created hpp and .cpp files. But i try to compile program i got this error on VSCode.
collect2.exe: error: ld returned 1 exit status
*** [.piobuildhuzzahfirmware.elf] Error 1
I put files in src folder but still got this. What are points that i missed?
Building in release mode
Linking .piobuildhuzzahfirmware.elf
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::Neotimer()':
main.cpp:(.text._ZN8NeotimerC2Ev+0x0): multiple definition of `Neotimer::Neotimer()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8NeotimerC2Ev+0x0): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::Neotimer()':
main.cpp:(.text._ZN8NeotimerC2Ev+0x0): multiple definition of `Neotimer::Neotimer()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8NeotimerC2Ev+0x0): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::Neotimer(unsigned long)':
main.cpp:(.text._ZN8NeotimerC2Em+0x0): multiple definition of `Neotimer::Neotimer(unsigned long)'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8NeotimerC2Em+0x0): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::Neotimer(unsigned long)':
main.cpp:(.text._ZN8NeotimerC2Em+0x0): multiple definition of `Neotimer::Neotimer(unsigned long)'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8NeotimerC2Em+0x0): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::~Neotimer()':
main.cpp:(.text._ZN8NeotimerD2Ev+0x0): multiple definition of `Neotimer::~Neotimer()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8NeotimerD2Ev+0x0): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::~Neotimer()':
main.cpp:(.text._ZN8NeotimerD2Ev+0x0): multiple definition of `Neotimer::~Neotimer()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8NeotimerD2Ev+0x0): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::init()':
main.cpp:(.text._ZN8Neotimer4initEv+0x0): multiple definition of `Neotimer::init()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer4initEv+0x0): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::repeatReset()':
main.cpp:(.text._ZN8Neotimer11repeatResetEv+0x0): multiple definition of `Neotimer::repeatReset()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer11repeatResetEv+0x0): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::done()':
main.cpp:(.text._ZN8Neotimer4doneEv+0x4): multiple definition of `Neotimer::done()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer4doneEv+0x4): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::set(unsigned long)':
main.cpp:(.text._ZN8Neotimer3setEm+0x0): multiple definition of `Neotimer::set(unsigned long)'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer3setEm+0x0): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::get()':
main.cpp:(.text._ZN8Neotimer3getEv+0x0): multiple definition of `Neotimer::get()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer3getEv+0x0): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::stop()':
main.cpp:(.text._ZN8Neotimer4stopEv+0x4): multiple definition of `Neotimer::stop()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer4stopEv+0x4): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::reset()':
main.cpp:(.text._ZN8Neotimer5resetEv+0x8): multiple definition of `Neotimer::reset()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer5resetEv+0x8): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::repeat()':
main.cpp:(.text._ZN8Neotimer6repeatEv+0xc): multiple definition of `Neotimer::repeat()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer6repeatEv+0xc): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::repeat(int)':
main.cpp:(.text._ZN8Neotimer6repeatEi+0x8): multiple definition of `Neotimer::repeat(int)'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer6repeatEi+0x8): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::repeat(int, unsigned long)':
main.cpp:(.text._ZN8Neotimer6repeatEim+0x4): multiple definition of `Neotimer::repeat(int, unsigned long)'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer6repeatEim+0x4): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::start()':
main.cpp:(.text._ZN8Neotimer5startEv+0x4): multiple definition of `Neotimer::start()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer5startEv+0x4): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::debounce(bool)':
main.cpp:(.text._ZN8Neotimer8debounceEb+0x8): multiple definition of `Neotimer::debounce(bool)'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer8debounceEb+0x8): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::restart()':
main.cpp:(.text._ZN8Neotimer7restartEv+0x4): multiple definition of `Neotimer::restart()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer7restartEv+0x4): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::waiting()':
main.cpp:(.text._ZN8Neotimer7waitingEv+0x4): multiple definition of `Neotimer::waiting()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer7waitingEv+0x4): first defined here
c:/users/dogan/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .piobuildhuzzahsrcmain.cpp.o: in function `Neotimer::started()':
main.cpp:(.text._ZN8Neotimer7startedEv+0x0): multiple definition of `Neotimer::started()'; .piobuildhuzzahsrccommunication.cpp.o:communication.cpp:(.text._ZN8Neotimer7startedEv+0x0): first defined here
Sorry, i am new on stackexchange community so i can do basic mistakes about usage.
Now, i am adding my main.cpp,communication.cpp and communication.h files. As i said before, i didnt included neotimer and deleted. I used to add this library to my project, PIO library interface. I am thinking this problem coming from this. Great thanks for your patient and advises.
communication.cpp:
#include "communication.h"
#include "database.h"
#include "management.h"
#include "wifi.h"
String GetCommand(String data, char separator, int index)
{
int found = 0;
int strIndex[] = {0, -1};
int maxIndex = data.length() - 1;
for (int i = 0; i <= maxIndex && found <= index; i++)
{
if (data.charAt(i) == separator || i == maxIndex)
{
found++;
strIndex[0] = strIndex[1] + 1;
strIndex[1] = (i == maxIndex) ? i + 1 : i;
}
}
return found > index ? data.substring(strIndex[0], strIndex[1]) : "";
}
void checkStream(WiFiServer tcpServer,WiFiClient tcpClient, Neotimer timer,boolean pulseCheck)
{
// WiFiClient _tcpClient;
tcpClient.setTimeout(200);
tcpClient = tcpServer.available();
if(tcpClient && tcpClient.connected())
{
Serial.println("Timer Off");
timer.stop();
String requestStr = tcpClient.readStringUntil('r');
if(requestStr.length()>=8)
{
tcpClient.print(ParseStream(requestStr));
pulseCheck = false;
delay(3000);
String requestSplitStr = GetCommand(requestStr, ' ', 0);
if(requestSplitStr == "ayg_set_modem_info")
{
Serial.println("Device is going to sleep now!");
Sleep();
}
}
}
else
{
return;
}
}
String ParseStream(String content)
{
String requestSplitStr = GetCommand(content, ' ', 0);
if(requestSplitStr == "ayg_set_modem_info")
{
String ssid = GetCommand(content, ' ', 1);
String pass = GetCommand(content, ' ', 2);
Serial.println("SSID,PASS TAKING");
delay(200);
ClearEP();
boolean resSsid = WriteEPSsid(ssid);
boolean resPass = WriteEPPass(pass);
Aprint("SSID: "+ReadEPSsid());
Aprint("Pass: "+ReadEPPass());
//_tcpClient.flush();
if(resPass)
{
if(STATest())
{
return JsonResult("true");
}
else
{
return JsonResult("false");
}
}
else
{
return JsonResult("false");
}
}
else if(requestSplitStr == "ayg_get_vbatt")
{
return JsonResult(GetBattery());
// _tcpClient.flush();
// _tcpClient.stop();
}
communication.h
#ifndef communication_h
#define communication_h
#if ARDUINO > 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <WiFiServer.h>
#include <WiFiClient.h>
#include <neotimer.h>
#include "ArduinoJson.h"
//VARIABLES
String GetCommand(String data, char seperator, int index);
String ParseStream(String content);
void checkStream(WiFiServer tcpServer,WiFiClient tcpClient, Neotimer timer,boolean pulseCheck);
String JsonResult(String result);
#endif
main.cpp:
#include <stdlib.h>
#include <HX711.h>
#include <Arduino.h>
#include <ESP8266WebServer.h>
#include <string.h>
#include "communication.h"
#include <management.h>
#include <wifi.h>
#include <database.h>
#define DOUT 13 // D7
#define SCK 15 // D8
#define led1 5 // D1- Color?
#define led2 4 // D2-Color?
#define led3 0 // D3-Color?
#define led4 2 // D4 Color?
#define led5 14 // D5 Color_?
#define button 12 //Button-D5
#define VERSION "1.0"
#define CALIBRATIONWEIGHT 5.0
#define LPG 12.2
struct rst_info *rtc_info = system_get_rst_info();
ADC_MODE(ADC_VCC);
WiFiServer _tcpServer(41400);
WiFiClient _tcpClient;
//HTTPClient http;
HX711 scale;
/*Scale Values*/
float tareValFromclient;
float calibration_factor = 26845.0;
float grossWeight;
char sGrossWeight[10];
int ledPercentage;
/*Sleep Values*/
bool sleepPulseCheck=false;
/*Timers and Intervals*/
/*const unsigned long sleepInterval = 200000; // Seconds to sleep
const unsigned long scaleInterval = 2000; // Interval for scaling tank
const unsigned long ledInterval = 200;
Neotimer sleepTimer(sleepInterval);
Neotimer scaleTimer(scaleInterval);
Neotimer ledTimer(ledInterval);*/
#pragma region PROTOYPES
/*PROTOTYPES*/
void Initialize();
String checkTankTare();
void powerUpScale();
void powerDownScale();
bool Tare();
void getGrossWeight(float *fGross, char*sGross);
String getDeviceTare();
float calculateFirstNetWeight();
float getNetWeight();
int calculatePercentage();
void ledDrivePercentage(int percentage);
String calibrateScale();
#pragma endregion
/*---------------------------------------*/
void setup() {
ESP.eraseConfig();
Initialize();
Serial.println("started");
}
void loop() {
//Serial.printf("connected:%dn", WiFi.softAPgetStationNum()); // bağlı client sayısı
calibrateScale();
// checkStream(_tcpServer,_tcpClient,/*sleepTimer*/sleepPulseCheck);
ledDrivePercentage(calculatePercentage());
WriteEPGross(sGrossWeight);
if(sleepPulseCheck == false)
{
sleepPulseCheck = true;
// sleepTimer.start();
Serial.println("Sleep Fired");
}
}
-
#1
Marlin 2.0.8, COREXY, 3D TOUCH
все работало нормально. Не знаю, что сделал ,но ошибка при компиляции вылезает не зависимо от
-компа
-смены прошивки вплоть до чистой или родной заводской
-перезагрузки компа
-удаления полного VC и установки заново
В общем, мумукаюсь уже два дня, начинаю беситься.
Наверняка кто-то тоже сталкивался с такой проблемой, отзовитесь.
Прошивку прицепил.
-
116.7 KB
Просмотры: 2
-
#3
да, думал, что конфига хватит, минуту…
03-05.7z
Посмотреть и скачать с Яндекс.Диска
disk.yandex.ru
может это поможет.
-
#4
Там пишет, что rom имеет переполнение на 660 байт.
Кроме того, 30 предупреждений, которые не решены.
-
#5
я не программист, от слова Далеко, извините. Что я должен сделать с этим ромом? ну, и с предупреждениями?
Спасибо.
предупреждения и раньше были (это желтым, я понимаю), может не столько, как сейчас, но все работало. Вот начал автоуровень приделывать и кое что подкорректировал в прошиве, может и не туда ткнул где-то…
попробую вот так
-
#6
ссылку на прошивку вы не видите до сих пор?
Нет.
Да и помочь вряд ли смогу.
Мне сама железка нужна, что бы понять.
-
#7
если под железкой понимается комп, то я делал на другом компе и тоже самое происходит
достал старую прошивку, предупреждений нет, переполнения ром тоже нет, но появилось новое чего то там в файле .ld
-
#8
А обновления PlatformIO перед этим не было?
Я столкнулся с тем, что писал на старом, на компе, где нет интернета. И всё работало.
Дома обновился и всё перестало работать.
А почему не пишете под CubeIDE?
А судя по логу, ему скрипт для F103VC не нравится.
-
#9
я сносил два раза VC полностью и устанавливал, но вроде не писал мне VC что обновляет Платформио.
А почему не пишете под CubeIDE?\ я даже не знаю, что это, я далек от понимания языка С и пр. Просто обновил плату на 32 бит, за ней потянулся Марлин 2.0, ну и далее вопрос чем компилить, увидел VC и вперед.
А судя по логу, ему скрипт для F103VC не нравится…\ ну это «вдруг» сейчас ему не нравится, а всегда нравился, вроде.
ааааа, со старой прошивой сам баран — перенес ее в новую папку и обозвал кирилицей папку АРХИВ… блин, сам на эти грабли уже наступал… Так вот, когда АРХИВ переименовал в STORAGE, то все скомпилировалось!! Таакс, значит дело не в VC. Надо, наверное, сравнить построчно обе прошивы и найти разницу, в этой разнице и кроется ошибка или опять же русская буква закралась в команду…
-
#10
Вот про эту возможность я всегда забываю. Так как никогда ни пользователя, ни каталог для проекта не создаю кириллицей.
И в логах ошибки ничего не было. Поэтому и забыл.
А сравнивать построчно удобно TotalCommander. Файловый менеджер с кучей фич в максимальной комплектации.
-
#11
Эдуард, БОЛЬШОЕ СПАСИБО!!
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go version go1.7 windows/amd64
What operating system and processor architecture are you using (go env
)?
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:Go_workspace
set GORACE=
set GOROOT=C:Go
set GOTOOLDIR=C:Gopkgtoolwindows_amd64
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:UsershishaAppDataLocalTempgo-build226207278=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
What did you do?
i am using iris framework and gorm every thing was ok until using gorm
├───controllers
├───models
├───static
│ ├───css
│ │ └───images
│ │ └───prettyPhoto
│ │ ├───dark_rounded
│ │ ├───dark_square
│ │ ├───default
│ │ ├───facebook
│ │ ├───light_rounded
│ │ └───light_square
│ ├───fonts
│ ├───img
│ │ ├───clients
│ │ ├───portfolio
│ │ └───team
│ └───js
└───templates
main.go :
package main
import (
"mywebsite/controllers"
"mywebsite/models"
"github.com/kataras/go-template/django"
"github.com/kataras/iris"
)
func main() {
iris.UseTemplate(django.New()).Directory("templates", ".html")
iris.StaticServe("./static", "/public")
iris.Handle("GET", "/", controllers.MainHandler{})
models.DB_init()
iris.Listen(":8080")
}
models.go :
package models
import (
"time"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/sqlite"
)
type User struct {
gorm.Model
FirstName string `gorm:"size:25"`
LastName string `gorm:"size:25"`
Email string `gorm:"type:varchar(60);unique"`
Password string
IsAdmin bool
LastLogin time.Time
Posts []Post `gorm:"ForeignKey:UserID;"`
}
type Post struct {
gorm.Model
Title string `gorm:"type:varchar(60)"`
Content string `gorm:"type:text"`
UserID uint
}
//Init Function Initialize database and Migrate Scheme
func DB_init() {
db, err := gorm.Open("sqlite3", "db.db")
defer db.Close()
if err != nil {
panic("Failed to Connect to Database")
}
db.AutoMigrate(&User{}, &Post{})
}
controllers :
package controllers
import "github.com/kataras/iris"
type MainHandler struct {
}
func (c MainHandler) Serve(ctx *iris.Context) {
ctx.MustRender("home.html", map[string]interface{}{"message": "Hi Our Visitor"}, iris.RenderOptions{"gzip": true})
}
What did you expect to see?
C:Go_workspacesrcmywebsite>iris run main.go
_____ _
|_ _| (_)
| | ____ _ ___
| | | __|| |/ __|
_| |_| | | |__
|_____|_| |_||___/ 4.2.7
Mon, 19 Sep 2016 04:50:46 GMT: Running at 0.0.0.0:8080
What did you see instead?
go run "c:Go_workspacesrcmywebsitemain.go"
# command-line-arguments
C:Gopkgtoolwindows_amd64link.exe: running gcc failed: exit status 1
C:UsershishaAppDataLocalTempgo-link-101492155go.o:(.text+0x920260): multiple definition of `r2r1kp'
C:UsershishaAppDataLocalTempgo-link-101492155go.o:(.text+0x920270): first defined here
C:UsershishaAppDataLocalTempgo-link-101492155go.o:(.text+0x9202a0): multiple definition of `r4r3kp'
C:UsershishaAppDataLocalTempgo-link-101492155go.o:(.text+0x920290): first defined here
C:UsershishaAppDataLocalTempgo-link-101492155go.o:(.text+0x91eae0): multiple definition of `r5kp'
C:UsershishaAppDataLocalTempgo-link-101492155go.o:(.text+0x91ead8): first defined here
C:UsershishaAppDataLocalTempgo-link-101492155go.o:(.text+0x920360): multiple definition of `rupolykp'
C:UsershishaAppDataLocalTempgo-link-101492155go.o:(.text+0x920350): first defined here
collect2.exe: error: ld returned 1 exit status
iris run main.go
# command-line-arguments
C:Gopkgtoolwindows_amd64link.exe: running gcc failed: exit status 1
C:UsershishaAppDataLocalTempgo-link-217894499go.o:(.text+0x920260): multiple definition of `r2r1kp'
C:UsershishaAppDataLocalTempgo-link-217894499go.o:(.text+0x920270): first defined here
C:UsershishaAppDataLocalTempgo-link-217894499go.o:(.text+0x9202a0): multiple definition of `r4r3kp'
C:UsershishaAppDataLocalTempgo-link-217894499go.o:(.text+0x920290): first defined here
C:UsershishaAppDataLocalTempgo-link-217894499go.o:(.text+0x91eae0): multiple definition of `r5kp'
C:UsershishaAppDataLocalTempgo-link-217894499go.o:(.text+0x91ead8): first defined here
C:UsershishaAppDataLocalTempgo-link-217894499go.o:(.text+0x920360): multiple definition of `rupolykp'
C:UsershishaAppDataLocalTempgo-link-217894499go.o:(.text+0x920350): first defined here
collect2.exe: error: ld returned 1 exit status
Error: Failed to build the program.
@gopherbot