C users user desktop collect2 exe error ld returned 1 exit status

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

Содержание

  1. C компиляция: collect2: ошибка: ld возвращен 1 статус выхода
  2. ОТВЕТЫ
  3. Ответ 1
  4. Ответ 2
  5. Ответ 3
  6. Ответ 4
  7. Ответ 5
  8. Ответ 6
  9. Ответ 7
  10. Gcc collect2 exe error ld returned 1 exit status
  11. mironyuk
  12. Вложения
  13. Эдуард Анисимов
  14. mironyuk
  15. 03-05.7z
  16. Эдуард Анисимов
  17. mironyuk
  18. Эдуард Анисимов
  19. mironyuk
  20. Эдуард Анисимов
  21. mironyuk
  22. Эдуард Анисимов
  23. OpenSTM32 Community
  24. The STM32 Systems Resource
  25. SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs
  26. System Workbench for STM32
  27. 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:

  • Video: Simultaneous debug of Linux and bare-metal applications.
  • Video: Motor control by gestures (image processing on Cortex-A7/Linux, real-time on bare metal Cortex-M4).
  • White paper: Asymmetric Multi-Programming with System Workbench for Linux .
  • White paper: Creating an STM32MP1 Linux platform with System Workbench for Linux .

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:

  1. 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

Источник

vitalya199529

0 / 0 / 1

Регистрация: 12.02.2013

Сообщений: 21

1

13.11.2013, 14:14. Показов 49041. Ответов 14

Метки нет (Все метки)


господа программисты, объясните мне в чем тут дело, я решил поиграться со счетчиком строк, но вот что то он не запускается

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<iostream>
using namespace std;
int main()
{ double f, m;
int counter;
counter=0;
for(f=1.0; f<=100.0; f++)
{m=f/3.28;
cout«f«"funt"«"ravno"«m«"metr"«endl;
counter++;
if (counter == 2)
{cout«endl;
counter=0;
}
}
return 0;
}

ошибка
C:Program FilesDev-CppMinGW64bincollect2.exe [Error] ld returned 1 exit status

я видел тему на счет этой ошибки на форуме но внятного решения проблемы так и не увидел
HELP
p.s. Я ТОЛЬКО НАЧАЛ ИЗУЧАТЬ ПРОГРАММИРОВАНИЕ НА С++, поэтому пожалуйста не нужно давать сложных решений данной проблемы)

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



castaway

Эксперт С++

4978 / 3085 / 456

Регистрация: 10.11.2010

Сообщений: 11,164

Записей в блоге: 10

13.11.2013, 14:15

2

Тут, и везде в остальном коде не кавычки должны быть, а два знака <

C++
1
cout«f«"funt"«"ravno"«m«"metr"«endl;



0



vitalya199529

0 / 0 / 1

Регистрация: 12.02.2013

Сообщений: 21

13.11.2013, 14:17

 [ТС]

3

Цитата
Сообщение от castaway
Посмотреть сообщение

Тут, и везде в коде не кавычки должны быть, а два знака <

C++
1
cout«f«"funt"«"ravno"«m«"metr"«endl;

ну так это и есть два знака << просто при копировании кода из devc++ они заменились на «
я уже не первый раз это замечаю



0



Эксперт С++

4978 / 3085 / 456

Регистрация: 10.11.2010

Сообщений: 11,164

Записей в блоге: 10

13.11.2013, 14:19

4

Ты букву Б на клавиатуре видишь?



0



0 / 0 / 1

Регистрация: 12.02.2013

Сообщений: 21

13.11.2013, 14:21

 [ТС]

5

так что дело не в этом, у меня да же при всем желании не получается поставить этот знак « только << так, так что ошибка не в этом

Добавлено через 45 секунд

Цитата
Сообщение от castaway
Посмотреть сообщение

Ты букву Б на клавиатуре видишь?

у меня да же при всем желании не получается поставить этот знак « только << так, так что ошибка не в этом



0



Эксперт С++

4978 / 3085 / 456

Регистрация: 10.11.2010

Сообщений: 11,164

Записей в блоге: 10

13.11.2013, 14:23

6

Ты в Microsoft Word программы пишешь?



0



vitalya199529

0 / 0 / 1

Регистрация: 12.02.2013

Сообщений: 21

13.11.2013, 14:23

 [ТС]

7

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<iostream>
using namespace std;
int main()
{ double f, m;
int counter;
counter=0;
for(f=1.0; f<=100.0; f++)
{m=f/3.28;
cout<<f<<"funt"<<"ravno"<<m<<"metr"<<endl;
counter++;
if (counter == 2)
{cout<<endl;
counter=0;
}
}
return 0;
}

вот так вот у меня код записан в деве

Добавлено через 22 секунды

Цитата
Сообщение от castaway
Посмотреть сообщение

Ты в Microsoft Word программы пишешь?

Dev C++



0



Эксперт С++

4978 / 3085 / 456

Регистрация: 10.11.2010

Сообщений: 11,164

Записей в блоге: 10

13.11.2013, 14:25

8

В этой программе нет синтаксических ошибок. У меня она компилируется нормально.



0



0 / 0 / 1

Регистрация: 12.02.2013

Сообщений: 21

13.11.2013, 14:26

 [ТС]

9

я могу скрин кинуть, только скажите как это сделать))



0



Почетный модератор

Эксперт С++

5850 / 2861 / 392

Регистрация: 01.11.2011

Сообщений: 6,905

13.11.2013, 14:31

10

vitalya199529, перепишите код руками. Не копируйте. Руками. Это и полезно вам будет и ошибку устранит.



0



0 / 0 / 1

Регистрация: 12.02.2013

Сообщений: 21

13.11.2013, 14:37

 [ТС]

11

проблема решилась сама собой после 100500 попытки запуска все заработало)



0



0 / 0 / 0

Регистрация: 05.04.2014

Сообщений: 5

08.08.2015, 14:21

12

Надо в диспетчере задач убить процесс своей программы. и запускай



0



Don’t worry, be happy

17781 / 10545 / 2036

Регистрация: 27.09.2012

Сообщений: 26,516

Записей в блоге: 1

08.08.2015, 14:28

13

Надо в диспетчере задач убить процесс своей программы. и запускай

Он за два года еще из цикла не вышел



4



castaway

08.08.2015, 14:28

Не по теме:

Цитата
Сообщение от Croessmah
Посмотреть сообщение

Он за два года еще из цикла не вышел

:D.



0



0 / 0 / 0

Регистрация: 05.08.2019

Сообщений: 3

05.08.2019, 22:17

15

Он просто консоль забыл вырубить и все



0



PlatformIO Community

Loading

I am using Windows 10 64 bit Home Edition.
I amd using the 64 bit TDM compiler.
I am using Dev-C++.

I am trying to carry out the following command from the Dev-C++,
and am getting an error message that I can’t fix. I am attempting
to submit the following as a Linker command, and am only being told
that the compiler/linker «can’t find». I have been led to believe
from this forum that the more recent C++ compilers are capable of
linking directly into .dll files, without .h or .lib files involved.

I want to accomplish the following effect:

g++ main.cpp -l C:UsersUserDesktopprecision.dll

I am updating Dev-C++ with:

-l C:UsersUserDesktopprecision.dll

so that I can compile main.cpp, which has the line
trying to access an internal class inside the .dll:

#include «fprecision.h»

When I try this from the command line, I am getting:

C:UsersUserDesktop>g++ main.cpp -l C:UsersUserDesktopprecision.dll
C:/Program Files/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lC:UsersUserDesktopprecision.dll
collect2.exe: error: ld returned 1 exit status

Am I using the correct 64 bit Windows compiler to achieve this?
What am I doing wrong/not telling Dev-C++ correctly? Can someone
steer me to a clearer direction, please?

Last edited on

What happens if you type
g++ main.cpp C:UsersUserDesktopprecision.dll
(That is, without the ‘-l’ ).

Failing that,
Open a command window.
Type dir C:UsersUserDesktop > out and hit enter.
Then paste the file out here, please.

Last edited on

