Have a number of programs that I've written in Linux cpp, and the run fine, and all so far had compiled with ming and also do exactly the same. Now have a program that compiles, but if I try to run produces the following.
0100:err:module:import_dll Library libgcc_s_seh-1.dll (which is needed by L"H:\staffx19\CONTACTD\win\txtpmr.exe") not found
0100:err:module:import_dll Library libstdc++-6.dll (which is needed by L"H:\staffx19\CONTACTD\win\txtpmr.exe") not found
0100:err:module:LdrInitializeThunk Importing dlls for L"H:\staffx19\CONTACTD\win\txtpmr.exe" failed, status c0000135
tried a modified compile line I found on links, but it then fails to compile.
x86_64-w64-mingw32-c++ txtpmr.cpp -o txtpmr.exe -Wall -O3 -static-libstdc++ -static -static-libgcc
/usr/lib/gcc/x86_64-w64-mingw32/10.3.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lpthread
So, not sure if this is a mingw issue? Or that somehow these dll files need to be added to wine??
Thanks. Hopefully, it can be fixed easily, but I haven't found a solution.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Have a number of programs that I've written in Linux cpp, and the run
fine, and all so far had compiled with ming and also do exactly the same.
Now have a program that compiles, but if I try to run produces the
following.
0100:err:module:import_dll Library libgcc_s_seh-1.dll (which is needed by
L"H:\staffx19\CONTACTD\win\txtpmr.exe") not found
0100:err:module:import_dll Library libstdc++-6.dll (which is needed by
L"H:\staffx19\CONTACTD\win\txtpmr.exe") not found
0100:err:module:LdrInitializeThunk Importing dlls for
L"H:\staffx19\CONTACTD\win\txtpmr.exe" failed, status c0000135
tried a modified compile line I found on links, but it then fails to
compile.
x86_64-w64-mingw32-c++ txtpmr.cpp -o txtpmr.exe -Wall -O3
-static-libstdc++ -static -static-libgcc
/usr/lib/gcc/x86_64-w64-mingw32/10.3.1/../../../../x86_64-w64-mingw32/bin/ld:
cannot find -lpthread
So, not sure if this is a mingw issue? Or that somehow these dll files
need to be added to wine??
Thanks. Hopefully, it can be fixed easily, but I haven't found a solution.
How would one make those libraries available? If I do the default compile, it compiles the program, but guess it then looks for run time libraries so fails. If I try the static option, it can't find linux libraries?? Was one page that talked about making a bunch of symbolic links of linux so files to the names of a bunch of windows files, but didn't think that would be useful.
Was able to modify the program so that it would compile and run fine.
Had to make the following changes.
DEL FILE fp1;
ADD FILE fp1,fp2,fp3;
ADD int i;
DEL ofstream wf(pmrfile, ios::out | ios::binary);
DEL ofstream wf2(pmexfile, ios::out | ios::binary);
ADD fp2=fopen(pmrfile,"wb+");
ADD fp3=fopen(pmexfile,"wb+");
DEL wf.write((char ) &header, sizeof(head));
ADD for(i=0;i<(int)sizeof(head);i++)
ADD fputc((header.bookname+i),fp2);
DEL wf.write((char ) &input, sizeof(indexz));
ADD for(i=0;i<(int)sizeof(indexz);i++)
ADD fputc((&input.unknown1+i),fp2);
DEL wf2.write((char ) &inputi, sizeof(indexi));
ADD for(i=0;i<(int)sizeof(indexi);i++)
ADD fputc((&inputi.unknown1+i),fp3);
DEL wf.close();
DEL wf2.close();
ADD fclose(fp2);
ADD fclose(fp3);
So not a big deal, since the modified version works fine under both linux and wine.
Don't have a real windows machine handy, so perhaps it would find those files.
By comparison the ming program is about 4 times the size of the linux one.
25888 Aug 28 15:58 txtpmry
2961 Aug 28 13:57 txtpmry.cpp
103634 Aug 28 13:57 txtpmry.exe
Thanks for the quick reply.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How would one make those libraries available? If I do the default compile,
it compiles the program, but guess it then looks for run time libraries so
fails. If I try the static option, it can't find linux libraries?? Was one
page that talked about making a bunch of symbolic links of linux so files
to the names of a bunch of windows files, but didn't think that would be
useful.
Was able to modify the program so that it would compile and run fine.
Had to make the following changes.
DEL FILE fp1; ADD FILE fp1,fp2,fp3;
ADD int i;
DEL ofstream wf(pmrfile, ios::out | ios::binary);
DEL ofstream wf2(pmexfile, ios::out | ios::binary);
ADD fp2=fopen(pmrfile,"wb+");
ADD fp3=fopen(pmexfile,"wb+");
DEL wf.close();
DEL wf2.close();
ADD fclose(fp2);
ADD fclose(fp3);
So not a big deal, since the modified version works fine under both linux
and wine.
Don't have a real windows machine handy, so perhaps it would find those
files.
By comparison the ming program is about 4 times the size of the linux one.
25888 Aug 28 15:58 txtpmry
2961 Aug 28 13:57 txtpmry.cpp
103634 Aug 28 13:57 txtpmry.exe
Went to a windows 7 machine, and searched for the file on it, and didn't find the dll files on it, so they must not be standardly installed files. Also, looked in winetricks and it has options to install dll files, but none of them is listed as an option?
Since I was able to rewrite code to work in a way that doesn't have this issue will stick with it.
Works great with linux compiler with no issues, and all the other programs worked fine with the ming compiler with no changes. Just this one. Have some others that don't use linux that might want to have these programs, so use wine to test it, and previous stuff has also worked on real windows as well.
Will have to search for those libraries dll files on web..
Thanks again for you time, was just hoping others had had this issue, and a complete solution was out there.
Have a great day, and be safe.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Went to a windows 7 machine, and searched for the file on it, and didn't find the dll files on it, so they must not be standardly installed files. Also, looked in winetricks and it has options to install dll files, but none of them is listed as an option?
Since I was able to rewrite code to work in a way that doesn't have this issue will stick with it.
Works great with linux compiler with no issues, and all the other programs worked fine with the ming compiler with no changes. Just this one. Have some others that don't use linux that might want to have these programs, so use wine to test it, and previous stuff has also worked on real windows as well.
Will have to search for those libraries dll files on web..
Thanks again for you time, was just hoping others had had this issue, and a complete solution was out there.
Have a great day, and be safe.
Have a program that compiles fine, but fails to run?
Seem to have found a fix, but haven't done full test, but program compiles and runs after doing this.
dnf install pthread
Originally, the compat and -static files where not orginally installed, but now this is what it shows.
Last metadata expiration check: 1:57:08 ago on Sun 29 Aug 2021 06:28:31 AM ChST.
Package compat-libpthread-nonshared-2.32-10.fc33.x86_64 is already installed.
Package mingw32-winpthreads-7.0.0-2.fc33.noarch is already installed.
Package mingw32-winpthreads-static-7.0.0-2.fc33.noarch is already installed.
Package mingw64-winpthreads-7.0.0-2.fc33.noarch is already installed.
Package mingw64-winpthreads-static-7.0.0-2.fc33.noarch is already installed.
Still need to check that results are the same between versions of program on linux and with wine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Seem to have found a fix, but haven't done full test, but program compiles and runs after doing this.
dnf install pthread
Originally, the compat and -static files where not orginally installed, but now this is what it shows.
Last metadata expiration check: 1:57:08 ago on Sun 29 Aug 2021 06:28:31 AM ChST.
Package compat-libpthread-nonshared-2.32-10.fc33.x86_64 is already installed.
Package mingw32-winpthreads-7.0.0-2.fc33.noarch is already installed.
Package mingw32-winpthreads-static-7.0.0-2.fc33.noarch is already installed.
Package mingw64-winpthreads-7.0.0-2.fc33.noarch is already installed.
Package mingw64-winpthreads-static-7.0.0-2.fc33.noarch is already installed.
Still need to check that results are the same between versions of program on linux and with wine.
Have a program that compiles fine, but fails to run?
I have never installed the ming compiler in either windows or in wine. Only have the program installed in the standard linux.
That would seem strange that you would have to install the compiler on any machine that wanted to run the exe program to have the dll files available??
With the other programs I have and the one after modification I can copy the exe file to any windows machine and they run without needing other dll files to be copied. Perhaps that is why they are 4+ times the size of the g++ compiled programs?
In all the other cases, the exe files seem to be standalone. With linux programs I can run ldd to check if any of the linked libraries might be missing.
I'm also not sure why adding those packages causes it to create exe files that run under wine with none of the errors. Perhaps it has it generate code into program versus putting in library/dll calls??
The 3 packages added where not included with the regular install of the ming compilers on inux??
This is what shows for ming and the pthread.
rpm -qa | grep "mingw|pthread"
mingw64-winpthreads-7.0.0-2.fc33.noarch
mingw64-headers-7.0.0-2.fc33.noarch
mingw32-crt-7.0.0-2.fc33.noarch
mingw64-binutils-2.34-8.fc33.x86_64
mingw32-wine-gecko-2.47.2-1.fc33.noarch
mingw64-crt-7.0.0-2.fc33.noarch
mingw-binutils-generic-2.34-8.fc33.x86_64
mingw32-headers-7.0.0-2.fc33.noarch
mingw32-binutils-2.34-8.fc33.x86_64
mingw64-wine-gecko-2.47.2-1.fc33.noarch
mingw32-winpthreads-7.0.0-2.fc33.noarch
mingw-filesystem-base-118-1.fc33.noarch
mingw32-filesystem-118-1.fc33.noarch
mingw64-filesystem-118-1.fc33.noarch
mingw64-cpp-10.3.1-2.fc33.x86_64
mingw64-gcc-10.3.1-2.fc33.x86_64
mingw64-gcc-c++-10.3.1-2.fc33.x86_64
mingw64-gcc-objc-10.3.1-2.fc33.x86_64
mingw32-cpp-10.3.1-2.fc33.x86_64
mingw32-gcc-10.3.1-2.fc33.x86_64
mingw32-gcc-c++-10.3.1-2.fc33.x86_64
mingw64-gcc-objc++-10.3.1-2.fc33.x86_64
mingw64-gcc-gfortran-10.3.1-2.fc33.x86_64
compat-libpthread-nonshared-2.32-10.fc33.x86_64
mingw64-winpthreads-static-7.0.0-2.fc33.noarch
mingw32-winpthreads-static-7.0.0-2.fc33.noarch
Don't do a lot of programming with ming or on windows. Don't know if all three of the last 3 needed to be added to make it work, but it does. Perhaps will try removing the last two, since they seem to be for version 7 versus version 10 like most of the rest?
Again, thanks for the help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have never installed the ming compiler in either windows or in wine.
Only have the program installed in the standard linux.
That would seem strange that you would have to install the compiler on any
machine that wanted to run the exe program to have the dll files available??
You need the language Runtime library available. If you choose to link
dynamically, you need to make sure it's available when linking and running.
If you choose to link statically, then you need to make sure it's available
when linking.
The rest of this message and your other several indicate that you need to
seek help from a basic software development forum. Perhaps try joining
Another little update.
Install codeblocks with ming under wine and recompiled the programs.
Ran into a few issues. Doesn't like the include file of the linux under the wine??
//#include <cstdio>
//#include <cstring>
//#include <cctype>
//#include <cstdlib>
//#include <time.h>
//using namespace std;</time.h></cstdlib></cctype></cstring></cstdio>
Had copied code and pasted into codebuilder and saved it. Assumed it was saving as .cpp, but it was saving it as .c, and that is why it was making the changes necessary.
Had tried the code in linux codebuilder and it compiled with no changes needed.
Then went back to the windows codebuiler, and recompiled using source files with .cpp, and they compiled with no changes.
Did notice that the .cpp code produces larger exe files.
from .cpp from .c % .c/.cpp
changex.exe 86,263 55,921 64.83%
fixf2b6.exe 132,882 67,140 50.53%
fixzzall.exe 140,346 73,726 52.53%
testc99.exe 85,817 55,919 65.16%
testpmrall.exe 85,705 57,190 66.73%
txtpmr.exe 86,704 58,194 67.12%
So, about twice as large.
Have run all 3 versions, and outputs are identical.
win directory had the code compiled with linux ming
win2 directory had the .c code compiled with codeblocks with ming
win3 directory had the .cpp code compiled with codeblocks with ming.
So, learning a little bit more.
Started on an IBM 1130 with 4K of Ram back in mid 70s, so lots of changes over the years.
Thanks once again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First, there was no issue with the code, since all versions worked fine under linux compiler.
It was just issues with messages when cross-compiling the code for windows. Seems some C functions require extra dll support files. I was able to rewrite functions to use other code like fopen to access files, and then use a loop to use fprintf to write binary data.
Have tested all of those programs, and they all run fine on a real windows 10 machine with no additional dll files. Didn't try the compile that used the other functions.
Did note that I use poppler to extract data from pdf file. There windows version does include some of the dll files, so assume they must have functions that need those dlls, so they are included.
Was interesting, but it seems to work fine. As mentioned. The code produced in windows versus produced in linux for windows is a little smaller.
But got a solution that works well, and requires no additional dll files to be packaged.
Thanks again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Have a number of programs that I've written in Linux cpp, and the run fine, and all so far had compiled with ming and also do exactly the same. Now have a program that compiles, but if I try to run produces the following.
0100:err:module:import_dll Library libgcc_s_seh-1.dll (which is needed by L"H:\staffx19\CONTACTD\win\txtpmr.exe") not found
0100:err:module:import_dll Library libstdc++-6.dll (which is needed by L"H:\staffx19\CONTACTD\win\txtpmr.exe") not found
0100:err:module:LdrInitializeThunk Importing dlls for L"H:\staffx19\CONTACTD\win\txtpmr.exe" failed, status c0000135
tried a modified compile line I found on links, but it then fails to compile.
x86_64-w64-mingw32-c++ txtpmr.cpp -o txtpmr.exe -Wall -O3 -static-libstdc++ -static -static-libgcc
/usr/lib/gcc/x86_64-w64-mingw32/10.3.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lpthread
So, not sure if this is a mingw issue? Or that somehow these dll files need to be added to wine??
Thanks. Hopefully, it can be fixed easily, but I haven't found a solution.
Looks like you are running in wine and aren't making the compiler run time
libraries available.
On Fri, Aug 27, 2021, 16:49 Michael Setzer II msetzerii@users.sourceforge.net wrote:
How would one make those libraries available? If I do the default compile, it compiles the program, but guess it then looks for run time libraries so fails. If I try the static option, it can't find linux libraries?? Was one page that talked about making a bunch of symbolic links of linux so files to the names of a bunch of windows files, but didn't think that would be useful.
Was able to modify the program so that it would compile and run fine.
Had to make the following changes.
DEL FILE fp1;
ADD FILE fp1,fp2,fp3;
ADD int i;
DEL ofstream wf(pmrfile, ios::out | ios::binary);
DEL ofstream wf2(pmexfile, ios::out | ios::binary);
ADD fp2=fopen(pmrfile,"wb+");
ADD fp3=fopen(pmexfile,"wb+");
DEL wf.write((char ) &header, sizeof(head));
ADD for(i=0;i<(int)sizeof(head);i++)
ADD fputc((header.bookname+i),fp2);
DEL wf.write((char ) &input, sizeof(indexz));
ADD for(i=0;i<(int)sizeof(indexz);i++)
ADD fputc((&input.unknown1+i),fp2);
DEL wf2.write((char ) &inputi, sizeof(indexi));
ADD for(i=0;i<(int)sizeof(indexi);i++)
ADD fputc((&inputi.unknown1+i),fp3);
DEL wf.close();
DEL wf2.close();
ADD fclose(fp2);
ADD fclose(fp3);
So not a big deal, since the modified version works fine under both linux and wine.
Don't have a real windows machine handy, so perhaps it would find those files.
By comparison the ming program is about 4 times the size of the linux one.
25888 Aug 28 15:58 txtpmry
2961 Aug 28 13:57 txtpmry.cpp
103634 Aug 28 13:57 txtpmry.exe
Thanks for the quick reply.
The easiest way is to either copy them to the same directory as the exe, or
to add their path to your WINEPATH variable.
On Fri, Aug 27, 2021, 20:01 Michael Setzer II msetzerii@users.sourceforge.net wrote:
Went to a windows 7 machine, and searched for the file on it, and didn't find the dll files on it, so they must not be standardly installed files. Also, looked in winetricks and it has options to install dll files, but none of them is listed as an option?
Since I was able to rewrite code to work in a way that doesn't have this issue will stick with it.
Works great with linux compiler with no issues, and all the other programs worked fine with the ming compiler with no changes. Just this one. Have some others that don't use linux that might want to have these programs, so use wine to test it, and previous stuff has also worked on real windows as well.
Will have to search for those libraries dll files on web..
Thanks again for you time, was just hoping others had had this issue, and a complete solution was out there.
Have a great day, and be safe.
They come with the compiler that you installed
On Sat, Aug 28, 2021 at 3:59 PM Michael Setzer II
msetzerii@users.sourceforge.net wrote:
Seem to have found a fix, but haven't done full test, but program compiles and runs after doing this.
dnf install pthread
Originally, the compat and -static files where not orginally installed, but now this is what it shows.
Last metadata expiration check: 1:57:08 ago on Sun 29 Aug 2021 06:28:31 AM ChST.
Package compat-libpthread-nonshared-2.32-10.fc33.x86_64 is already installed.
Package mingw32-winpthreads-7.0.0-2.fc33.noarch is already installed.
Package mingw32-winpthreads-static-7.0.0-2.fc33.noarch is already installed.
Package mingw64-winpthreads-7.0.0-2.fc33.noarch is already installed.
Package mingw64-winpthreads-static-7.0.0-2.fc33.noarch is already installed.
Still need to check that results are the same between versions of program on linux and with wine.
Static libraries aren't dll's. I don't know what the compat package is.
On Sat, Aug 28, 2021 at 6:31 PM Michael Setzer II
msetzerii@users.sourceforge.net wrote:
I have never installed the ming compiler in either windows or in wine. Only have the program installed in the standard linux.
That would seem strange that you would have to install the compiler on any machine that wanted to run the exe program to have the dll files available??
With the other programs I have and the one after modification I can copy the exe file to any windows machine and they run without needing other dll files to be copied. Perhaps that is why they are 4+ times the size of the g++ compiled programs?
In all the other cases, the exe files seem to be standalone. With linux programs I can run ldd to check if any of the linked libraries might be missing.
I'm also not sure why adding those packages causes it to create exe files that run under wine with none of the errors. Perhaps it has it generate code into program versus putting in library/dll calls??
The 3 packages added where not included with the regular install of the ming compilers on inux??
This is what shows for ming and the pthread.
rpm -qa | grep "mingw|pthread"
mingw64-winpthreads-7.0.0-2.fc33.noarch
mingw64-headers-7.0.0-2.fc33.noarch
mingw32-crt-7.0.0-2.fc33.noarch
mingw64-binutils-2.34-8.fc33.x86_64
mingw32-wine-gecko-2.47.2-1.fc33.noarch
mingw64-crt-7.0.0-2.fc33.noarch
mingw-binutils-generic-2.34-8.fc33.x86_64
mingw32-headers-7.0.0-2.fc33.noarch
mingw32-binutils-2.34-8.fc33.x86_64
mingw64-wine-gecko-2.47.2-1.fc33.noarch
mingw32-winpthreads-7.0.0-2.fc33.noarch
mingw-filesystem-base-118-1.fc33.noarch
mingw32-filesystem-118-1.fc33.noarch
mingw64-filesystem-118-1.fc33.noarch
mingw64-cpp-10.3.1-2.fc33.x86_64
mingw64-gcc-10.3.1-2.fc33.x86_64
mingw64-gcc-c++-10.3.1-2.fc33.x86_64
mingw64-gcc-objc-10.3.1-2.fc33.x86_64
mingw32-cpp-10.3.1-2.fc33.x86_64
mingw32-gcc-10.3.1-2.fc33.x86_64
mingw32-gcc-c++-10.3.1-2.fc33.x86_64
mingw64-gcc-objc++-10.3.1-2.fc33.x86_64
mingw64-gcc-gfortran-10.3.1-2.fc33.x86_64
compat-libpthread-nonshared-2.32-10.fc33.x86_64
mingw64-winpthreads-static-7.0.0-2.fc33.noarch
mingw32-winpthreads-static-7.0.0-2.fc33.noarch
Don't do a lot of programming with ming or on windows. Don't know if all three of the last 3 needed to be added to make it work, but it does. Perhaps will try removing the last two, since they seem to be for version 7 versus version 10 like most of the rest?
Again, thanks for the help.
On Sat, Aug 28, 2021, 16:58 Michael Setzer II msetzerii@users.sourceforge.net wrote:
The rest of this message and your other several indicate that you need to
seek help from a basic software development forum. Perhaps try joining
c++-general on libera chat.
Another little update.
Install codeblocks with ming under wine and recompiled the programs.
Ran into a few issues. Doesn't like the include file of the linux under the wine??
//#include <cstdio>
//#include <cstring>
//#include <cctype>
//#include <cstdlib>
//#include <time.h>
//using namespace std;</time.h></cstdlib></cctype></cstring></cstdio>
include <stdio.h></stdio.h>
include <string.h></string.h>
include <stdlib.h></stdlib.h>
include <time.h></time.h>
include <ctype.h></ctype.h>
Had copied code and pasted into codebuilder and saved it. Assumed it was saving as .cpp, but it was saving it as .c, and that is why it was making the changes necessary.
Had tried the code in linux codebuilder and it compiled with no changes needed.
Then went back to the windows codebuiler, and recompiled using source files with .cpp, and they compiled with no changes.
Did notice that the .cpp code produces larger exe files.
from .cpp from .c % .c/.cpp
changex.exe 86,263 55,921 64.83%
fixf2b6.exe 132,882 67,140 50.53%
fixzzall.exe 140,346 73,726 52.53%
testc99.exe 85,817 55,919 65.16%
testpmrall.exe 85,705 57,190 66.73%
txtpmr.exe 86,704 58,194 67.12%
So, about twice as large.
Have run all 3 versions, and outputs are identical.
win directory had the code compiled with linux ming
win2 directory had the .c code compiled with codeblocks with ming
win3 directory had the .cpp code compiled with codeblocks with ming.
So, learning a little bit more.
Started on an IBM 1130 with 4K of Ram back in mid 70s, so lots of changes over the years.
Thanks once again.
First, there was no issue with the code, since all versions worked fine under linux compiler.
It was just issues with messages when cross-compiling the code for windows. Seems some C functions require extra dll support files. I was able to rewrite functions to use other code like fopen to access files, and then use a loop to use fprintf to write binary data.
Have tested all of those programs, and they all run fine on a real windows 10 machine with no additional dll files. Didn't try the compile that used the other functions.
Did note that I use poppler to extract data from pdf file. There windows version does include some of the dll files, so assume they must have functions that need those dlls, so they are included.
Was interesting, but it seems to work fine. As mentioned. The code produced in windows versus produced in linux for windows is a little smaller.
But got a solution that works well, and requires no additional dll files to be packaged.
Thanks again.