The problem I (we) have is that vector is wiped out when the application enters main. You can see better with the links below
Simple (Recreated problem)
Google drive folder where i have simple version of the problem. There is windows exe compiled with x86_64-w64-mingw32-g++ and linux .out compiled with gcc(g++) on ubuntu 16.10, .out version does not have any issue. Anybody could open the link and see the output.
mingw -v -> 6.2.0 20160822.
g++ -v -> 6.2.0 20161005
Stack overflow (Real problem). Same configuration as above.
I also have compiled the "Simple" files on Windows 10 with mingw - 5.3.0 and it fails.
output in my terminal :
nikola@nikola:~/Desktop/asd$ ./a.out
push size : 1
constructor size : 1
main : 1
nikola@nikola:~/Desktop/asd$ wine a
push size : 1
constructor size : 1
main : 0
Thanks!
We do not support
x86_64-w64-mingw32-g++
; it is not a product of this project. However, if by "mingw-5.3.0
on Windows-10" you mean the version of GCC which we do provide, and you would like us to follow this up, then please attach a SSCCE directly to this ticket; linking to a potentially "here today, gone tomorrow" example on google drive, (and to a StackOverflow reference which has already disappeared), may be detrimental to the long term integrity of ticket information, and is therefore not acceptable.yes, mingw-5.3.0 is the version of gcc on my windows 10. I deleted the stackoverflow post because it wasn't complete, sorry.
I had problems adding attachment to this post so here is the code the will reproduce the problem, i got 405 Method Not Allowed The method GET is not allowed for this resource while posting with attachment.
foo.h
foo.cpp
source.cpp
Later i found that vector isn't the only faulty container but also list (maybe other containers) which provides segmentation fault.
Program compiled with gcc on linux and visual studio compiler on windows does not produce this error
Last edit: Nikola Lozanovski 2016-11-24
No worries. IMO, StackOverflow is a waste of time anyway ... you're more likely to get uninformed nonsense from clueless reputation seekers, than any informed reply.
How did you try to add it? I've never had any problem adding attachments, using the "Add attachments" link, next to the "Post" button and "Cancel" link, below the message editing pane. (I assume you were logged in to SourceForge).
Yes, i tried the way you describe, are .exe files filtered? I had few of them.
huh, adding rar file as attachment worked. Anyway there you will find cpp, header files and windows and linux binaries. You can compile the binaries yourself or use the existing ones.
I found out that if the cpp files are compiled into object files and then those object files compiled into executable there would be no problem, it will be working fine. Hmmm strange.
Strange indeed. FWIW, I was unable to extract anything useful from your RAR archive, but I copied and pasted your sources into
foo.h
,foo.cpp
, andbar.cpp
, then cross-compiled it, and ran it underwine-1.4.1
(old, I know, but WJFFM):Is this not the outcome you expect? I'm no C++ expert, but it looks right to me. (BTW, the
rstty
is there to circumvent awine
bug, which leaves my.inputrc
configuration in some weird, and undesirable state; it's just abash
alias forless -fE /dev/null
, defined in my.bashrc
).Sorry for late reply i had exams.
I don't know what exactly is happening on my machines, on my windows machine sometimes works sometimes does not, main should be 1 like
main : 1
to work. However i found solution for me and it is to compile to object file like object.o and then create executable file from these object files. We cannot reproduce the problem where it is not working for everybody.Thank you anyway !