Are you sure GCC does understand .dll files ?
Normally the extension for a dynamic library is .so
Since you have a .dll it seems it was build with a different compiler / linker

I am using 64 bit Windows 10 Home Edition.
I am using 64 bit TDM 4.9.2.
I am using Dev-C++.
I don’t have the option to use any version of MS Visual Studio.

****************************************************************
Contents from the out file:
****************************************************************

Volume in drive C is Zachary
Volume Serial Number is 1E55-3A23

Directory of C:UsersUserDesktop

01-Jan-19 12:23 PM <DIR> .
01-Jan-19 12:23 PM <DIR> ..
12-Nov-18 04:21 PM 1,007,244 Animation.blend
04-Aug-16 07:03 PM 1,975 ATI System Monitor.lnk
25-Jun-16 06:10 PM 1,654 Audacity.lnk
14-Jun-18 05:38 PM 1,160 Blender 3D.lnk
30-Dec-18 01:32 PM 979,840 bookmarks.html
22-Dec-18 05:31 PM 153 Christmas Presents for Self.txt
09-Aug-17 07:53 PM 1,907 Comodo Killswitch.lnk
17-May-16 07:22 PM 1,035 DBDesigner 4.lnk
13-Nov-15 02:13 PM 1,266 Defragment.lnk
01-Jan-19 12:16 PM 1,076 Dev-C++.lnk
11-Dec-17 02:35 PM <DIR> Development Software
17-May-16 07:22 PM 1,229 DHTML Menu Builder.lnk
06-Oct-18 05:48 PM 1,481 dllChecker.lnk
03-May-17 03:42 PM 1,071 EitherMouse.lnk
10-Nov-18 01:11 PM 1,147 FormBuilder.lnk
15-Oct-18 02:35 PM <DIR> Frog
22-Oct-18 08:27 PM 951 GIMP.lnk
02-Jul-16 01:44 PM 872 Handbrake.lnk
13-Nov-15 02:13 PM 1,900 HTML Kompozer.lnk
17-May-16 07:22 PM 2,098 IJ Scan Utility.lnk
28-Jul-18 01:03 AM 1,330 Internet Explorer.lnk
28-Oct-17 11:50 AM <DIR> javadoc Creation Directory
08-Aug-15 03:54 PM <DIR> jd-gui-windows-1.4.0
01-Jan-19 12:23 PM 382 main.cpp
16-May-18 10:24 PM 1,417 Microsoft Edge.lnk
01-Jan-19 12:11 PM 364,932,326 MinGW-64.zip
27-Jul-16 11:13 PM 1,662 Mozilla Thunderbird.lnk
31-Dec-18 09:26 PM 12,978 Notes.txt
24-Apr-18 12:14 PM 1,038 OpenOffice Calc.lnk
24-Apr-18 12:14 PM 1,046 OpenOffice Impress.lnk
24-Apr-18 12:14 PM 988 OpenOffice Math.lnk
24-Apr-18 12:14 PM 1,060 OpenOffice Writer.lnk
01-Jan-19 12:23 PM 0 out
17-May-16 07:22 PM 1,256 Paint.lnk
29-Dec-18 04:03 PM <DIR> precision
29-Dec-18 04:03 PM 111,047 precision.dll
29-Dec-18 03:32 PM 1,280,018 Precision.zip
31-Dec-18 12:53 PM <DIR> Present Matters
12-Nov-18 09:00 PM 142 Property Suburbs.txt
12-Oct-17 04:45 PM 1,026 Putty.lnk
08-Oct-17 04:23 PM 2,021 Razer Synapse.lnk
30-Oct-17 11:35 AM 246 Restore MBR et al.txt
22-Oct-17 11:39 AM <DIR> Resume Material
13-Nov-15 02:13 PM 262 Run.lnk
10-Nov-17 01:18 PM 858 SpeedCrunch.lnk
28-Nov-18 11:50 AM <DIR> Web Page Downloading
12-Jun-18 12:11 PM <DIR> Weekly Finance Projections
17-May-16 07:22 PM 1,104 Windows Explorer.lnk
28-Jul-16 03:03 PM 1,835 Windows Media Player.lnk
04-Nov-18 01:48 PM 1,526 Wise Uninstaller.lnk
21-Oct-17 04:24 PM 1,659 WordPad.lnk
42 File(s) 368,365,286 bytes
11 Dir(s) 44,386,365,440 bytes free

****************************************************************
Compilation attempt error message:

C:UsersUserDesktop>g++ main.cpp C:UsersUserDesktopprecision.dll -o make.exe
main.cpp:6:24: fatal error: iprecision.h: No such file or directory
#include «iprecision.h»
^
compilation terminated.
****************************************************************

I am trying to do #include, or a one line equivalent, straight from a 64 bit .dll file.
Failing that, I wish to do the same with a 64 bit .lib file. All without any adjoinging
header files.

Can anyone tell me why my .dll file can’t be used plain and simply?

Last edited on

Well, it is now happy to find precision.dll, so that’s a start.

Where have you put the header file iprecision.h? That will not be inside precision.dll: only the function definitions will be in the latter. iprecision.h is a separate file: it won’t be found «inside» another.

iprecision.h isn’t among the list of files on your desktop, so where have you put it? You do have a directory called precision on your desktop. See if you can find it in there. There will probably be other header files too …

Last edited on

There aren’t any .h files to be obtained. From what I have been learning, there are various (larger) IDEs for C++ that will allow .lib file access to be injected straight into a programming text window. The idea being that the .lib file can be referenced via an IDE setting, and #include used to access such a class (as per an adjacent, #included .cpp class file) again.

-I would like to know if there is an easy way, inside a graphical program or utility, excluding MS Visual Studio or its Runtime, to simply have a Windows 64 bit *.lib file generated.

-I would then like to #include (or similar, via a short reaccessing statement) classes inside that .lib, so that I can compile direct calls to the class to compile, link, and run.

-Without resulting to complex calls or the use of windows.h, is there an automatic (or graphical IDE) way that I can do this (also without any .h or other adjoining files) for classes in a 64 bit .dll, or is such ease of class loading, from .dll files, impossible? Is there someone who might be able to respond with particular answers?

Last edited on

If you don’t have the library and do not know the protoptypes then the only way is to reverse engineer the DLL.

Even LoadLibrary/GetProcAddress wont work ( it will work, but most likely crash )

You say that this «celebre» dll is public domain, how it is so that the source code for it is not available ?

Last edited on

@poweruserm, perhaps you can provide a link to this particular library, so that we can see what files are needed. Where did you get the file Precision.zip from?

What is actually in the «precision» directory that is on your desktop?

Please post your main.cpp file (also currently on your desktop).

Last edited on

OK, @powerusm, let’s take a guess that this library actually comes from here:
http://www.hvks.com/Numerical/arbitrary_precision.html

The download link is in the middle of the page and yields Precision.zip.

Unzipping this gives a Precision directory containing the following files:

Arbitrary Precision Math Packages.pdf
complexprecision.h
fprecision.h
intervalprecision.h
iprecision.h
precisioncore.cpp

There are the original source files (.cpp) and headers (.h).

So why are you trying to use some .dll file?

Let’s look at some other things you have been saying.

There aren’t any .h files to be obtained.

Well how exactly do you expect any other program to know the prototypes of the library functions?

From what I have been learning,

Where and from what have you been «learning»?

there are various (larger) IDEs for C++ that will allow .lib file access to be injected straight into a programming text window.

What?

#include used to access such a class (as per an adjacent, #included .cpp class file)

#include <somefile> will effectively put that separate file into the code you are compiling. <somefile> is commonly a header file (extension .h) containing prototypes. It won’t be extracted from a .dll or anything else. It is a separate file, which must be accessible.

The header contains the declarations (i.e. prototypes, or calling sequences of functions); this is needed by the compiler to compile the procedures that call them.

The definitions of functions may well be in a separate source file, or imported from a .dll file. These separate files are needed by the linker.

Why on earth would you need windows.h?

Last edited on

I am trying to avoid the situation where you have to use the code in windows.h to access a class inside a .dll whatsoever. That approach is simply to time consuming for my purposes. I also need to avoid Visual Studio for what I am aiming to do.

