adding -static-libstdc++

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

adding -static-libstdc++

Papa
This is a two part question:
How do I create a static executable [-static-libstdc++] and how do I  
inform the linker of it in Netbeans?

Thanks in advance.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: adding -static-libstdc++ - Addendum

Papa
I have research this topic and I found a probable solution, it is to add
'-static-libgcc -static-libstdc++' to "Project -> Properties ->
Categories::Linker -> Compilation Line::Additional Options".
However, after recompiling, I proceeded to copy the new executable to
the second computer, which does not have neither gcc nor any MinGW-W64
applications installed on it, when I ran the program a message box pops
up saying that the application was unable to start correctly (0x000007b)
  bla, bla, bla.

I'd like to run any of the C++ programs I compile in one computer and
run it on a second one, even if the second computer does not have
MinGW-W64 installed on it. AFAIK, there are two ways I can go about it,
one is to copy the required dlls in to the second computer, which I did
to no avail, and, the other option is to compile statically linking the
program, which is not working either.

If anyone here knows how to do it I would appreciate some advice or if
there is a tutorial please point it out for me.

Thanks in advance.


On 2017-07-12 12:48, [hidden email] wrote:
> This is a two part question:
> How do I create a static executable [-static-libstdc++] and how do I
> inform the linker of it in Netbeans?
>
> Thanks in advance.
Loading...