-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking static libraries #92
Comments
i have a static library .a file that I created, I want to add it to another project, what should I do? |
I tried to do that, but I still have issues, as I mentioned before I need to link the lib.a file in this case libSignalStatisticsLibNihar.a file and the header file to my executable, even if it means to copy both the .hpp and the .a to the executable folder, can you help me with it? |
Your build went perfectly. And since it is a static library it will be included in your exe file. What might be missing is the compiler's run-time library (DLL). Depending if you are using g++ on windows through cygwin or mingw different reasons might be the case. Can you run the exe in a command prompt window. If it is cygwin, does it run in cygwn's bash, if it you are using mingw can you run it in a regular command prompt. You might need to add the compiler's runtime DLL's location to your path. I remember from 10+ years ago, it was recommended for Cygwin users to copy the cygwin DLL into the WINDOWS directory to have it always available. |
I think there might be something else, is there a way to use just the header and the archive of the library and hide the implementation? |
So, your program linked just fine, but does neither run from Cevelop nor from the command line. did your test your compiler's installation on your windows computer by itself, e.g. by compiling a simple hello world c++ program with it. if that does run, then there might be something. However, to further diagnose, I suggest that you provide more information about your windows and g++ setup, because the problem definitely does not seem to be rooted in Cevelopl, but in your underlying compilation/execution setup. You are using the 32 bit command prompt. May be your program was compiled for 64 bit.
Otherwise, everything is just speculation. BTW, you should have provided all that information when you initially filed the bug |
I am able to compile and run hello.cpp program
…On Thu 7 Mar, 2019, 12:05 PM Peter Sommerlad, ***@***.***> wrote:
So, your program linked just fine, but does neither run from Cevelop nor
from the command line.
did your test your compiler's installation on your windows computer by
itself, e.g. by compiling a simple hello world c++ program with it. if that
does run, then there might be something.
However, to further diagnose, I suggest that you provide more information
about your windows and g++ setup, because the problem definitely does not
seem to be rooted in Cevelopl, but in your underlying compilation/execution
setup.
You are using the 32 bit command prompt. May be your program was compiled
for 64 bit.
1.
What Windows Version are you using (version, 32 or 64 bit)
2.
What compiler (version) are you using for compilation (cygwin/mingw,
32/64bit, version of g++)?
3.
Can you compile and run a minimal C++ program?
Otherwise, everything is just speculation.
BTW, you should have provided all that information when you initially
filed the bug
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#92 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Ar1co6DeBCXVBwNdQM1tQxS-W0k5WzuNks5vUUbogaJpZM4bh2ZI>
.
|
Sorry, I will provide all the information in the future
On Thu 7 Mar, 2019, 12:07 PM Nihar Turumella, <nturumel@andrew.cmu.edu>
wrote:
… I am able to compile and run hello.cpp program
On Thu 7 Mar, 2019, 12:05 PM Peter Sommerlad, ***@***.***>
wrote:
> So, your program linked just fine, but does neither run from Cevelop nor
> from the command line.
>
> did your test your compiler's installation on your windows computer by
> itself, e.g. by compiling a simple hello world c++ program with it. if that
> does run, then there might be something.
>
> However, to further diagnose, I suggest that you provide more information
> about your windows and g++ setup, because the problem definitely does not
> seem to be rooted in Cevelopl, but in your underlying compilation/execution
> setup.
>
> You are using the 32 bit command prompt. May be your program was compiled
> for 64 bit.
>
> 1.
>
> What Windows Version are you using (version, 32 or 64 bit)
> 2.
>
> What compiler (version) are you using for compilation (cygwin/mingw,
> 32/64bit, version of g++)?
> 3.
>
> Can you compile and run a minimal C++ program?
>
> Otherwise, everything is just speculation.
>
> BTW, you should have provided all that information when you initially
> filed the bug
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#92 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/Ar1co6DeBCXVBwNdQM1tQxS-W0k5WzuNks5vUUbogaJpZM4bh2ZI>
> .
>
|
can you do that from Cevelop? Or only on the command line? Again, which g++ are you using? |
Thank You, I can run a sample file from cevelop, not from my terminal, I am sing mingw 0.6.3, is there any way I can upload my executable project folder and have someone help me please? |
The problem you are having is definitely a 32/64 bit problem, if my google foo is not wrong and has nothing to do with Cevelop. If you can not provide the information I asked for, I can not be of further help. I won't debug your executable (which I doubt is the problem). I expect everything you are running is 64bit. But may be the option set in your mingw compilation targets 32 bit and such a program might not run on your system or vice versa. |
we usually recommend our students to use https://nuwen.net/mingw.html installation. However, this requires some adjustments (see cevelop FAQ), so that Eclipse CDT detects the compiler. current is Version 6. if your version number is correct it seems very old, it might be just that the .exe generated is not compatible with your windows version. |
Thank you for your help, I understand as, I am operating on a 64 bit os, and I am using the mingw 0.6.3, I will take a look at the link you sent me |
Expected Behavior
Please tell us what you expected to happen. If possible, include some sample code for us to reproduce what you're seeing.
Actual Behavior
What happened instead? If you have a screenshot or stack trace of the error, please attach it.
Cevelop Version, Operating System and Compiler
The more we know about your setup, the easier it will be for us to reproduce the problem.
The text was updated successfully, but these errors were encountered: