|
|
|
|
|
|
Re: Include Header files in Eclipse [message #1861031 is a reply to message #1861004] |
Thu, 14 September 2023 19:37 |
Bob Slotpole Messages: 3 Registered: September 2023 |
Junior Member |
|
|
Hi, do you know how to add a shared library on windows 10 in eclipse for C?
Here's what I've tried to do:
On Windows 10, using eclipse for c projects I have installed the MinGW compiler. I've been able to add a static library (*.h, *.c files). I can't for some reason get a shared library to work.
I notice that for my shared library I generate a *.o file and a *.dll file but I am not creating a *.so file.
Here are the steps I'm taking:
1) open eclipse in new workspace
2) create a new c project
a) project name ->SharedLib
b) project type -> shared Library -> empty project
c) toolchain -> MinGW GCC
3) In SharedLib folder
a) create test.h (header file) and test.c (source file)
test.h
#ifndef TEST_H_
#define TEST_H_
void test_print(void);
#endif /* TEST_H_ */
test.c
#include <stdio.h>
void test_print(void){
printf("we have lift off");
}
4) build Sharedlib
a) creates Binaries -> libSharedLib.dll
5) create new c project Exec
a) empty project
b) add source file main.c
main.c
#include <stdio.h>
#include "test.h"
int main(void){
printf("we are on the launch pad");
test_print();
}
6) go into properties of Exec->Paths and Symbols->references
a) choose SharedLib, apply and close
7) build all and then run
I have no error messages and no output. the only thing it says is:
<terminated>(exit value: -1,073,741,515)Exec.exe[C/C++ Application]
D:\workplace3\Exec\Debug\Exec.exe(9/14/23,3:05pm)
Could really use some help getting this to work.
The goal is to get this shared library automatically included in all my c projects
[Updated on: Thu, 14 September 2023 19:57] Report message to a moderator
|
|
|
Re: Include Header files in Eclipse [message #1861051 is a reply to message #1861031] |
Fri, 15 September 2023 18:22 |
Tauno Voipio Messages: 742 Registered: August 2014 |
Senior Member |
|
|
This is actually an off-topic for Eclipse, it is about installing a shared library for use with MinGW.
A MinGW forum may be better for a discussion.
Sorry, I do not have a working Windows installation to check. Last one was a XP not more activated.
My guess is that you have to introduce the DLL to Windows.
--
Tauno Voipio
|
|
|
Powered by
FUDForum. Page generated in 0.03456 seconds