I am on with trying to compile a simple GTK+ Hello World app on windows. I am following a tutorial from this url:
http://pandhare0.tripod.com/#mini-Tutorial
The contents of my HelloWorld.c is as follows and also taken from a wikipedia example:
#include <gtk/gtk.h>
int main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *label;
gtk_init (&argc, &argv);
/* create the main, top level, window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
/* give it the title */
gtk_window_set_title (GTK_WINDOW (window), "Hello World");
/* Connect the destroy signal of the window to gtk_main_quit
* When the window is about to be destroyed we get a notification and
* stop the main GTK+ loop
*/
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
/* Create the "Hello, World" label */
label = gtk_label_new ("Hello, World");
/* and insert it into the main window */
gtk_container_add (GTK_CONTAINER (window), label);
/* make sure that everything, window and label, are visible */
gtk_widget_show_all (window);
/* start the main loop, and let it rest there until the application is closed */
gtk_main ();
return 0;
}
I have followed the instructions to generate the build bat file and the contents of which are below:
path C:\MinGW\bin;C:C:\gtk_2_22_x64\lib\%path%
gcc -Wall -g %1 -o %2 -mno-cygwin -mms-bitfields -IC:C:\gtk_2_22_x64\include\gtk-2.0 -IC:C:\gtk_2_22_x64\lib\gtk-2.0\include -IC:C:\gtk_2_22_x64\include\atk-1.0 -IC:C:\gtk_2_22_x64\include\cairo -IC:C:\gtk_2_22_x64\include\gdk-pixbuf-2.0 -IC:C:\gtk_2_22_x64\include\pango-1.0 -IC:C:\gtk_2_22_x64\include\glib-2.0 -IC:C:\gtk_2_22_x64\lib\glib-2.0\include -IC:C:\gtk_2_22_x64\include\pixman-1 -IC:C:\gtk_2_22_x64\include -IC:C:\gtk_2_22_x64\include\freetype2 -IC:C:\gtk_2_22_x64\include\libpng14 -LC:C:\gtk_2_22_x64\lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl
%2
I have the MinGW inside my environment path. When I run the following command inside my command prompt:
gtkcmd.bat HelloWorld.c HelloWorld.exe
I get the following output:
C:\gtk+_compilation>gtkcmd.bat HelloWorld.c HelloWorld.exe
C:\gtk+_compilation>path C:\MinGW\bin;C:C:\gtk_2_22_x64\lib\C:\MinGW\bin;C:C:\gt
k_2_22_x64\lib\C:\MinGW\bin;C:C:\gtk_2_22_x64\lib\C:\MinGW\bin;C:C:\gtk_2_22_x64
\lib\C:\MinGW\bin;C:C:\gtk_2_22_x64\lib\C:\MinGW\bin;C:\gtk_2_22_x64\lib\C:\MinG
W\bin;C:\gtk_2_22_x64\lib\C:\Program Files\Common Files\Microsoft Shared\Windows
Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windo
ws\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPower
Shell\v1.0\;C:\Program Files\Dell\Dell Wireless WLAN Card;c:\Program Files (x86)
\Common Files\Roxio Shared\10.0\DLLShared\;c:\Program Files (x86)\Common Files\R
oxio Shared\DLLShared\;C:\Program Files\TortoiseSVN\bin;c:\Program Files (x86)\M
icrosoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Windows Live\Shared;C:
\Program Files (x86)\IronPython 2.7;c:\Program Files (x86)\Microsoft ASP.NET\ASP
.NET Web Pages\v1.0\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\MinGW\bin;C:\gt
k_2_22_x64\bin;C:\gtk_2_22_x64\lib
C:\gtk+_compilation>gcc -Wall -g HelloWorld.c -o HelloWorld.exe -mno-cygwin -mms
-bitfields -IC:C:\gtk_2_22_x64\include\gtk-2.0 -IC:C:\gtk_2_22_x64\lib\gtk-2.0\i
nclude -IC:C:\gtk_2_22_x64\include\atk-1.0 -IC:C:\gtk_2_22_x64\include\cairo -IC
:C:\gtk_2_22_x64\include\gdk-pixbuf-2.0 -IC:C:\gtk_2_22_x64\include\pango-1.0 -I
C:C:\gtk_2_22_x64\include\glib-2.0 -IC:C:\gtk_2_22_x64\lib\glib-2.0\include -IC:
C:\gtk_2_22_x64\include\pixman-1 -IC:C:\gtk_2_22_x64\include -IC:C:\gtk_2_22_x64
\include\freetype2 -IC:C:\gtk_2_22_x64\include\libpng14 -LC:C:\gtk_2_22_x64\lib
-lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lp
angocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -
lgthread-2.0 -lglib-2.0 -lintl
HelloWorld.c:1:22: fatal error: gtk/gtk.h: No such file or directory
compilation terminated.
C:\gtk+_compilation>HelloWorld.exe
'HelloWorld.exe' is not recognized as an internal or external command,
operable program or batch file.
C:\gtk+_compilation>
Previously I had tried, strictly what the tutorial said, and used the / in the path statements as opposed to the full paths I now use. When I did use the / though it could not link anything. Every GTK statement returned an undefined error. So I have stayed with using the Full path in the header and linkers statements in the command line. As you can see from the above, it cannot find the gtk/gth.h header. This confuses me as I can clearly see the paths for such inside the command line arguments.
Any help is greatly appreciated.
Cheers,
Andrew
UPDATE:
Ok - I did screw up the bat file - daft mistakes but after correcting these inline with an answer below I now have the following bat file:
path \MinGW\bin;C:\gtk_2_22_x64\lib\%path%
gcc -Wall -g %1 -o %2 -mno-cygwin -mms-bitfields -IC:\gtk_2_22_x64\include\gtk-2.0 -IC:\gtk_2_22_x64\lib\gtk-2.0\include -IC:\gtk_2_22_x64\include\atk-1.0 -IC:\gtk_2_22_x64\include\cairo -IC:\gtk_2_22_x64\include\gdk-pixbuf-2.0 -IC:\gtk_2_22_x64\include\pango-1.0 -IC:\gtk_2_22_x64\include\glib-2.0 -IC:\gtk_2_22_x64\lib\glib-2.0\include -IC:\gtk_2_22_x64\include\pixman-1 -IC:\gtk_2_22_x64\include -IC:\gtk_2_22_x64\include\freetype2 -IC:\gtk_2_22_x64\include\libpng14 -LC:\gtk_2_22_x64\lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl
%2
After this I now get the following errors from the compilation:
C:\Users\REA_AN~1\AppData\Local\Temp\cclrbtyP.o: In function `main':
C:\gtk+_compilation/HelloWorld.c:8: undefined reference to `gtk_init_abi_check'
C:\gtk+_compilation/HelloWorld.c:11: undefined reference to `gtk_window_new'
C:\gtk+_compilation/HelloWorld.c:14: undefined reference to `gtk_window_get_type
'
C:\gtk+_compilation/HelloWorld.c:14: undefined reference to `g_type_check_instan
ce_cast'
C:\gtk+_compilation/HelloWorld.c:14: undefined reference to `gtk_window_set_titl
e'
C:\gtk+_compilation/HelloWorld.c:20: undefined reference to `gtk_main_quit'
C:\gtk+_compilation/HelloWorld.c:20: undefined reference to `g_signal_connect_da
ta'
C:\gtk+_compilation/HelloWorld.c:23: undefined reference to `gtk_label_new'
C:\gtk+_compilation/HelloWorld.c:26: undefined reference to `gtk_container_get_t
ype'
C:\gtk+_compilation/HelloWorld.c:26: undefined reference to `g_type_check_instan
ce_cast'
C:\gtk+_compilation/HelloWorld.c:26: undefined reference to `gtk_container_add'
C:\gtk+_compilation/HelloWorld.c:29: undefined reference to `gtk_widget_show_all
'
C:\gtk+_compilation/HelloWorld.c:32: undefined reference to `gtk_main'
collect2: ld returned 1 exit status
It seems you folowed the instructions to create the .bat file incorrectly somehow - this:
-IC:C:\gtk_2_22_x64\include\gtk-2.0
should be:
-IC:\gtk_2_22_x64\include\gtk-2.0
and similar elsewhere. It looks like your path has got set up incorrectly - this:
path C:\MinGW\bin;C:C:\gtk_2_22_x64\lib\%path%
should be:
path C:\MinGW\bin;C:\gtk_2_22_x64\lib\%path%
or something like it (note C:C: should be C:).
Edit: And now your problem is that the linker cannot find the libraries. The batch file should contain stuff like:
-L/path/to/gtk/libraries
but I don't know how you specify that when you create the file.
Related
I am creating a simple game on linux in C++ and using FMOD for the sound. I recently downloaded the latest FMOD API however when I try to use it I get an undefined reference error. From what I can see with other related questions it usually has to do with where the -lfmod tag is when compiling, however no matter where I put that tag I still encounter problems.
I followed the Debian instructions for downloading the FMOD api and library.
https://wiki.debian.org/FMOD
However when the -I/usr/local/include -L/usr/local/lib didn't work I moved all the library and header files to local folders and adjusted accordingly.
I am using Debian on x86_64 architecture, if that helps.
I also followed these instructions here
https://www.fmod.com/docs/api/content/generated/platform_linux/basics.html
And using ldconfig I was able to verify that I do have libasound.so.2 downloaded in /usr/lib/x86_64-linux-gnu/
I am aware of this answer
C++:Undefined reference to 'FMOD:: X'
but because I am compiling using G++ and the FMOD linux libraries were compiled using GCC I don't think there should be a problem.
Here is the error I get when compiling.
g++ -c audioEngine.cpp
g++ driver.o game.o uiInteract.o uiDraw.o audioEngine.o point.o velocity.o flyingObject.o ship.o bullet.o rocks.o pause.o keyBind.o asteroid.o -I/usr/local/include -L/usr/local/lib -lfmod -lglut -lGLU -lGL
audioEngine.o: In function `Implementation::Implementation()':
audioEngine.cpp:(.text+0x67): undefined reference to `FMOD::Studio::System::create(FMOD::Studio::System**, unsigned int)'
audioEngine.cpp:(.text+0x92): undefined reference to `FMOD::Studio::System::initialize(int, unsigned int, unsigned int, void*)'
audioEngine.cpp:(.text+0xbf): undefined reference to `FMOD::Studio::System::getLowLevelSystem(FMOD::System**) const'
audioEngine.o: In function `Implementation::~Implementation()':
audioEngine.cpp:(.text+0x13b): undefined reference to `FMOD::Studio::System::unloadAll()'
audioEngine.cpp:(.text+0x151): undefined reference to `FMOD::Studio::System::release()'
audioEngine.o: In function `Implementation::advance()':
audioEngine.cpp:(.text+0x2cf): undefined reference to `FMOD::Studio::System::update()'
collect2: error: ld returned 1 exit status
makefile:21: recipe for target 'a.out' failed
make: *** [a.out] Error 1
Here are the problem areas in audioEngine.cpp
In the header file "fmod.hpp" and "fmod_studio.hpp" are included.
Implementation::Implementation()
{
mpStudioSystem = NULL;
AudioEngine::ErrorCheck(FMOD::Studio::System::create(&mpStudioSystem));
AudioEngine::ErrorCheck(mpStudioSystem->initialize(32, FMOD_STUDIO_INIT_LIVEUPDATE, FMOD_INIT_PROFILE_ENABLE, NULL));
mpSystem = NULL;
AudioEngine::ErrorCheck(mpStudioSystem->getLowLevelSystem(&mpSystem));
}
Implementation::~Implementation()
{
AudioEngine::ErrorCheck(mpStudioSystem->unloadAll());
AudioEngine::ErrorCheck(mpStudioSystem->release());
}
void Implementation::advance()
{
vector<ChannelMap::iterator> pStoppedChannels;
for (auto it = mChannels.begin(), itEnd = mChannels.end(); it != itEnd; ++it)
{
bool bIsPlaying = false;
it->second->isPlaying(&bIsPlaying);
if (!bIsPlaying)
{
pStoppedChannels.push_back(it);
}
}
for (auto& it : pStoppedChannels)
{
mChannels.erase(it);
}
AudioEngine::ErrorCheck(mpStudioSystem->update());
}
Here is the relevant part of the makefile
LFLAGS = -I./include -L./lib -lfmod -lglut -lGLU -lGL
###############################################################
# Build the main game
###############################################################
a.out: driver.o game.o uiInteract.o uiDraw.o audioEngine.o point.o velocity.o flyingObject.o ship.o bullet.o rocks.o pause.o keyBind.o asteroid.o
g++ driver.o game.o uiInteract.o uiDraw.o audioEngine.o point.o velocity.o flyingObject.o ship.o bullet.o rocks.o pause.o keyBind.o asteroid.o $(LFLAGS)
The .so library files are in a "lib" folder in the project folder where the makefile is, and the .h and .hpp files are in an "include" folder in the same place.
I realized the answer to this question moments before posting, but I spent enough time trying to figure it out I'm posing anyway for future reference if anyone else follows the Debian instructions and wonders why they get an undefined reference.
If you are including the "fmod_studio.hpp" file you also need to include the fmod studio library. Add -lfmodstudio after -lfmod and provided you have everything else right it will now compile without an undefined reference.
The solution is so obvious I feel like an idiot. Of course if I want fmodstudio I need to include the fmodstudio library! It's like I was flooring the accelerator without an engine then checking the oil.
I'm trying to build libVLC for usage within an Android application (I can't find pre-built libs for all the platforms I am targeting). I am using Ubuntu 16.04.1 LTS server and am following the Android compile instructions and installed the packages mentioned there. I have the NDK r13 and SDK r24.4.1, essentially both freshly downloaded.
I started the process with ./compile.sh -a arm --release -l
Everything seems to compile correctly, but then I end up with linker errors. Here's the output starting from what seems most relevant:
Generating static module list
/home/builder/vlc-build/vlc-android/toolchains/arm/bin/arm-linux-androideabi-nm: libiconv.a: File format not recognized
/home/builder/vlc-build/vlc-android/toolchains/arm/bin/arm-linux-androideabi-objcopy:vlc/build-android-arm-linux-androideabi/modules/.libs/libgnutls_plugin.a(libiconv.a): Unable to recognise the format of file: File format not recognized
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by '/libvncclient', not found
Building NDK
Android NDK: WARNING:jni/Android.mk:vlc: non-system libraries in linker flags: /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libandroid_window_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libadf_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubsdec_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libps_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libkaraoke_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtaglib_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liboldmovie_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libconsole_logger_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libshm_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcompressor_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcroppadd_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libiomx_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libchorus_flanger_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgles2_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liboggspots_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libnormvol_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libstereo_widen_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librtp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liblpcm_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libspatializer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libes_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpostproc_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfps_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdemux_stl_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfreetype_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libttml_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcache_block_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_copy_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libstl_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmemory_keystore_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpva_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libflacsys_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liblogo_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librecord_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libflac_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi420_nv12_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaes3_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtimecode_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdvdread_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubsusf_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcc_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmarq_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libwav_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdecomp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_mpegaudio_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi420_rgb_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liblua_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liba52_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libxml_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcache_read_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdsm_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libyuy2_i422_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libadjust_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libogg_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvhs_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgaussianblur_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libegl_android_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpng_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libts_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librawvideo_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgnutls_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_mpeg4video_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdummy_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsoxr_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtransform_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfile_keystore_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvolume_neon_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubsdelay_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libspeex_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libremap_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_mpegvideo_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvc1_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libinvert_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libftp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_dirac_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libchain_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libinteger_mixer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librotate_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaudio_format_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfile_logger_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmkv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcaf_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libau_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmediacodec_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvdr_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtelx_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcdg_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libg711_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libnfs_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfilesystem_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libnsv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmjpeg_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liblibass_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvpx_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmono_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubsttml_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsyslog_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_hevc_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libadpcm_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsatip_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvmem_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liblive555_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_avparser_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libty_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libhttp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libzvbi_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libedgedetection_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libwave_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcanvas_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libimem_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubstx3g_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsepia_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi420_yuy2_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvobsub_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libyuv_rgb_neon_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgrey_yuv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libscaletempo_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libspdif_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfluidsynth_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdvdnav_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libparam_eq_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgain_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libadaptive_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdemux_cdg_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libupnp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librar_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_mlp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaccess_concat_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcolorthres_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcvdsub_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libnsc_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libxa_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libplaylist_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdemuxdump_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi422_yuy2_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtospdif_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libandroid_audiotrack_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libinflate_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmpgv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libscte18_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libavformat_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libopensles_android_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libflaschen_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libprefetch_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmp4_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libattachment_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libhds_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libugly_resampler_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmod_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfingerprinter_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaraw_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaccess_mms_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libextract_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libyuy2_i420_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libzip_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdiracsys_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsvcdsub_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfreeze_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdvbsub_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libamem_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libscale_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtta_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libblend_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libh26x_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librv32_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libavi_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libequalizer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libandroid_logger_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libudp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libscte27_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libavcodec_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libyuvp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libavio_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfloat_mixer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_vc1_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaiff_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsdp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdeinterlace_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libchroma_yuv_neon_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaccess_realrtsp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libhttps_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librawaud_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libuleaddvaudio_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libswscale_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libasf_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvoc_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgradfun_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtrivial_channel_mixer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmpg123_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaccess_archive_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmicrodns_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librawdv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libhqdn3d_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi422_i420_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libafile_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsimple_channel_mixer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libantiflicker_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_dts_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libheadphone_channel_mixer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsftp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvorbis_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_flac_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librawvid_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libanaglyph_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtcp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtheora_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libspudec_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libopus_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libnuv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdolby_surround_decoder_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_h264_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi420_10_p010_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libimage_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libandroid_native_window_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfolder_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libjpeg_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_mpeg4audio_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubtitle_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_a52_plugin.a /home/builder/vlc-build/vlc-android/vlc/build-android-arm-linux-androideabi/lib/.libs/libvlc.a /home/builder/vlc-build/vlc-android/vlc/build-android-arm-linux-androideabi/src/.libs/libvlccore.a /home/builder/vlc-build/vlc-android/vlc/build-android-arm-linux-androideabi/compat/.libs/libcompat.a -ldvdnav -ldvdread -ldvdcss -ldvdread -ldvdcss -lFLAC -logg -lfluidlite -lvorbisfile -lvorbis -logg -lfreetype -lfribidi -lgnutls /home/builder/vlc-build/vlc-android/vlc/contrib/arm-linux-androideabi/lib/libiconv.a -lgmp -lharfbuzz -lhogweed -lgmp -lnettle -larchive -lass -liconv -lfribidi -lfreetype -lavcodec -lopenjpeg -lgsm -lavutil -lavformat -lopenjpeg -lgsm -lavcodec -lopenjpeg -lgsm -lavutil -lavutil -ldsm -ldvbpsi -ldvdcss -lebml -lmatroska -lebml -lmodplug -lmpg123 -lnfs -lpng16 -lpng16 -lpostproc -lavutil -lssh2 -lgcrypt -lgpg-error -lswscale -lavutil -ltasn1 -lupnp -lthreadutil -lixml -lxml2 -lmicrodns -lnettle -logg -lopus -lprotobuf-lite -lprotobuf -lsoxr -lspeexdsp -lspeex -ltag_c -ltag -ltag -ltheoradec -logg -ltheoraenc -ltheoradec -logg -ltheora -logg -lvorbisenc -lvorbisfile -lvorbis -logg -lvpx -lzvbi -liconv -lpng -lliveMedia -lUsageEnvironment -lBasicUsageEnvironment -lgroupsock -la52 -ljpeg -lavcodec -lebml -llua -lc++abi -landroid_support
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
Android NDK: current module
make: Entering directory `/home/builder/vlc-build/vlc-android/libvlc'
[armeabi-v7a] Compile thumb : vlc <= libvlcjni-modules.c
[armeabi-v7a] Compile thumb : vlc <= libvlcjni-symbols.c
[armeabi-v7a] Compile++ thumb: vlc <= dummy.cpp
[armeabi-v7a] Prebuilt : libc++_shared.so <= <NDK>/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/
[armeabi-v7a] SharedLibrary : libvlc.so
../../modules/lua/vlc.c:219: error: undefined reference to 'config_GetLibDir'
../../modules/lua/vlc.c:229: error: undefined reference to 'config_GetDataDir'
../../modules/lua/libs/configuration.c:110: error: undefined reference to 'config_GetDataDir'
../../modules/arm_neon/volume.c:49: error: undefined reference to 'vlc_CPU'
../../modules/arm_neon/yuv_rgb.c:137: error: undefined reference to 'vlc_CPU'
../../modules/video_filter/deinterlace/deinterlace.c:696: error: undefined reference to 'vlc_CPU'
../../modules/arm_neon/chroma_yuv.c:220: error: undefined reference to 'vlc_CPU'
../../src/misc/threads.c:89: error: undefined reference to 'vlc_addr_timedwait'
../../src/misc/threads.c:148: error: undefined reference to 'vlc_addr_signal'
../../src/misc/threads.c:154: error: undefined reference to 'vlc_addr_broadcast'
../../src/misc/threads.c:173: error: undefined reference to 'vlc_addr_wait'
../../src/misc/threads.c:197: error: undefined reference to 'vlc_addr_timedwait'
../../src/misc/threads.c:148: error: undefined reference to 'vlc_addr_signal'
../../src/misc/threads.c:154: error: undefined reference to 'vlc_addr_broadcast'
../../src/misc/threads.c:148: error: undefined reference to 'vlc_addr_signal'
../../src/misc/messages.c:121: error: undefined reference to 'vlc_thread_id'
../../src/android/thread.c:321: error: undefined reference to 'vlc_addr_broadcast'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [jni/obj/local/armeabi-v7a/libvlc.so] Error 1
make: Leaving directory `/home/builder/vlc-build/vlc-android/libvlc'
ndk-build failed for libvlc
There's a few things worrying in there like the warning about non-system libraries (but isn't that expected since it is a cross-compile?) but they don't seem to connect to the issue.
I can't seem to find anything relevant in Google nor on Stackoverflow (except maybe this question and answer hinting perhaps I should try an older version of the NDK?) as these seem to all be functionality provided by VLC itself. As a result I'm also not sure where to look in the compile process' logs or output to find other hints of things being awry. What else should I post?
I'm rather late to the party but posting anyways.
Package zlib was not found in the pkg-config search path.
Missing dependencies surface as totally irrelevant errors sadly.
I am trying to use GTK3 and WebKitGTK. I am successful at running the following code :
#include <gtk/gtk.h>
#include <webkit2/webkit2.h>
#include <JavaScriptCore/JavaScript.h>
using namespace std;
static void destroyWindowCb(GtkWidget* widget, GtkWidget* window);
static gboolean closeWebViewCb(WebKitWebView* webView, GtkWidget* window);
int main(int argc, char* argv[])
{
// Initialize GTK+
gtk_init(&argc, &argv);
// Create an 800x600 window that will contain the browser instance
GtkWidget *main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(main_window), 800, 600);
// Create a browser instance
WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
// Put the browser area into the main window
gtk_container_add(GTK_CONTAINER(main_window), GTK_WIDGET(webView));
// Set up callbacks so that if either the main window or the browser instance is
// closed, the program will exit
g_signal_connect(main_window, "destroy", G_CALLBACK(destroyWindowCb), NULL);
g_signal_connect(webView, "close", G_CALLBACK(closeWebViewCb), main_window);
// Load a web page into the browser instance
webkit_web_view_load_uri(webView, "http://www.webkitgtk.org/");
// Make sure that when the browser area becomes visible, it will get mouse
// and keyboard events
gtk_widget_grab_focus(GTK_WIDGET(webView));
// Make sure the main window and all its contents are visible
gtk_widget_show_all(main_window);
// Run the main GTK+ event loop
gtk_main();
return 0;
}
static void
destroyWindowCb(GtkWidget* widget, GtkWidget* window)
{
gtk_main_quit();
}
static gboolean
closeWebViewCb(WebKitWebView* webView, GtkWidget* window)
{
gtk_widget_destroy(window);
return TRUE;
}
And the following cmake list :
cmake_minimum_required(VERSION 3.3)
project(HttpsMock)
# Use the package PkgConfig to detect GTK+ headers/library files
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
pkg_check_modules(WEBKIT REQUIRED webkitgtk-3.0)
# Setup CMake to use GTK+, tell the compiler where to look for headers
include_directories(${GTK3_INCLUDE_DIRS})
include_directories(${WEBKIT_INCLUDE_DIRS})
# and to the linker where to look for libraries
link_directories(${GTK3_LIBRARY_DIRS})
link_directories(${WEBKIT_LIBRARY_DIRS})
# Add other flags to the compiler
add_definitions(${GTK3_CFLAGS_OTHER})
add_definitions(${WEBKIT_CFLAGS_OTHER})
# Flags and source
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -v")
set(SOURCE_FILES main.cpp)
add_executable(HttpsMock ${SOURCE_FILES})
# Linking
target_link_libraries(HttpsMock ${GTK3_LIBRARIES})
target_link_libraries(HttpsMock ${WEBKIT_LIBRARIES})
But as soon as I try to use another method like :
WebKitURIRequest *request = webkit_uri_request_new("http://www.webkitgtk.org/");
The program doesn't want to link anymore. It's really weird. Here's a sample of the error :
[100%] Linking CXX executable HttpsMock
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.10.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -o HttpsMock -L/opt/local/lib -search_paths_first -headerpad_max_install_names CMakeFiles/HttpsMock.dir/main.cpp.o -lwebkitgtk-3.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpangoft2-1.0 -lpango-1.0 -lm -lfontconfig -lfreetype -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -ljavascriptcoregtk-3.0 -lglib-2.0 -lintl -rpath /opt/local/lib -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.0/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
"_webkit_uri_request_new", referenced from:
_main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
I really have no clue of what is going on. Could someone please enlighten me?
Thanks
The problem is that I was using
pkg_check_modules(WEBKIT REQUIRED webkitgtk-3.0)
instead of
pkg_check_modules(WEBKIT REQUIRED webkit2gtk-3.0)
As I tried to upgrade from my graphics programming from "legacy openGL" x "SDL 1.x" to OpenGL3+ x SDL2 and I came across linking problems. I tried many linking parameters but nothing seems to work.
I tried SDL1 linking params: linking listing 1
-lmingw32 -lSDLmain -lSDL
It works fine with this code: code listing 1
#include <SDL2/SDL.h>
int main(int argc, char **argv)
{
if(SDL_Init(SDL_INIT_VIDEO) < 0)
{
SDL_Quit();
return -1;
}
SDL_Quit();
return 0;
}
but when I add SDL2 codes to it like this: code listing 2
#include <SDL2/SDL.h>
int main(int argc, char **argv)
{
SDL_Window* window(0);
if(SDL_Init(SDL_INIT_VIDEO) < 0)
{
SDL_Quit();
return -1;
}
window = SDL_CreateWindow("Test SDL 2.0", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, SDL_WINDOW_SHOWN);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
I get linking errors: error listing 1
g++ -o dist/Debug/MinGW-Windows/sdl2 build/Debug/MinGW-Windows/main.o -lmingw32 -lSDLmain -lSDL
build/Debug/MinGW-Windows/main.o: In function `SDL_main':
C:\Users\Paikuhan\Documents\NetBeansProjects\SDL2/main.cpp:21: undefined reference to `SDL_CreateWindow'
C:\Users\Paikuhan\Documents\NetBeansProjects\SDL2/main.cpp:23: undefined reference to `SDL_DestroyWindow'
collect2.exe: error: ld returned 1 exit status
swaping linking params to this: linking listing 2
-lmingw32 -lSDL -lSDLmain
gives even more errors (I won't write them down). Adding a '2' to the params like this: linking listing 3
-lmingw32 -lSDL2main -lSDL2
gives me more linking errors than without the 2s: error listing 2
g++ -o dist/Debug/MinGW-Windows/sdl2 build/Debug/MinGW-Windows/main.o -lmingw32 -lSDL2main -lSDL2
build/Debug/MinGW-Windows/main.o: In function `SDL_main':
C:\Users\Paikuhan\Documents\NetBeansProjects\SDL2/main.cpp:14: undefined reference to `SDL_Init'
C:\Users\Paikuhan\Documents\NetBeansProjects\SDL2/main.cpp:16: undefined reference to `SDL_Quit'
C:\Users\Paikuhan\Documents\NetBeansProjects\SDL2/main.cpp:21: undefined reference to `SDL_CreateWindow'
C:\Users\Paikuhan\Documents\NetBeansProjects\SDL2/main.cpp:23: undefined reference to `SDL_DestroyWindow'
C:\Users\Paikuhan\Documents\NetBeansProjects\SDL2/main.cpp:24: undefined reference to `SDL_Quit'
c:/programs/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/libmingw32.a(main.o): In function `main':
e:\p\giaw\src\pkg\mingwrt-4.0.3-1-mingw32-src\bld/../mingwrt-4.0.3-1-mingw32-src/src/libcrt/crt/main.c:91: undefined reference to `WinMain#16'
collect2.exe: error: ld returned 1 exit status
as if no single SDL functions were found and I do have the libraries (libSDL2.a, libSDL2.dll.a, libSDL2.la, libSDL2main.a, pkgconfig\sdl2.pc) in the lib directory. I also tried using this set of params in netbeans: linking listing 4
$(pkg-config --cflags --libs sdl2)
and it doesn't do any good. Can anyone please help me on this. Thank you!
Problem Solved! I tried to troubleshoot the linking errors. Now everything works fine!! LazyFoo's tutorial has the answer "Most importantly i686-w64-mingw32 which contains the 32bit library [...] This is important: most compilers still compile 32bit binaries by default to maximize compatibility. [...]". So I re-extracted all the 32bit files in their corresponding directories. Now everything works like a charm. My guess is I used the 64bit libs with the 32bit mingw compiler.
both linking params work fine. this:
$(pkg-config --cflags --libs sdl2)
or this:
-lmingw32 -lSDL2main -lSDL2
First, I am sorry for my bad English, I am French.
I tried to install the Gtk+ library with Code::Blocks, and I created a project just for try to use the stuff.
So, I used the method given at this page :
http://forums.codeblocks.org/index.php?topic=16468.0
And I put this test code in main.c :
#include <stdlib.h>
#include <gtk/gtk.h>
void OnDestroy(GtkWidget *pWidget, gpointer pData);
int main(int argc,char **argv)
{
GtkWidget *pWindow;
gtk_init(&argc,&argv);
pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position(GTK_WINDOW(pWindow), GTK_WIN_POS_CENTER);
tk_window_set_default_size(GTK_WINDOW(pWindow), 320, 200);
gtk_window_set_title(GTK_WINDOW(pWindow), "Chapitre Fenetre");
g_signal_connect(G_OBJECT(pWindow), "destroy", G_CALLBACK(OnDestroy), NULL);
gtk_widget_show(pWindow);
gtk_main();
return EXIT_SUCCESS;
}
void OnDestroy(GtkWidget *pWidget, gpointer pData)
{
gtk_main_quit();
}
And I tried to build, but I get this error on the Code::Blocks build log:
Execution of 'mingw32-g++.exe -o "bin\Debug\Simulation POP.exe" obj\Debug\main.o -LC:/MinGW/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl' in 'C:\Users\Habib\Documents\Simulation POP' failed.
Please, have-you got an explanation ?
Thanks you.
In fact, I desinstalled Code::Blocks, Gtk+ and all of the other stuff, and I just restart like this :
(1) C:\Program Files\Code::Blocks\
(2) C:\Program Files\Code::Blocks\Gtk+\
Then, I put the path (2)\bin\ in the Variable Path Environnement.
I configured Code::Blocks without the tutorial, just with the bin, gtk+ and lib directory.
I executed the main.c Hello Word, and everything was good.
If anyone has the same problem, just send me a mail or ask the question in the same topic.