I have used eclipse extensively in the past and it works fine. Your comment re double quotes versus angle brackets is correct. But that (and all the other issues) are nothing to do with eclipse, but about how the compiler search paths work.
SOLVED case closed
As expected - pkg-config DOES NOT integrate with just any Eclipse version / release.
I got it working as expected in 2018-09!
Sorry for wasting everybody time.
It is my understanding that the characters enclosed in backticks execute and the result is passed as option(s) to the GCC.
`pkg-config --cflags gtk+-3.0`
I have added the backticks string to both GCC compiler and linkers options and still getting the usual "undefined reference" error.
The tutorial does not explain much about implementing this backticks string.
(Should it add library -l refernces ??)
I woudl appreciate references or comments on this and suggestions how to actually resolve this issue.
I am enclosing the complier / liker verbose output for information, and I am sorry to take so much bandwidth with it.
I do not like blaming problems elsewhere, BUT,
this problem is really not related to using backtick syntax. After some trials it works as expected.
There were few other problems AFTER I updated to latest version of IDE. So I down paddled to previous, working release and imported the GTK project there.
Just build a clean GTK project and it works as expected.
I am sorry for wasting everybody time with a problem related to flaky IDE.
Thanks, but I know what is does - look at all the -I in the attached file. I think g++ also needs -l - libraries or library - for GTK.
But I am not sure how to do it if I need more.
Can I use similar method
as pkg-config to get -l /-L ?
OK, putting wrong option may be one of the issues.
I did put BOTH --cflag and --libs in complier and linker options. I also tried
this combined syntax
`pkg-config --cflags --libs gtk+-3.0`
The compiler and linker verbose outputs looks OK ( too big to repost here ) , BUT the unresolved error is apparently different issue.
I am enclosing what I posted in Eclipse forum here:
This error has been posted years ago and there was NO SOLUTION,
See this old post
[b]However, this only solved the issue of adding all the header files manually. Now I encounter errors like "Function 'G_CALLBACK' could not be resolved". I tried to compile my source-code (the first example of the GTK3 tutorial) in a terminal using the simple "gcc `pkg-config --cflags gtk+-3.0` -o example-0 First_GTK_test.cpp `pkg-config --libs gtk+-3.0`" command and it works. So the issue must be an Eclipse setting issue.[/b]
Every GTK tutorial is same - download / install GTK and run sample code in your editor...
It is up to the user to figure out how to option complier / linker to "include sources and link libraries"
Adding `pkg-config --cflags --libs gtk+-3.0` should work, I get expected verbose output , but it does not.
Even after that is done the compilation will fail because #include <gtk gtk.h=""> is unresolved.
Here is an output of whereis
z@z-desktop $ whereis gtk.h
Any help woudl be appreciated
End of Eclipse post.
I am really at lost where the reference
<gtk gtk.h=""> came from and unsure how to find gtk.h manually - where ?
How did you pick that up? I copied the entire output posted at the top of this thread, and
a) a search for "undefined" turned up nothing, and
b) as currently shown, the compile completes successfully!!
Doing a quick perusal of the rest of the thread, I didn't notice any further mention of exactly what was undefined.
At this point, I have no idea what the problem is, since it looks to me like the compile/link is correct - -lgtk-3 is in the link options. Maybe Eclipse is doing something odd.
#include /usr/include/gtk-3.0/gtk/gtk.h // edited so it show
int main (int argc, char *argv)
cout << "WINDOW sample code" << endl; // prints
/* Create the main, top level window */
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
And here is the tail of the compile / link process
./src/GTK_WIKI.o: In function `main':
/media/z/DEV_COPY_LABEL/ECLIPSE_FOLDER/2020_228/work_228/GTK_WIKI/Debug/../src/GTK_WIKI.cpp:49: undefined reference to `gtk_window_new'
collect2: error: ld returned 1 exit status
makefile:45: recipe for target 'GTK_WIKI' failed
make: *** [GTK_WIKI] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
I need to put code from my MFC app into a C++ app for iPad. And I have read a lot to figure out what should I use to develop such a thing. Can I call your experience in order to guide me what kind of framework to use for that ? I thought the shortest way is to use a virtual machine, but I don't think that it would be possible to use virtual machine on a iPad ...
I don't developed any app for MAC OS and any extra information regarding this is useful to me.
I do not need ffplay.exe because i downloaded FFMPEG dev and i have written my own player program Which is based on FFMPEG! with QT & C++.
I dont want use ffplay.exe that exist static FFMPEG Folder. .
I want decrypt and play Encrypted File in my player program Through Programing code.
Now how to decrypt encrypted files using FFMPeg API with C++ Programing?
I need to debug some code executing on top of FreeRTOS that runs on an embedded ARM processor and I have no knowledge of FreeRTOS and I was hoping someone here could please help me. Image there are two threads in the entire code, one high-priority communication bus driver and one low-priority application thread. Whenever the application wants to write, it queues a struct onto a queue and when the communication driver sees that there is a struct in the queue, it pulls the struct out and starts writing over the communication bus according to the instructions in the struct. Now, let's assume the application first wants to write 1 byte and then shortly thereafter wants to write 2 bytes and the bytes to write are located on the stack and NOT in static variables/arrays. What the recommended way to handle this? Clearly the 2nd struct would be 1 byte larger than the 1st struct, but they both need to go into the same queue.
modified 12-Jul-20 16:14pm.
Last Visit: 31-Dec-99 18:00 Last Update: 20-Apr-21 4:45