I am now updated a bit. The library that I am trying to focus on is named MathGL. In this instance, notwithstanding a bunch of .a files, they provide (in the includes) their header, .h or class files, alongside .dll files in the other directory. I am (hoping) to use the .dll files, but very directly.

Most of the time, windows libraries all suplly header files and .dll files.

I have been trying to work from the images, the example which is viewable from the top of this webpage:

A.3 — Using libraries with Code::Blocks

-Once I have gone #include on the particular header that I want, how do I update Dev-C++ (or the compiler) with the .lib files? Or in fact in this real case, with the .dll files? So that I can code with classes directly from there, without any other (class assisting code or source code ceremony). Such that my classes will instantiate and compile and run in a main method? Can someone give me an example using links to at least 2 library files?

-In the case that this all can’t happen directly with 64 bit .dll files, is there a direct and easy way to create 64 bit windows .lib files? How are they created at all?

Last edited on

.lib files are usually created with visual studio compiler, gcc on windows creates .a files ( they are equivalent ).

Libraries are created the same time with dll’s. You include header files in your application, link with provided library files and only then for your application binary to run it also requires dll’s in the same folder as the executable ( for shared linking at least ).

You seem to have a huge lack of understanding how to compile, link and run an application.

My issues are just to do with library/class access. Now that I must always use a .h header file via #include and a unix style path name,…

-If I simply rename a .a file as .lib, will everything be exactly the same, and run as described?

-If, when it comes to a .dll library, in my main method file, I #include the correct class header,
and -l update the linker to the location of that .dll file, then will everything also run as described, similar to a .lib (.a ?) file?

-Are there 32 bit .lib files and 64 bit .lib files, or in fact not?

-The final thing is, is there an option or utility via TDM or Dev-C++, or a public domain
Windows utility, that will produce a .h file for .cpp classes destined for a .a file?
Could someone give a command line for such to produce the .h file from a .cpp file?

Last edited on

A library if is written in C it usually works with another compiler ( not always ).

If it is written in C++ there is no way to work when linking with another compiler due to different calling conventions between them.

Of course there are 32 bit and 64 bit libraries, it must match exactly your bitness executable.

There is no such thing as creating a header file from an DLL ( binary ) without reverse engeneering.

A DLL is NOT a library, it is a binary, just like an executable.

-If I simply rename a .a file as .lib, will everything be exactly the same, and run as described?

-If, when it comes to a .dll library, in my main method file, I #include the correct class header,
and -l update the linker to the location of that .dll file, then will everything also run as described, similar to a .lib (.a ?) file?

-Is a .lib file always multiplatform, or is it heir the the platform that a Windows/Linux compiler has defaultingly compiled it for?

(I just need someone to confirm my logic on these points.)

Last edited on

-If I simply rename a .a file as .lib, will everything be exactly the same, and run as described?

No. Entirely different compilers, entirely different layout of data in the library files.

My ‘point of view’ is the 64 bit Windows TDM compiler (stable version).
And the Dev-C++ environment.

-so from there, with an .a file, I can update the linked with -l to it, and do an #include to the .a file’s header?

-With this being the case, what exactly does this assertion mean:

No. Entirely different compilers, entirely different layout of data in the library files.

?

Last edited on

Everybody (including me) keeps telling you the same thing in different ways. I’ll try to elaborate a bit.

As you know, there are various companies and entities that produce C++ compilers and associated build systems. Some of the best known ones of course are Microsoft’s VC++, GCC Open Source compiler (TDM , which you use is one version of that), and Intel’s compiler. All these entities and companies attempt to implement the evolving C++ Standards. For example, if you create a class in your source code and compile/link it with GCC, chances are very, very, very good that you could take that source code text file and successfully build it with MSVC or Intel’s compiler. If there’s nothing platform specific in your class you could very likely build it on a Linux or Unix system, or any other platform for that matter that closely provides a C++ Standard build system.

However, we’re talking textural source code here. As you know, source code must be converted to binary op codes for the processor to execute it. Let’s think about what happens when your compiler encounters one of your classes that you’ve created. Let’s assume you’ve created a class that has three member variables of 8 bytes each (maybe three doubles. Let’s further assume the class has three member functions or methods. Here are some of the ways a compiler might implement this at the binary level….

1) It might do a memory allocation for 48 bytes and place function pointers to the three member functions in the 1st 24 bytes, and put the three doubles in the 2nd 24 bytes;

2) It might do the reverse, i.e., member variables in 1st 24 bytes and function pointers in 2nd 24 bytes;

3) It might just allocate 24 bytes for the member variables, and create a Virtual Function Table (VFT) somewhere else in memory containing function pointers to the member functions.

4) It might do something else entirely.

The point being, there is nothing in the C++ Standards that specify how a C++ compiler implementor has to implement the C++ language at the binary level.

So, assume you have a dll created by MSVC and it exports a class. Further assume that when Microsoft wrote the compiler they decided to store member variables of the class at the base allocation for the class. Then assume you somehow successfully link to the dll with GCC which might expect to find a virtual function table at the base allocation for the class. What do you think will happen at runtime if you call a function and random op codes in the member variables execute? Nothing good, I can tell you that.

If lastchance is right about the code and download you are referring to, I don’t see why you don’t just build the library with the compiler you are using and then everything will work for you.

This is a tricky issue that I believe a lot of folks don’t understand. A very, very good discussion of the issue can be found in the 1st chapter of Don Box’s book «Essential COM» published by Addison-Wesley, 1998. The title of the 1st chapter is «COM As A Better C++». Don Box is a Microsoft fellow and works on .NET, COM, OLE, language interoperability and such things.

I believe the book can be downloaded free from various websites. Do a search on it and I believe you’ll find it.

  • #1

Marlin 2.0.8, COREXY, 3D TOUCH
все работало нормально. Не знаю, что сделал ,но ошибка при компиляции вылезает не зависимо от
-компа
-смены прошивки вплоть до чистой или родной заводской
-перезагрузки компа
-удаления полного VC и установки заново

В общем, мумукаюсь уже два дня, начинаю беситься.
Наверняка кто-то тоже сталкивался с такой проблемой, отзовитесь.
Прошивку прицепил.

  • 116.7 KB
    Просмотры: 2

Эдуард Анисимов


  • #3

да, думал, что конфига хватит, минуту…

disk.yandex.ru

03-05.7z

Посмотреть и скачать с Яндекс.Диска

disk.yandex.ru


disk.yandex.ru

может это поможет.1620130181623.png

Эдуард Анисимов


  • #4

Там пишет, что rom имеет переполнение на 660 байт.
Кроме того, 30 предупреждений, которые не решены.

  • #5

я не программист, от слова Далеко, извините. Что я должен сделать с этим ромом? ну, и с предупреждениями?
Спасибо.

предупреждения и раньше были (это желтым, я понимаю), может не столько, как сейчас, но все работало. Вот начал автоуровень приделывать и кое что подкорректировал в прошиве, может и не туда ткнул где-то…

попробую вот так
1620132439440.png

Эдуард Анисимов


  • #6

ссылку на прошивку вы не видите до сих пор?

Нет.
Да и помочь вряд ли смогу.
Мне сама железка нужна, что бы понять.

  • #7

если под железкой понимается комп, то я делал на другом компе и тоже самое происходит

достал старую прошивку, предупреждений нет, переполнения ром тоже нет, но появилось новое чего то там в файле .ld
1620133835651.png

Эдуард Анисимов


  • #8

А обновления PlatformIO перед этим не было?
Я столкнулся с тем, что писал на старом, на компе, где нет интернета. И всё работало.
Дома обновился и всё перестало работать.

А почему не пишете под CubeIDE?

А судя по логу, ему скрипт для F103VC не нравится.

  • #9

я сносил два раза VC полностью и устанавливал, но вроде не писал мне VC что обновляет Платформио.
А почему не пишете под CubeIDE?\ я даже не знаю, что это, я далек от понимания языка С и пр. Просто обновил плату на 32 бит, за ней потянулся Марлин 2.0, ну и далее вопрос чем компилить, увидел VC и вперед.
А судя по логу, ему скрипт для F103VC не нравится…\ ну это «вдруг» сейчас ему не нравится, а всегда нравился, вроде.

