0

I'm working on a piece of code using Dev C++ and C language. I need to make it run parallel, so I just added <omp.h> header and provided -fopenmp flag to the compiler. the program perfectly runs when run from Dev C++ directly, but it fails to run when standalone *.exe is executed. In that case, it reports that libgomp_64-1.dll was not found.

here is a linked command as I can see it:

    Processing C source file...
--------
- C Compiler: C:\Program Files (x86)\Dev-Cpp\MinGW64\bin\gcc.exe
- Command: gcc.exe "C:\Users\jan.kubacka\OneDrive - GA Drilling\Documents\vypocty\Tl_new_model_Lee\feasibility study\znamzat\TH-DBHE_v02.c" -o "C:\Users\jan.kubacka\OneDrive - GA Drilling\Documents\vypocty\Tl_new_model_Lee\feasibility study\znamzat\TH-DBHE_v02.exe" -fopenmp -I"C:\Program Files (x86)\Dev-Cpp\MinGW64\include" -I"C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\include" -I"C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include" -L"C:\Program Files (x86)\Dev-Cpp\MinGW64\lib" -L"C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib" -static-libgcc

I did check the directory for binaries and the folder where libgomp_64-1.dll is stored is linked correctly. I suppose when I include libgomp_64-1.dll into the folder where *.exe is stored it would work, but this is not what I want. I was kind of hoping that the produced *.exe will work without any need for any auxiliary files. In addition to this, when I pass the *.exe file to somebody who does not have the Dev C++ installed (and hence his PC has no libgomp_64-1.dll in it), does this mean that it will simply not work? I always thought that when a .exe file is compiled, it stores all necessary data to be executed anywhere. Am I wrong with this?

Many thanks for the clarification.

j.

Bodo
  • 9,287
  • 1
  • 13
  • 29
argeus
  • 13
  • 2
  • You seem to want to link a static library instead of a shared llibrary. Please [edit] your question and copy&paste the full linker command that gets executed when you build the application. – Bodo Aug 07 '23 at 11:04
  • Hi, thank you for your reply. Here is the linked command (at least I hope so): - C Compiler: C:\Program Files (x86)\Dev-Cpp\MinGW64\bin\gcc.exe - Command: gcc.exe "C:\Users\****\TH-DBHE_v02.c" -o "C:\Users\****\TH-DBHE_v02.exe" -fopenmp -I"C:\Program Files (x86)\Dev-Cpp\MinGW64\include" -I"C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\include" -I"C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include" -L"C:\Program Files (x86)\Dev-Cpp\MinGW64\lib" -L"C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib" -static-libgcc – argeus Aug 07 '23 at 11:58
  • Please don't use comments to provide requested information, [edit] your question instead. Make sure to copy&paste everything as re-typing might introduce or hide errors. Use code block formatting, e.g by using the `{}` tool of the editor field or by inserting 3 backticks or 3 tilde characters (`~~~`) as separate lines before and after the code. – Bodo Aug 07 '23 at 12:05
  • Hi Bodo, question updated, thank you. Any idea how to make it work? Response much appreciated! – argeus Aug 08 '23 at 17:37
  • Answers to this question might help: https://stackoverflow.com/q/23869981/10622916 – Bodo Aug 09 '23 at 08:06

0 Answers0