Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse won´t compile
Eclipse won´t compile [message #1803860] Tue, 12 March 2019 14:52 Go to next message
Thomas Littmann is currently offline Thomas LittmannFriend
Messages: 6
Registered: March 2019
Junior Member
Hello,

I am a University Student of some Engineering class and have to take an IT Course where we Code C and C++ in Eclipse.

I had a guide on how to install Eclipse Photon, with GIT implementation etc. and Cygwin on Windows, since we use a GIT repository.

Since I am done with installing all of that, I tried to run an easy program in order to test, if my Eclipse works.

But there is one error:

10:11:02 **** Build of configuration Default for project TEST ****
make WSGDPINCLUDES= WSGDPLIBS= all
gcc -Wall -W -Wextra -std=c99 -pedantic -O3 -I include/ -I ../include -I drivers/test.c -L ../lib -L -lgdptools -lgdpc -lX11 -lpthread -lm -o drivers/test
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lgdpc
collect2: error: ld returned 1 exit status
make: [Makefile:50: drivers/test] Error 1 (ignored)

10:11:02 Build Failed. 1 errors, 0 warnings. (took 408ms)

You can also see it in the Picture which I have attached.(cant post links)


This lgdpc is supposed to be one of the 3 libraries we got from our university I think.

Do you have any idea what the problem might be or how to evaluate what the problem might be?

If there are any questions, I am happy to answer them.

I would be really thankful for an answer.
Re: Eclipse won´t compile [message #1803862 is a reply to message #1803860] Tue, 12 March 2019 15:27 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
It's apparently compiling OK.
You are getting a link error.
Specifically, the linker can't find libgdpc.
You either don't have it installed or haven't given the proper directory containing it.
Did you really want the empty -L option on the link?
Re: Eclipse won´t compile [message #1803863 is a reply to message #1803862] Tue, 12 March 2019 15:50 Go to previous messageGo to next message
Thomas Littmann is currently offline Thomas LittmannFriend
Messages: 6
Registered: March 2019
Junior Member
thank you for your answer!

where do I give the Directory containing it? Can you please explain where to find the Setting I can Change it with in Eclipse? Sorry, but I am new to it and only got a guide on how to install it which I followed and also english is not my main language.
And about your question, I do not even have any idea, what the empty -L option is to be honest. I am quite a noob :D I am really sorry for not being really helpful with my answers, but already thank you a lot
Re: Eclipse won´t compile [message #1803873 is a reply to message #1803863] Tue, 12 March 2019 21:11 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
The linker options are set in
Project --> Properties --> C/C++ Build --> Settings --> GCC C++ Linker --> Libraries

You'll have to search for the library.
Since you're using cygwin you can use the find command
Something like
find /usr/lib -name "libgdpc.*" or
find /usr -name "libgdpc.*" or
find <some other dir> -name "libgdpc.*" or
find <project>/Default -name "libgdpc.*" or
find <project> -name "libgdpc.*"

A side note: -L../lib will search a directory relative to where make is executed (its working directory).
Which looks like the Default configuration directory for your project.
Apparently the library isn't in that directory though or it's not correctly described.
It's usually best to use absolute paths instead of relative ones.
Maybe the -L should be -L.? But it's still relative to the Default directory.


[Updated on: Tue, 12 March 2019 21:29]

Report message to a moderator

Re: Eclipse won´t compile [message #1803899 is a reply to message #1803873] Wed, 13 March 2019 11:07 Go to previous messageGo to next message
Thomas Littmann is currently offline Thomas LittmannFriend
Messages: 6
Registered: March 2019
Junior Member
Thank you for your effort, sadly my it does not find anything like this I think.

Now I tried to install Eclipse on Linux.
I wrote an easy code and compiled it without problems, but I do not get a file which I can execute and I can also not run it via the green run button.

https://i.imgur.com/iWPM0W6.png

Do you have any idea what the problem might be?
Re: Eclipse won´t compile [message #1803906 is a reply to message #1803899] Wed, 13 March 2019 12:52 Go to previous message
Thomas Littmann is currently offline Thomas LittmannFriend
Messages: 6
Registered: March 2019
Junior Member
I found out, that I used .h instead of .c
If I use .c in drivers it is the same as lgdpc missing again
Previous Topic:Google Play (Libpng Vulnerability) HELP + REWARD
Next Topic:How to verify linked library?
Goto Forum:
  


Current Time: Fri Apr 26 23:52:07 GMT 2024

Powered by FUDForum. Page generated in 0.03071 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top