ааааа, со старой прошивой сам баран — перенес ее в новую папку и обозвал кирилицей папку АРХИВ… блин, сам на эти грабли уже наступал… Так вот, когда АРХИВ переименовал в STORAGE, то все скомпилировалось!! Таакс, значит дело не в VC. Надо, наверное, сравнить построчно обе прошивы и найти разницу, в этой разнице и кроется ошибка или опять же русская буква закралась в команду…

Эдуард Анисимов


  • #10

Вот про эту возможность я всегда забываю. Так как никогда ни пользователя, ни каталог для проекта не создаю кириллицей.
И в логах ошибки ничего не было. Поэтому и забыл.

А сравнивать построчно удобно TotalCommander. Файловый менеджер с кучей фич в максимальной комплектации.

  • #11

Эдуард, БОЛЬШОЕ СПАСИБО!!

Эдуард Анисимов


Trying to test my program as I’m about halfway through it (hence all of the coming undefined reference warnings, but I’m running into a problem with collect2.exe. My output is as follows:

cd 'C:UsersEdwardDocumentsNetBeansProjectsTwoDArray'
C:MinGWmsys1.0binmake.exe -f Makefile CONF=Debug
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/Edward/Documents/NetBeansProjects/TwoDArray'
"/C/MinGW/msys/1.0/bin/make.exe"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/twodarray.exe
make.exe[2]: Entering directory `/c/Users/Edward/Documents/NetBeansProjects/TwoDArray'
mkdir -p build/Debug/MinGW-Windows
rm -f "build/Debug/MinGW-Windows/TwoDArray.o.d"
g++    -c -g -MMD -MP -MF "build/Debug/MinGW-Windows/TwoDArray.o.d" -o build/Debug/MinGW-Windows/TwoDArray.o TwoDArray.cpp
mkdir -p dist/Debug/MinGW-Windows
g++     -o dist/Debug/MinGW-Windows/twodarray build/Debug/MinGW-Windows/TwoDArray.o 
build/Debug/MinGW-Windows/TwoDArray.o: In function `main':
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:20: undefined reference to `set_row(double*, int, int, double*)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:21: undefined reference to `set_row(double*, int, int, double*)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:22: undefined reference to `set_row(double*, int, int, double*)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:23: undefined reference to `set_row(double*, int, int, double*)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:24: undefined reference to `set_row(double*, int, int, double*)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:26: undefined reference to `to_string[abi:cxx11](double*, int, int)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:29: undefined reference to `get_row(double*, int, int)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:36: undefined reference to `find_max(double*, int, int)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:37: undefined reference to `find_min(double*, int, int)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:42: undefined reference to `set_element(double*, int, int, int, double)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:44: undefined reference to `to_string[abi:cxx11](double*, int, int)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:48: undefined reference to `get_element(double*, int, int, int)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:50: undefined reference to `get_element(double*, int, int, int)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:53: undefined reference to `find_max(double*, int, int)'
C:UsersEdwardDocumentsNetBeansProjectsTwoDArray/TwoDArray.cpp:54: undefined reference to `find_min(double*, int, int)'
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-Windows/twodarray.exe] Error 1
make.exe[2]: Leaving directory `/c/Users/Edward/Documents/NetBeansProjects/TwoDArray'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Edward/Documents/NetBeansProjects/TwoDArray'
make.exe": *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 1s)

I think all the undefined are just things in my header because I’m not done, and the to_string lines refer to 2 of the same line:

  cout << to_string(*the_array, ROW_SIZE, COL_SIZE) << endl;

I can post the whole code so far if needed.

Понравилась статья? Поделить с друзьями:
  • C listbox как изменить цвет
  • C jamm error скачать
  • C fatal error killed signal terminated program cc1plus compilation terminated
  • C failed to initialize sound mss reported waveoutopen failed как исправить
  • C error e2075 incorrect project override option x86 borland cbuilder6 lib vcl60 csm