Android Gradle build error: undefined reference to 'main'
After succesfull compiling the code. Linking process begin and there where issue show up.
I did checked main function and it exist in code, checked cmake linking sdl and I suppose is decend. All the libs are static and I did noticed Gradle is using crtbegin_dynamic in linking process shouldn't be used crtbegin_static instead?
Main function:
int main(int argc, char **argv)
{
char commandLine[MAX_STRING_CHARS] = { 0 };
Sys_PlatformInit();
// Set the initial time base
Sys_Milliseconds();
#ifdef __APPLE__
// This is passed if we are launched by double-clicking
if (argc >= 2 && Q_strncmp(argv[1], "-psn", 4) == 0)
{
argc = 1;
}
#endif
Sys_ParseArgs(argc, argv);
#if defined(__APPLE__) && !defined(DEDICATED)
// argv[0] would be /Users/seth/etlegacy/etl.app/Contents/MacOS
// But on OS X we want to pretend the binary path is the .app's parent
// So that way the base folder is right next to the .app allowing
{
char parentdir[1024];
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
if (!url)
{
Sys_Dialog(DT_ERROR, "A CFURL for the app bundle could not be found.", "Can't set Sys_SetBinaryPath");
Sys_Exit(EXIT_FAILURE);
}
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
if (!url2 || !CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, 1024))
{
Sys_Dialog(DT_ERROR, "CFURLGetFileSystemRepresentation returned an error when finding the app bundle's parent directory.", "Can't set Sys_SetBinaryPath");
Sys_Exit(EXIT_FAILURE);
}
Sys_SetBinaryPath(parentdir);
CFRelease(url);
CFRelease(url2);
}
#else
Sys_SetBinaryPath(Sys_Dirname(argv[0]));
#endif
Sys_SetDefaultInstallPath(DEFAULT_BASEDIR); // Sys_BinaryPath() by default
// Concatenate the command line for passing to Com_Init
Sys_BuildCommandLine(argc, argv, commandLine, sizeof(commandLine));
Com_Init(commandLine);
NET_Init();
Sys_SetUpConsoleAndSignals();
#ifdef _WIN32
#ifndef DEDICATED
if (com_viewlog->integer)
{
Sys_ShowConsoleWindow(1, qfalse);
}
#endif
Sys_Splash(qfalse);
{
char cwd[MAX_OSPATH];
_getcwd(cwd, sizeof(cwd));
Com_Printf("Working directory: %sn", cwd);
}
// hide the early console since we've reached the point where we
// have a working graphics subsystems
#ifndef LEGACY_DEBUG
if (!com_dedicated->integer && !com_viewlog->integer)
{
Sys_ShowConsoleWindow(0, qfalse);
}
#endif
#endif
Sys_GameLoop();
return EXIT_SUCCESS;
}
Part of cmake file:
target_link_libraries(etl
${CLIENT_LIBRARIES}
${SDL_LIBRARIES}
${OS_LIBRARIES} # Has to go after cURL and SDL
)
Here is the build log:
> Task :app:compileReleaseJavaWithJavac
> Task :app:externalNativeBuildRelease
Build ui.mp.armeabi-v7a armeabi-v7a
[1/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui /ui_atoms.c.o
[2/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_main.c.o
[3/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_gameinfo.c.o
[4/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_loadpanel.c.o
[5/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_parse.c.o
[6/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_menu.c.o
[7/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/game/bg_misc.c.o
[8/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_menuitem.c.o
[9/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_script.c.o
[10/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_shared.c.o
[11/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_syscalls.c.o
[12/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_math.c.o
[13/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_shared.c.o
[14/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_unicode.c.o
[15/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/game/bg_classes.c.o
[16/16] Linking C shared module legacy/ui.mp.armeabi-v7a.so
Build etl armeabi-v7a
[1/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_animation_mdm.c.o
[2/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_animation_mds.c.o
[3/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_backend.c.o
[4/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_bsp.c.o
[5/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_cmds.c.o
[6/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_cmesh.c.o
[7/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_curve.c.o
[8/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_decals.c.o
[9/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_flares.c.o
[10/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_image.c.o
[11/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_init.c.o
[12/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_light.c.o
[13/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_main.c.o
[14/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_marks.c.o
[15/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_mesh.c.o
[16/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_model.c.o
[17/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_scene.c.o
[18/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shade.c.o
[19/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shade_calc.c.o
[20/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shader.c.o
[21/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shadows.c.o
[22/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_sky.c.o
[23/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_surface.c.o
[24/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_world.c.o
[25/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_common.c.o
[26/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_font.c.o
[27/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_bmp.c.o
[28/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_jpg.c.o
[29/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_pcx.c.o
[30/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_png.c.o
[31/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_tga.c.o
[32/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_noise.c.o
[33/123] Linking C static library librenderer_opengl1_armeabi-v7a.a
[34/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_test.c.o
[35/123] Building C object CMakeFiles/etl.dir/src/qcommon/cmd.c.o
[36/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_load.c.o
[37/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_patch.c.o
[38/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_polylib.c.o
[39/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_trace.c.o
[40/123] Building C object CMakeFiles/etl.dir/src/qcommon/cvar.c.o
[41/123] Building C object CMakeFiles/etl.dir/src/qcommon/common.c.o
[42/123] Building C object CMakeFiles/etl.dir/src/qcommon/files.c.o
[43/123] Building C object CMakeFiles/etl.dir/src/qcommon/download.c.o
[44/123] Building C object CMakeFiles/etl.dir/src/qcommon/md4.c.o
[45/123] Building C object CMakeFiles/etl.dir/src/qcommon/huffman.c.o
[46/123] Building C object CMakeFiles/etl.dir/src/qcommon/md5.c.o
[47/123] Building C object CMakeFiles/etl.dir/src/qcommon/msg.c.o
[48/123] Building C object CMakeFiles/etl.dir/src/qcommon/puff.c.o
[49/123] Building C object CMakeFiles/etl.dir/src/qcommon/net_chan.c.o
[50/123] Building C object CMakeFiles/etl.dir/src/qcommon/net_ip.c.o
[51/123] Building C object CMakeFiles/etl.dir/src/qcommon/vm.c.o
[52/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_math.c.o
[53/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_shared.c.o
[54/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_unicode.c.o
[55/123] Building C object CMakeFiles/etl.dir/src/qcommon/update.c.o
[56/123] Building C object CMakeFiles/etl.dir/src/client/cl_avi.c.o
[57/123] Building C object CMakeFiles/etl.dir/src/server/sv_bot.c.o
[58/123] Building C object CMakeFiles/etl.dir/src/qcommon/vm_interpreted.c.o
[59/123] Building C object CMakeFiles/etl.dir/src/server/sv_ccmds.c.o
[60/123] Building C object CMakeFiles/etl.dir/src/server/sv_client.c.o
[61/123] Building C object CMakeFiles/etl.dir/src/server/sv_demo.c.o
[62/123] Building C object CMakeFiles/etl.dir/src/server/sv_demo_ext.c.o
[63/123] Building C object CMakeFiles/etl.dir/src/server/sv_game.c.o
[64/123] Building C object CMakeFiles/etl.dir/src/server/sv_init.c.o
[65/123] Building C object CMakeFiles/etl.dir/src/server/sv_main.c.o
[66/123] Building C object CMakeFiles/etl.dir/src/server/sv_net_chan.c.o
[67/123] Building C object CMakeFiles/etl.dir/src/server/sv_snapshot.c.o
[68/123] Building C object CMakeFiles/etl.dir/src/server/sv_tracker.c.o
[69/123] Building C object CMakeFiles/etl.dir/src/server/sv_wallhack.c.o
[70/123] Building C object CMakeFiles/etl.dir/src/server/sv_world.c.o
[71/123] Building C object CMakeFiles/etl.dir/src/client/cl_ogv.c.o
[72/123] Building C object CMakeFiles/etl.dir/src/client/cl_cgame.c.o
[73/123] Building C object CMakeFiles/etl.dir/src/client/cl_cinematic.c.o
[74/123] Building C object CMakeFiles/etl.dir/src/client/cl_console.c.o
[75/123] Building C object CMakeFiles/etl.dir/src/client/cl_demo.c.o
[76/123] Building C object CMakeFiles/etl.dir/src/client/cl_input.c.o
[77/123] Building C object CMakeFiles/etl.dir/src/client/cl_keys.c.o
[78/123] Building C object CMakeFiles/etl.dir/src/client/cl_main.c.o
[79/123] Building C object CMakeFiles/etl.dir/src/client/cl_net_chan.c.o
[80/123] Building C object CMakeFiles/etl.dir/src/client/cl_roq.c.o
[81/123] Building C object CMakeFiles/etl.dir/src/client/cl_parse.c.o
[82/123] Building C object CMakeFiles/etl.dir/src/client/cl_ui.c.o
[83/123] Building C object CMakeFiles/etl.dir/src/client/cl_scrn.c.o
[84/123] Building C object CMakeFiles/etl.dir/src/client/qal.c.o
[85/123] Building C object CMakeFiles/etl.dir/src/sys/sys_main.c.o
[88/123] Building C object CMakeFiles/etl.dir/src/client/snd_codec_ogg.c.o
[89/123] Building C object CMakeFiles/etl.dir/src/client/snd_codec_wav.c.o
[90/123] Building C object CMakeFiles/etl.dir/src/client/snd_dma.c.o
[91/123] Building C object CMakeFiles/etl.dir/src/client/snd_main.c.o
[92/123] Building C object CMakeFiles/etl.dir/src/client/snd_mem.c.o
[93/123] Building C object CMakeFiles/etl.dir/src/client/snd_mix.c.o
[94/123] Building C object CMakeFiles/etl.dir/src/client/snd_openal.c.o
[95/123] Building C object CMakeFiles/etl.dir/src/client/snd_wavelet.c.o
[96/123] Building C object CMakeFiles/etl.dir/src/botlib/be_interface.c.o
[97/123] Building C object CMakeFiles/etl.dir/src/botlib/l_memory.c.o
[98/123] Building C object CMakeFiles/etl.dir/src/botlib/l_precomp.c.o
[99/123] Building C object CMakeFiles/etl.dir/src/botlib/l_script.c.o
[100/123] Building C object CMakeFiles/etl.dir/src/sys/con_log.c.o
[101/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_glimp.c.o
[102/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_input.c.o
[103/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_snd.c.o
[104/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/log.cpp.o
[105/123] Building C object CMakeFiles/etl.dir/src/qcommon/json_stubs.c.o
[106/123] Building CXX object CMakeFiles/etl.dir/src/qcommon/i18n_main.cpp.o
[107/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/dictionary_manager.cpp.o
[108/123] Building C object CMakeFiles/etl.dir/src/qcommon/i18n_findlocale.c.o
[109/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/dictionary.cpp.o
[110/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/iconv.cpp.o
[111/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/unix_file_system.cpp.o
[112/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/language.cpp.o
[113/123] Building C object CMakeFiles/etl.dir/src/irc/htable.c.o
[114/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/plural_forms.cpp.o
[115/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/po_parser.cpp.o
[116/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/tinygettext.cpp.o
[117/123] Building C object CMakeFiles/etl.dir/src/db/db_sqlite3.c.o
[118/123] Building C object CMakeFiles/etl.dir/src/irc/irc_client.c.o
[119/123] Building C object CMakeFiles/etl.dir/src/qcommon/dl_main_curl.c.o
[120/123] Building C object CMakeFiles/etl.dir/src/sys/sys_unix.c.o
[121/123] Building C object CMakeFiles/etl.dir/src/db/db_sql_cmds.c.o
[122/123] Building C object CMakeFiles/etl.dir/src/sys/con_tty.c.o
[123/123] Linking CXX executable etl
FAILED: : && /home/rafal/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/rafal/Android/Sdk/ndk-bundle/sysroot -isystem /home/rafal/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -Os -DNDEBUG -ffast-math -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a --sysroot /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections -Wl,-z,nocopyreloc -pie -fPIE CMakeFiles/etl.dir/src/qcommon/cm_load.c.o CMakeFiles/etl.dir/src/qcommon/cm_patch.c.o CMakeFiles/etl.dir/src/qcommon/cm_polylib.c.o CMakeFiles/etl.dir/src/qcommon/cm_test.c.o CMakeFiles/etl.dir/src/qcommon/cm_trace.c.o CMakeFiles/etl.dir/src/qcommon/cmd.c.o CMakeFiles/etl.dir/src/qcommon/common.c.o CMakeFiles/etl.dir/src/qcommon/cvar.c.o CMakeFiles/etl.dir/src/qcommon/download.c.o CMakeFiles/etl.dir/src/qcommon/files.c.o CMakeFiles/etl.dir/src/qcommon/huffman.c.o CMakeFiles/etl.dir/src/qcommon/md4.c.o CMakeFiles/etl.dir/src/qcommon/md5.c.o CMakeFiles/etl.dir/src/qcommon/msg.c.o CMakeFiles/etl.dir/src/qcommon/net_chan.c.o CMakeFiles/etl.dir/src/qcommon/net_ip.c.o CMakeFiles/etl.dir/src/qcommon/puff.c.o CMakeFiles/etl.dir/src/qcommon/q_math.c.o CMakeFiles/etl.dir/src/qcommon/q_shared.c.o CMakeFiles/etl.dir/src/qcommon/q_unicode.c.o CMakeFiles/etl.dir/src/qcommon/update.c.o CMakeFiles/etl.dir/src/qcommon/vm.c.o CMakeFiles/etl.dir/src/qcommon/vm_interpreted.c.o CMakeFiles/etl.dir/src/server/sv_bot.c.o CMakeFiles/etl.dir/src/server/sv_ccmds.c.o CMakeFiles/etl.dir/src/server/sv_client.c.o CMakeFiles/etl.dir/src/server/sv_demo.c.o CMakeFiles/etl.dir/src/server/sv_demo_ext.c.o CMakeFiles/etl.dir/src/server/sv_game.c.o CMakeFiles/etl.dir/src/server/sv_init.c.o CMakeFiles/etl.dir/src/server/sv_main.c.o CMakeFiles/etl.dir/src/server/sv_net_chan.c.o CMakeFiles/etl.dir/src/server/sv_snapshot.c.o CMakeFiles/etl.dir/src/server/sv_tracker.c.o CMakeFiles/etl.dir/src/server/sv_wallhack.c.o CMakeFiles/etl.dir/src/server/sv_world.c.o CMakeFiles/etl.dir/src/client/cl_avi.c.o CMakeFiles/etl.dir/src/client/cl_cgame.c.o CMakeFiles/etl.dir/src/client/cl_cinematic.c.o CMakeFiles/etl.dir/src/client/cl_console.c.o CMakeFiles/etl.dir/src/client/cl_demo.c.o CMakeFiles/etl.dir/src/client/cl_input.c.o CMakeFiles/etl.dir/src/client/cl_keys.c.o CMakeFiles/etl.dir/src/client/cl_main.c.o CMakeFiles/etl.dir/src/client/cl_net_chan.c.o CMakeFiles/etl.dir/src/client/cl_ogv.c.o CMakeFiles/etl.dir/src/client/cl_parse.c.o CMakeFiles/etl.dir/src/client/cl_roq.c.o CMakeFiles/etl.dir/src/client/cl_scrn.c.o CMakeFiles/etl.dir/src/client/cl_ui.c.o CMakeFiles/etl.dir/src/client/qal.c.o CMakeFiles/etl.dir/src/client/snd_adpcm.c.o CMakeFiles/etl.dir/src/client/snd_codec.c.o CMakeFiles/etl.dir/src/client/snd_codec_ogg.c.o CMakeFiles/etl.dir/src/client/snd_codec_wav.c.o CMakeFiles/etl.dir/src/client/snd_dma.c.o CMakeFiles/etl.dir/src/client/snd_main.c.o CMakeFiles/etl.dir/src/client/snd_mem.c.o CMakeFiles/etl.dir/src/client/snd_mix.c.o CMakeFiles/etl.dir/src/client/snd_openal.c.o CMakeFiles/etl.dir/src/client/snd_wavelet.c.o CMakeFiles/etl.dir/src/botlib/be_interface.c.o CMakeFiles/etl.dir/src/botlib/l_memory.c.o CMakeFiles/etl.dir/src/botlib/l_precomp.c.o CMakeFiles/etl.dir/src/botlib/l_script.c.o CMakeFiles/etl.dir/src/sys/sys_main.c.o CMakeFiles/etl.dir/src/sys/con_log.c.o CMakeFiles/etl.dir/src/sdl/sdl_glimp.c.o CMakeFiles/etl.dir/src/sdl/sdl_input.c.o CMakeFiles/etl.dir/src/sdl/sdl_snd.c.o CMakeFiles/etl.dir/src/qcommon/json_stubs.c.o CMakeFiles/etl.dir/src/qcommon/i18n_main.cpp.o CMakeFiles/etl.dir/src/qcommon/i18n_findlocale.c.o CMakeFiles/etl.dir/src/tinygettext/dictionary.cpp.o CMakeFiles/etl.dir/src/tinygettext/dictionary_manager.cpp.o CMakeFiles/etl.dir/src/tinygettext/iconv.cpp.o CMakeFiles/etl.dir/src/tinygettext/language.cpp.o CMakeFiles/etl.dir/src/tinygettext/log.cpp.o CMakeFiles/etl.dir/src/tinygettext/plural_forms.cpp.o CMakeFiles/etl.dir/src/tinygettext/po_parser.cpp.o CMakeFiles/etl.dir/src/tinygettext/tinygettext.cpp.o CMakeFiles/etl.dir/src/tinygettext/unix_file_system.cpp.o CMakeFiles/etl.dir/src/irc/htable.c.o CMakeFiles/etl.dir/src/irc/irc_client.c.o CMakeFiles/etl.dir/src/qcommon/dl_main_curl.c.o CMakeFiles/etl.dir/src/db/db_sqlite3.c.o CMakeFiles/etl.dir/src/db/db_sql_cmds.c.o CMakeFiles/etl.dir/src/sys/sys_unix.c.o CMakeFiles/etl.dir/src/sys/con_tty.c.o -o etl /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libvorbisfile.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libogg.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libvorbis.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libcurl.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libsqlite3.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libz.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libminizip.a librenderer_opengl1_armeabi-v7a.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libSDL2main.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libSDL2.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libGLESv1_CM.so /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libjpeg.a -l'm' -latomic -lm "/home/rafal/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a" && :
/home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/crtbegin_dynamic.o:crtbegin.c:function _start: error: undefined reference to 'main'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
> Task :app:externalNativeBuildRelease FAILED
17 actionable tasks: 15 executed, 2 up-to-date
I want to make it link properly so I can move forward with my build.
android cmake android-ndk android-gradle sdl-2
add a comment |
After succesfull compiling the code. Linking process begin and there where issue show up.
I did checked main function and it exist in code, checked cmake linking sdl and I suppose is decend. All the libs are static and I did noticed Gradle is using crtbegin_dynamic in linking process shouldn't be used crtbegin_static instead?
Main function:
int main(int argc, char **argv)
{
char commandLine[MAX_STRING_CHARS] = { 0 };
Sys_PlatformInit();
// Set the initial time base
Sys_Milliseconds();
#ifdef __APPLE__
// This is passed if we are launched by double-clicking
if (argc >= 2 && Q_strncmp(argv[1], "-psn", 4) == 0)
{
argc = 1;
}
#endif
Sys_ParseArgs(argc, argv);
#if defined(__APPLE__) && !defined(DEDICATED)
// argv[0] would be /Users/seth/etlegacy/etl.app/Contents/MacOS
// But on OS X we want to pretend the binary path is the .app's parent
// So that way the base folder is right next to the .app allowing
{
char parentdir[1024];
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
if (!url)
{
Sys_Dialog(DT_ERROR, "A CFURL for the app bundle could not be found.", "Can't set Sys_SetBinaryPath");
Sys_Exit(EXIT_FAILURE);
}
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
if (!url2 || !CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, 1024))
{
Sys_Dialog(DT_ERROR, "CFURLGetFileSystemRepresentation returned an error when finding the app bundle's parent directory.", "Can't set Sys_SetBinaryPath");
Sys_Exit(EXIT_FAILURE);
}
Sys_SetBinaryPath(parentdir);
CFRelease(url);
CFRelease(url2);
}
#else
Sys_SetBinaryPath(Sys_Dirname(argv[0]));
#endif
Sys_SetDefaultInstallPath(DEFAULT_BASEDIR); // Sys_BinaryPath() by default
// Concatenate the command line for passing to Com_Init
Sys_BuildCommandLine(argc, argv, commandLine, sizeof(commandLine));
Com_Init(commandLine);
NET_Init();
Sys_SetUpConsoleAndSignals();
#ifdef _WIN32
#ifndef DEDICATED
if (com_viewlog->integer)
{
Sys_ShowConsoleWindow(1, qfalse);
}
#endif
Sys_Splash(qfalse);
{
char cwd[MAX_OSPATH];
_getcwd(cwd, sizeof(cwd));
Com_Printf("Working directory: %sn", cwd);
}
// hide the early console since we've reached the point where we
// have a working graphics subsystems
#ifndef LEGACY_DEBUG
if (!com_dedicated->integer && !com_viewlog->integer)
{
Sys_ShowConsoleWindow(0, qfalse);
}
#endif
#endif
Sys_GameLoop();
return EXIT_SUCCESS;
}
Part of cmake file:
target_link_libraries(etl
${CLIENT_LIBRARIES}
${SDL_LIBRARIES}
${OS_LIBRARIES} # Has to go after cURL and SDL
)
Here is the build log:
> Task :app:compileReleaseJavaWithJavac
> Task :app:externalNativeBuildRelease
Build ui.mp.armeabi-v7a armeabi-v7a
[1/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui /ui_atoms.c.o
[2/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_main.c.o
[3/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_gameinfo.c.o
[4/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_loadpanel.c.o
[5/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_parse.c.o
[6/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_menu.c.o
[7/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/game/bg_misc.c.o
[8/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_menuitem.c.o
[9/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_script.c.o
[10/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_shared.c.o
[11/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_syscalls.c.o
[12/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_math.c.o
[13/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_shared.c.o
[14/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_unicode.c.o
[15/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/game/bg_classes.c.o
[16/16] Linking C shared module legacy/ui.mp.armeabi-v7a.so
Build etl armeabi-v7a
[1/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_animation_mdm.c.o
[2/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_animation_mds.c.o
[3/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_backend.c.o
[4/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_bsp.c.o
[5/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_cmds.c.o
[6/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_cmesh.c.o
[7/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_curve.c.o
[8/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_decals.c.o
[9/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_flares.c.o
[10/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_image.c.o
[11/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_init.c.o
[12/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_light.c.o
[13/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_main.c.o
[14/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_marks.c.o
[15/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_mesh.c.o
[16/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_model.c.o
[17/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_scene.c.o
[18/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shade.c.o
[19/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shade_calc.c.o
[20/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shader.c.o
[21/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shadows.c.o
[22/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_sky.c.o
[23/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_surface.c.o
[24/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_world.c.o
[25/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_common.c.o
[26/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_font.c.o
[27/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_bmp.c.o
[28/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_jpg.c.o
[29/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_pcx.c.o
[30/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_png.c.o
[31/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_tga.c.o
[32/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_noise.c.o
[33/123] Linking C static library librenderer_opengl1_armeabi-v7a.a
[34/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_test.c.o
[35/123] Building C object CMakeFiles/etl.dir/src/qcommon/cmd.c.o
[36/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_load.c.o
[37/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_patch.c.o
[38/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_polylib.c.o
[39/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_trace.c.o
[40/123] Building C object CMakeFiles/etl.dir/src/qcommon/cvar.c.o
[41/123] Building C object CMakeFiles/etl.dir/src/qcommon/common.c.o
[42/123] Building C object CMakeFiles/etl.dir/src/qcommon/files.c.o
[43/123] Building C object CMakeFiles/etl.dir/src/qcommon/download.c.o
[44/123] Building C object CMakeFiles/etl.dir/src/qcommon/md4.c.o
[45/123] Building C object CMakeFiles/etl.dir/src/qcommon/huffman.c.o
[46/123] Building C object CMakeFiles/etl.dir/src/qcommon/md5.c.o
[47/123] Building C object CMakeFiles/etl.dir/src/qcommon/msg.c.o
[48/123] Building C object CMakeFiles/etl.dir/src/qcommon/puff.c.o
[49/123] Building C object CMakeFiles/etl.dir/src/qcommon/net_chan.c.o
[50/123] Building C object CMakeFiles/etl.dir/src/qcommon/net_ip.c.o
[51/123] Building C object CMakeFiles/etl.dir/src/qcommon/vm.c.o
[52/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_math.c.o
[53/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_shared.c.o
[54/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_unicode.c.o
[55/123] Building C object CMakeFiles/etl.dir/src/qcommon/update.c.o
[56/123] Building C object CMakeFiles/etl.dir/src/client/cl_avi.c.o
[57/123] Building C object CMakeFiles/etl.dir/src/server/sv_bot.c.o
[58/123] Building C object CMakeFiles/etl.dir/src/qcommon/vm_interpreted.c.o
[59/123] Building C object CMakeFiles/etl.dir/src/server/sv_ccmds.c.o
[60/123] Building C object CMakeFiles/etl.dir/src/server/sv_client.c.o
[61/123] Building C object CMakeFiles/etl.dir/src/server/sv_demo.c.o
[62/123] Building C object CMakeFiles/etl.dir/src/server/sv_demo_ext.c.o
[63/123] Building C object CMakeFiles/etl.dir/src/server/sv_game.c.o
[64/123] Building C object CMakeFiles/etl.dir/src/server/sv_init.c.o
[65/123] Building C object CMakeFiles/etl.dir/src/server/sv_main.c.o
[66/123] Building C object CMakeFiles/etl.dir/src/server/sv_net_chan.c.o
[67/123] Building C object CMakeFiles/etl.dir/src/server/sv_snapshot.c.o
[68/123] Building C object CMakeFiles/etl.dir/src/server/sv_tracker.c.o
[69/123] Building C object CMakeFiles/etl.dir/src/server/sv_wallhack.c.o
[70/123] Building C object CMakeFiles/etl.dir/src/server/sv_world.c.o
[71/123] Building C object CMakeFiles/etl.dir/src/client/cl_ogv.c.o
[72/123] Building C object CMakeFiles/etl.dir/src/client/cl_cgame.c.o
[73/123] Building C object CMakeFiles/etl.dir/src/client/cl_cinematic.c.o
[74/123] Building C object CMakeFiles/etl.dir/src/client/cl_console.c.o
[75/123] Building C object CMakeFiles/etl.dir/src/client/cl_demo.c.o
[76/123] Building C object CMakeFiles/etl.dir/src/client/cl_input.c.o
[77/123] Building C object CMakeFiles/etl.dir/src/client/cl_keys.c.o
[78/123] Building C object CMakeFiles/etl.dir/src/client/cl_main.c.o
[79/123] Building C object CMakeFiles/etl.dir/src/client/cl_net_chan.c.o
[80/123] Building C object CMakeFiles/etl.dir/src/client/cl_roq.c.o
[81/123] Building C object CMakeFiles/etl.dir/src/client/cl_parse.c.o
[82/123] Building C object CMakeFiles/etl.dir/src/client/cl_ui.c.o
[83/123] Building C object CMakeFiles/etl.dir/src/client/cl_scrn.c.o
[84/123] Building C object CMakeFiles/etl.dir/src/client/qal.c.o
[85/123] Building C object CMakeFiles/etl.dir/src/sys/sys_main.c.o
[88/123] Building C object CMakeFiles/etl.dir/src/client/snd_codec_ogg.c.o
[89/123] Building C object CMakeFiles/etl.dir/src/client/snd_codec_wav.c.o
[90/123] Building C object CMakeFiles/etl.dir/src/client/snd_dma.c.o
[91/123] Building C object CMakeFiles/etl.dir/src/client/snd_main.c.o
[92/123] Building C object CMakeFiles/etl.dir/src/client/snd_mem.c.o
[93/123] Building C object CMakeFiles/etl.dir/src/client/snd_mix.c.o
[94/123] Building C object CMakeFiles/etl.dir/src/client/snd_openal.c.o
[95/123] Building C object CMakeFiles/etl.dir/src/client/snd_wavelet.c.o
[96/123] Building C object CMakeFiles/etl.dir/src/botlib/be_interface.c.o
[97/123] Building C object CMakeFiles/etl.dir/src/botlib/l_memory.c.o
[98/123] Building C object CMakeFiles/etl.dir/src/botlib/l_precomp.c.o
[99/123] Building C object CMakeFiles/etl.dir/src/botlib/l_script.c.o
[100/123] Building C object CMakeFiles/etl.dir/src/sys/con_log.c.o
[101/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_glimp.c.o
[102/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_input.c.o
[103/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_snd.c.o
[104/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/log.cpp.o
[105/123] Building C object CMakeFiles/etl.dir/src/qcommon/json_stubs.c.o
[106/123] Building CXX object CMakeFiles/etl.dir/src/qcommon/i18n_main.cpp.o
[107/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/dictionary_manager.cpp.o
[108/123] Building C object CMakeFiles/etl.dir/src/qcommon/i18n_findlocale.c.o
[109/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/dictionary.cpp.o
[110/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/iconv.cpp.o
[111/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/unix_file_system.cpp.o
[112/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/language.cpp.o
[113/123] Building C object CMakeFiles/etl.dir/src/irc/htable.c.o
[114/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/plural_forms.cpp.o
[115/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/po_parser.cpp.o
[116/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/tinygettext.cpp.o
[117/123] Building C object CMakeFiles/etl.dir/src/db/db_sqlite3.c.o
[118/123] Building C object CMakeFiles/etl.dir/src/irc/irc_client.c.o
[119/123] Building C object CMakeFiles/etl.dir/src/qcommon/dl_main_curl.c.o
[120/123] Building C object CMakeFiles/etl.dir/src/sys/sys_unix.c.o
[121/123] Building C object CMakeFiles/etl.dir/src/db/db_sql_cmds.c.o
[122/123] Building C object CMakeFiles/etl.dir/src/sys/con_tty.c.o
[123/123] Linking CXX executable etl
FAILED: : && /home/rafal/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/rafal/Android/Sdk/ndk-bundle/sysroot -isystem /home/rafal/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -Os -DNDEBUG -ffast-math -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a --sysroot /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections -Wl,-z,nocopyreloc -pie -fPIE CMakeFiles/etl.dir/src/qcommon/cm_load.c.o CMakeFiles/etl.dir/src/qcommon/cm_patch.c.o CMakeFiles/etl.dir/src/qcommon/cm_polylib.c.o CMakeFiles/etl.dir/src/qcommon/cm_test.c.o CMakeFiles/etl.dir/src/qcommon/cm_trace.c.o CMakeFiles/etl.dir/src/qcommon/cmd.c.o CMakeFiles/etl.dir/src/qcommon/common.c.o CMakeFiles/etl.dir/src/qcommon/cvar.c.o CMakeFiles/etl.dir/src/qcommon/download.c.o CMakeFiles/etl.dir/src/qcommon/files.c.o CMakeFiles/etl.dir/src/qcommon/huffman.c.o CMakeFiles/etl.dir/src/qcommon/md4.c.o CMakeFiles/etl.dir/src/qcommon/md5.c.o CMakeFiles/etl.dir/src/qcommon/msg.c.o CMakeFiles/etl.dir/src/qcommon/net_chan.c.o CMakeFiles/etl.dir/src/qcommon/net_ip.c.o CMakeFiles/etl.dir/src/qcommon/puff.c.o CMakeFiles/etl.dir/src/qcommon/q_math.c.o CMakeFiles/etl.dir/src/qcommon/q_shared.c.o CMakeFiles/etl.dir/src/qcommon/q_unicode.c.o CMakeFiles/etl.dir/src/qcommon/update.c.o CMakeFiles/etl.dir/src/qcommon/vm.c.o CMakeFiles/etl.dir/src/qcommon/vm_interpreted.c.o CMakeFiles/etl.dir/src/server/sv_bot.c.o CMakeFiles/etl.dir/src/server/sv_ccmds.c.o CMakeFiles/etl.dir/src/server/sv_client.c.o CMakeFiles/etl.dir/src/server/sv_demo.c.o CMakeFiles/etl.dir/src/server/sv_demo_ext.c.o CMakeFiles/etl.dir/src/server/sv_game.c.o CMakeFiles/etl.dir/src/server/sv_init.c.o CMakeFiles/etl.dir/src/server/sv_main.c.o CMakeFiles/etl.dir/src/server/sv_net_chan.c.o CMakeFiles/etl.dir/src/server/sv_snapshot.c.o CMakeFiles/etl.dir/src/server/sv_tracker.c.o CMakeFiles/etl.dir/src/server/sv_wallhack.c.o CMakeFiles/etl.dir/src/server/sv_world.c.o CMakeFiles/etl.dir/src/client/cl_avi.c.o CMakeFiles/etl.dir/src/client/cl_cgame.c.o CMakeFiles/etl.dir/src/client/cl_cinematic.c.o CMakeFiles/etl.dir/src/client/cl_console.c.o CMakeFiles/etl.dir/src/client/cl_demo.c.o CMakeFiles/etl.dir/src/client/cl_input.c.o CMakeFiles/etl.dir/src/client/cl_keys.c.o CMakeFiles/etl.dir/src/client/cl_main.c.o CMakeFiles/etl.dir/src/client/cl_net_chan.c.o CMakeFiles/etl.dir/src/client/cl_ogv.c.o CMakeFiles/etl.dir/src/client/cl_parse.c.o CMakeFiles/etl.dir/src/client/cl_roq.c.o CMakeFiles/etl.dir/src/client/cl_scrn.c.o CMakeFiles/etl.dir/src/client/cl_ui.c.o CMakeFiles/etl.dir/src/client/qal.c.o CMakeFiles/etl.dir/src/client/snd_adpcm.c.o CMakeFiles/etl.dir/src/client/snd_codec.c.o CMakeFiles/etl.dir/src/client/snd_codec_ogg.c.o CMakeFiles/etl.dir/src/client/snd_codec_wav.c.o CMakeFiles/etl.dir/src/client/snd_dma.c.o CMakeFiles/etl.dir/src/client/snd_main.c.o CMakeFiles/etl.dir/src/client/snd_mem.c.o CMakeFiles/etl.dir/src/client/snd_mix.c.o CMakeFiles/etl.dir/src/client/snd_openal.c.o CMakeFiles/etl.dir/src/client/snd_wavelet.c.o CMakeFiles/etl.dir/src/botlib/be_interface.c.o CMakeFiles/etl.dir/src/botlib/l_memory.c.o CMakeFiles/etl.dir/src/botlib/l_precomp.c.o CMakeFiles/etl.dir/src/botlib/l_script.c.o CMakeFiles/etl.dir/src/sys/sys_main.c.o CMakeFiles/etl.dir/src/sys/con_log.c.o CMakeFiles/etl.dir/src/sdl/sdl_glimp.c.o CMakeFiles/etl.dir/src/sdl/sdl_input.c.o CMakeFiles/etl.dir/src/sdl/sdl_snd.c.o CMakeFiles/etl.dir/src/qcommon/json_stubs.c.o CMakeFiles/etl.dir/src/qcommon/i18n_main.cpp.o CMakeFiles/etl.dir/src/qcommon/i18n_findlocale.c.o CMakeFiles/etl.dir/src/tinygettext/dictionary.cpp.o CMakeFiles/etl.dir/src/tinygettext/dictionary_manager.cpp.o CMakeFiles/etl.dir/src/tinygettext/iconv.cpp.o CMakeFiles/etl.dir/src/tinygettext/language.cpp.o CMakeFiles/etl.dir/src/tinygettext/log.cpp.o CMakeFiles/etl.dir/src/tinygettext/plural_forms.cpp.o CMakeFiles/etl.dir/src/tinygettext/po_parser.cpp.o CMakeFiles/etl.dir/src/tinygettext/tinygettext.cpp.o CMakeFiles/etl.dir/src/tinygettext/unix_file_system.cpp.o CMakeFiles/etl.dir/src/irc/htable.c.o CMakeFiles/etl.dir/src/irc/irc_client.c.o CMakeFiles/etl.dir/src/qcommon/dl_main_curl.c.o CMakeFiles/etl.dir/src/db/db_sqlite3.c.o CMakeFiles/etl.dir/src/db/db_sql_cmds.c.o CMakeFiles/etl.dir/src/sys/sys_unix.c.o CMakeFiles/etl.dir/src/sys/con_tty.c.o -o etl /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libvorbisfile.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libogg.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libvorbis.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libcurl.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libsqlite3.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libz.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libminizip.a librenderer_opengl1_armeabi-v7a.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libSDL2main.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libSDL2.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libGLESv1_CM.so /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libjpeg.a -l'm' -latomic -lm "/home/rafal/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a" && :
/home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/crtbegin_dynamic.o:crtbegin.c:function _start: error: undefined reference to 'main'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
> Task :app:externalNativeBuildRelease FAILED
17 actionable tasks: 15 executed, 2 up-to-date
I want to make it link properly so I can move forward with my build.
android cmake android-ndk android-gradle sdl-2
1
SDL_main.h
redefinesmain
asSDL_main
for some platforms, android included. Is it java-less build? Take a look at hg.libsdl.org/SDL/file/fbce19db4e53/docs/README-android.md andandroid-project
directory in SDL sources.
– keltar
Dec 27 '18 at 7:20
add a comment |
After succesfull compiling the code. Linking process begin and there where issue show up.
I did checked main function and it exist in code, checked cmake linking sdl and I suppose is decend. All the libs are static and I did noticed Gradle is using crtbegin_dynamic in linking process shouldn't be used crtbegin_static instead?
Main function:
int main(int argc, char **argv)
{
char commandLine[MAX_STRING_CHARS] = { 0 };
Sys_PlatformInit();
// Set the initial time base
Sys_Milliseconds();
#ifdef __APPLE__
// This is passed if we are launched by double-clicking
if (argc >= 2 && Q_strncmp(argv[1], "-psn", 4) == 0)
{
argc = 1;
}
#endif
Sys_ParseArgs(argc, argv);
#if defined(__APPLE__) && !defined(DEDICATED)
// argv[0] would be /Users/seth/etlegacy/etl.app/Contents/MacOS
// But on OS X we want to pretend the binary path is the .app's parent
// So that way the base folder is right next to the .app allowing
{
char parentdir[1024];
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
if (!url)
{
Sys_Dialog(DT_ERROR, "A CFURL for the app bundle could not be found.", "Can't set Sys_SetBinaryPath");
Sys_Exit(EXIT_FAILURE);
}
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
if (!url2 || !CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, 1024))
{
Sys_Dialog(DT_ERROR, "CFURLGetFileSystemRepresentation returned an error when finding the app bundle's parent directory.", "Can't set Sys_SetBinaryPath");
Sys_Exit(EXIT_FAILURE);
}
Sys_SetBinaryPath(parentdir);
CFRelease(url);
CFRelease(url2);
}
#else
Sys_SetBinaryPath(Sys_Dirname(argv[0]));
#endif
Sys_SetDefaultInstallPath(DEFAULT_BASEDIR); // Sys_BinaryPath() by default
// Concatenate the command line for passing to Com_Init
Sys_BuildCommandLine(argc, argv, commandLine, sizeof(commandLine));
Com_Init(commandLine);
NET_Init();
Sys_SetUpConsoleAndSignals();
#ifdef _WIN32
#ifndef DEDICATED
if (com_viewlog->integer)
{
Sys_ShowConsoleWindow(1, qfalse);
}
#endif
Sys_Splash(qfalse);
{
char cwd[MAX_OSPATH];
_getcwd(cwd, sizeof(cwd));
Com_Printf("Working directory: %sn", cwd);
}
// hide the early console since we've reached the point where we
// have a working graphics subsystems
#ifndef LEGACY_DEBUG
if (!com_dedicated->integer && !com_viewlog->integer)
{
Sys_ShowConsoleWindow(0, qfalse);
}
#endif
#endif
Sys_GameLoop();
return EXIT_SUCCESS;
}
Part of cmake file:
target_link_libraries(etl
${CLIENT_LIBRARIES}
${SDL_LIBRARIES}
${OS_LIBRARIES} # Has to go after cURL and SDL
)
Here is the build log:
> Task :app:compileReleaseJavaWithJavac
> Task :app:externalNativeBuildRelease
Build ui.mp.armeabi-v7a armeabi-v7a
[1/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui /ui_atoms.c.o
[2/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_main.c.o
[3/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_gameinfo.c.o
[4/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_loadpanel.c.o
[5/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_parse.c.o
[6/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_menu.c.o
[7/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/game/bg_misc.c.o
[8/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_menuitem.c.o
[9/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_script.c.o
[10/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_shared.c.o
[11/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_syscalls.c.o
[12/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_math.c.o
[13/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_shared.c.o
[14/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_unicode.c.o
[15/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/game/bg_classes.c.o
[16/16] Linking C shared module legacy/ui.mp.armeabi-v7a.so
Build etl armeabi-v7a
[1/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_animation_mdm.c.o
[2/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_animation_mds.c.o
[3/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_backend.c.o
[4/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_bsp.c.o
[5/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_cmds.c.o
[6/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_cmesh.c.o
[7/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_curve.c.o
[8/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_decals.c.o
[9/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_flares.c.o
[10/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_image.c.o
[11/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_init.c.o
[12/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_light.c.o
[13/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_main.c.o
[14/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_marks.c.o
[15/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_mesh.c.o
[16/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_model.c.o
[17/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_scene.c.o
[18/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shade.c.o
[19/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shade_calc.c.o
[20/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shader.c.o
[21/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shadows.c.o
[22/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_sky.c.o
[23/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_surface.c.o
[24/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_world.c.o
[25/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_common.c.o
[26/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_font.c.o
[27/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_bmp.c.o
[28/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_jpg.c.o
[29/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_pcx.c.o
[30/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_png.c.o
[31/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_tga.c.o
[32/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_noise.c.o
[33/123] Linking C static library librenderer_opengl1_armeabi-v7a.a
[34/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_test.c.o
[35/123] Building C object CMakeFiles/etl.dir/src/qcommon/cmd.c.o
[36/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_load.c.o
[37/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_patch.c.o
[38/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_polylib.c.o
[39/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_trace.c.o
[40/123] Building C object CMakeFiles/etl.dir/src/qcommon/cvar.c.o
[41/123] Building C object CMakeFiles/etl.dir/src/qcommon/common.c.o
[42/123] Building C object CMakeFiles/etl.dir/src/qcommon/files.c.o
[43/123] Building C object CMakeFiles/etl.dir/src/qcommon/download.c.o
[44/123] Building C object CMakeFiles/etl.dir/src/qcommon/md4.c.o
[45/123] Building C object CMakeFiles/etl.dir/src/qcommon/huffman.c.o
[46/123] Building C object CMakeFiles/etl.dir/src/qcommon/md5.c.o
[47/123] Building C object CMakeFiles/etl.dir/src/qcommon/msg.c.o
[48/123] Building C object CMakeFiles/etl.dir/src/qcommon/puff.c.o
[49/123] Building C object CMakeFiles/etl.dir/src/qcommon/net_chan.c.o
[50/123] Building C object CMakeFiles/etl.dir/src/qcommon/net_ip.c.o
[51/123] Building C object CMakeFiles/etl.dir/src/qcommon/vm.c.o
[52/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_math.c.o
[53/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_shared.c.o
[54/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_unicode.c.o
[55/123] Building C object CMakeFiles/etl.dir/src/qcommon/update.c.o
[56/123] Building C object CMakeFiles/etl.dir/src/client/cl_avi.c.o
[57/123] Building C object CMakeFiles/etl.dir/src/server/sv_bot.c.o
[58/123] Building C object CMakeFiles/etl.dir/src/qcommon/vm_interpreted.c.o
[59/123] Building C object CMakeFiles/etl.dir/src/server/sv_ccmds.c.o
[60/123] Building C object CMakeFiles/etl.dir/src/server/sv_client.c.o
[61/123] Building C object CMakeFiles/etl.dir/src/server/sv_demo.c.o
[62/123] Building C object CMakeFiles/etl.dir/src/server/sv_demo_ext.c.o
[63/123] Building C object CMakeFiles/etl.dir/src/server/sv_game.c.o
[64/123] Building C object CMakeFiles/etl.dir/src/server/sv_init.c.o
[65/123] Building C object CMakeFiles/etl.dir/src/server/sv_main.c.o
[66/123] Building C object CMakeFiles/etl.dir/src/server/sv_net_chan.c.o
[67/123] Building C object CMakeFiles/etl.dir/src/server/sv_snapshot.c.o
[68/123] Building C object CMakeFiles/etl.dir/src/server/sv_tracker.c.o
[69/123] Building C object CMakeFiles/etl.dir/src/server/sv_wallhack.c.o
[70/123] Building C object CMakeFiles/etl.dir/src/server/sv_world.c.o
[71/123] Building C object CMakeFiles/etl.dir/src/client/cl_ogv.c.o
[72/123] Building C object CMakeFiles/etl.dir/src/client/cl_cgame.c.o
[73/123] Building C object CMakeFiles/etl.dir/src/client/cl_cinematic.c.o
[74/123] Building C object CMakeFiles/etl.dir/src/client/cl_console.c.o
[75/123] Building C object CMakeFiles/etl.dir/src/client/cl_demo.c.o
[76/123] Building C object CMakeFiles/etl.dir/src/client/cl_input.c.o
[77/123] Building C object CMakeFiles/etl.dir/src/client/cl_keys.c.o
[78/123] Building C object CMakeFiles/etl.dir/src/client/cl_main.c.o
[79/123] Building C object CMakeFiles/etl.dir/src/client/cl_net_chan.c.o
[80/123] Building C object CMakeFiles/etl.dir/src/client/cl_roq.c.o
[81/123] Building C object CMakeFiles/etl.dir/src/client/cl_parse.c.o
[82/123] Building C object CMakeFiles/etl.dir/src/client/cl_ui.c.o
[83/123] Building C object CMakeFiles/etl.dir/src/client/cl_scrn.c.o
[84/123] Building C object CMakeFiles/etl.dir/src/client/qal.c.o
[85/123] Building C object CMakeFiles/etl.dir/src/sys/sys_main.c.o
[88/123] Building C object CMakeFiles/etl.dir/src/client/snd_codec_ogg.c.o
[89/123] Building C object CMakeFiles/etl.dir/src/client/snd_codec_wav.c.o
[90/123] Building C object CMakeFiles/etl.dir/src/client/snd_dma.c.o
[91/123] Building C object CMakeFiles/etl.dir/src/client/snd_main.c.o
[92/123] Building C object CMakeFiles/etl.dir/src/client/snd_mem.c.o
[93/123] Building C object CMakeFiles/etl.dir/src/client/snd_mix.c.o
[94/123] Building C object CMakeFiles/etl.dir/src/client/snd_openal.c.o
[95/123] Building C object CMakeFiles/etl.dir/src/client/snd_wavelet.c.o
[96/123] Building C object CMakeFiles/etl.dir/src/botlib/be_interface.c.o
[97/123] Building C object CMakeFiles/etl.dir/src/botlib/l_memory.c.o
[98/123] Building C object CMakeFiles/etl.dir/src/botlib/l_precomp.c.o
[99/123] Building C object CMakeFiles/etl.dir/src/botlib/l_script.c.o
[100/123] Building C object CMakeFiles/etl.dir/src/sys/con_log.c.o
[101/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_glimp.c.o
[102/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_input.c.o
[103/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_snd.c.o
[104/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/log.cpp.o
[105/123] Building C object CMakeFiles/etl.dir/src/qcommon/json_stubs.c.o
[106/123] Building CXX object CMakeFiles/etl.dir/src/qcommon/i18n_main.cpp.o
[107/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/dictionary_manager.cpp.o
[108/123] Building C object CMakeFiles/etl.dir/src/qcommon/i18n_findlocale.c.o
[109/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/dictionary.cpp.o
[110/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/iconv.cpp.o
[111/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/unix_file_system.cpp.o
[112/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/language.cpp.o
[113/123] Building C object CMakeFiles/etl.dir/src/irc/htable.c.o
[114/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/plural_forms.cpp.o
[115/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/po_parser.cpp.o
[116/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/tinygettext.cpp.o
[117/123] Building C object CMakeFiles/etl.dir/src/db/db_sqlite3.c.o
[118/123] Building C object CMakeFiles/etl.dir/src/irc/irc_client.c.o
[119/123] Building C object CMakeFiles/etl.dir/src/qcommon/dl_main_curl.c.o
[120/123] Building C object CMakeFiles/etl.dir/src/sys/sys_unix.c.o
[121/123] Building C object CMakeFiles/etl.dir/src/db/db_sql_cmds.c.o
[122/123] Building C object CMakeFiles/etl.dir/src/sys/con_tty.c.o
[123/123] Linking CXX executable etl
FAILED: : && /home/rafal/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/rafal/Android/Sdk/ndk-bundle/sysroot -isystem /home/rafal/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -Os -DNDEBUG -ffast-math -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a --sysroot /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections -Wl,-z,nocopyreloc -pie -fPIE CMakeFiles/etl.dir/src/qcommon/cm_load.c.o CMakeFiles/etl.dir/src/qcommon/cm_patch.c.o CMakeFiles/etl.dir/src/qcommon/cm_polylib.c.o CMakeFiles/etl.dir/src/qcommon/cm_test.c.o CMakeFiles/etl.dir/src/qcommon/cm_trace.c.o CMakeFiles/etl.dir/src/qcommon/cmd.c.o CMakeFiles/etl.dir/src/qcommon/common.c.o CMakeFiles/etl.dir/src/qcommon/cvar.c.o CMakeFiles/etl.dir/src/qcommon/download.c.o CMakeFiles/etl.dir/src/qcommon/files.c.o CMakeFiles/etl.dir/src/qcommon/huffman.c.o CMakeFiles/etl.dir/src/qcommon/md4.c.o CMakeFiles/etl.dir/src/qcommon/md5.c.o CMakeFiles/etl.dir/src/qcommon/msg.c.o CMakeFiles/etl.dir/src/qcommon/net_chan.c.o CMakeFiles/etl.dir/src/qcommon/net_ip.c.o CMakeFiles/etl.dir/src/qcommon/puff.c.o CMakeFiles/etl.dir/src/qcommon/q_math.c.o CMakeFiles/etl.dir/src/qcommon/q_shared.c.o CMakeFiles/etl.dir/src/qcommon/q_unicode.c.o CMakeFiles/etl.dir/src/qcommon/update.c.o CMakeFiles/etl.dir/src/qcommon/vm.c.o CMakeFiles/etl.dir/src/qcommon/vm_interpreted.c.o CMakeFiles/etl.dir/src/server/sv_bot.c.o CMakeFiles/etl.dir/src/server/sv_ccmds.c.o CMakeFiles/etl.dir/src/server/sv_client.c.o CMakeFiles/etl.dir/src/server/sv_demo.c.o CMakeFiles/etl.dir/src/server/sv_demo_ext.c.o CMakeFiles/etl.dir/src/server/sv_game.c.o CMakeFiles/etl.dir/src/server/sv_init.c.o CMakeFiles/etl.dir/src/server/sv_main.c.o CMakeFiles/etl.dir/src/server/sv_net_chan.c.o CMakeFiles/etl.dir/src/server/sv_snapshot.c.o CMakeFiles/etl.dir/src/server/sv_tracker.c.o CMakeFiles/etl.dir/src/server/sv_wallhack.c.o CMakeFiles/etl.dir/src/server/sv_world.c.o CMakeFiles/etl.dir/src/client/cl_avi.c.o CMakeFiles/etl.dir/src/client/cl_cgame.c.o CMakeFiles/etl.dir/src/client/cl_cinematic.c.o CMakeFiles/etl.dir/src/client/cl_console.c.o CMakeFiles/etl.dir/src/client/cl_demo.c.o CMakeFiles/etl.dir/src/client/cl_input.c.o CMakeFiles/etl.dir/src/client/cl_keys.c.o CMakeFiles/etl.dir/src/client/cl_main.c.o CMakeFiles/etl.dir/src/client/cl_net_chan.c.o CMakeFiles/etl.dir/src/client/cl_ogv.c.o CMakeFiles/etl.dir/src/client/cl_parse.c.o CMakeFiles/etl.dir/src/client/cl_roq.c.o CMakeFiles/etl.dir/src/client/cl_scrn.c.o CMakeFiles/etl.dir/src/client/cl_ui.c.o CMakeFiles/etl.dir/src/client/qal.c.o CMakeFiles/etl.dir/src/client/snd_adpcm.c.o CMakeFiles/etl.dir/src/client/snd_codec.c.o CMakeFiles/etl.dir/src/client/snd_codec_ogg.c.o CMakeFiles/etl.dir/src/client/snd_codec_wav.c.o CMakeFiles/etl.dir/src/client/snd_dma.c.o CMakeFiles/etl.dir/src/client/snd_main.c.o CMakeFiles/etl.dir/src/client/snd_mem.c.o CMakeFiles/etl.dir/src/client/snd_mix.c.o CMakeFiles/etl.dir/src/client/snd_openal.c.o CMakeFiles/etl.dir/src/client/snd_wavelet.c.o CMakeFiles/etl.dir/src/botlib/be_interface.c.o CMakeFiles/etl.dir/src/botlib/l_memory.c.o CMakeFiles/etl.dir/src/botlib/l_precomp.c.o CMakeFiles/etl.dir/src/botlib/l_script.c.o CMakeFiles/etl.dir/src/sys/sys_main.c.o CMakeFiles/etl.dir/src/sys/con_log.c.o CMakeFiles/etl.dir/src/sdl/sdl_glimp.c.o CMakeFiles/etl.dir/src/sdl/sdl_input.c.o CMakeFiles/etl.dir/src/sdl/sdl_snd.c.o CMakeFiles/etl.dir/src/qcommon/json_stubs.c.o CMakeFiles/etl.dir/src/qcommon/i18n_main.cpp.o CMakeFiles/etl.dir/src/qcommon/i18n_findlocale.c.o CMakeFiles/etl.dir/src/tinygettext/dictionary.cpp.o CMakeFiles/etl.dir/src/tinygettext/dictionary_manager.cpp.o CMakeFiles/etl.dir/src/tinygettext/iconv.cpp.o CMakeFiles/etl.dir/src/tinygettext/language.cpp.o CMakeFiles/etl.dir/src/tinygettext/log.cpp.o CMakeFiles/etl.dir/src/tinygettext/plural_forms.cpp.o CMakeFiles/etl.dir/src/tinygettext/po_parser.cpp.o CMakeFiles/etl.dir/src/tinygettext/tinygettext.cpp.o CMakeFiles/etl.dir/src/tinygettext/unix_file_system.cpp.o CMakeFiles/etl.dir/src/irc/htable.c.o CMakeFiles/etl.dir/src/irc/irc_client.c.o CMakeFiles/etl.dir/src/qcommon/dl_main_curl.c.o CMakeFiles/etl.dir/src/db/db_sqlite3.c.o CMakeFiles/etl.dir/src/db/db_sql_cmds.c.o CMakeFiles/etl.dir/src/sys/sys_unix.c.o CMakeFiles/etl.dir/src/sys/con_tty.c.o -o etl /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libvorbisfile.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libogg.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libvorbis.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libcurl.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libsqlite3.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libz.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libminizip.a librenderer_opengl1_armeabi-v7a.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libSDL2main.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libSDL2.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libGLESv1_CM.so /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libjpeg.a -l'm' -latomic -lm "/home/rafal/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a" && :
/home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/crtbegin_dynamic.o:crtbegin.c:function _start: error: undefined reference to 'main'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
> Task :app:externalNativeBuildRelease FAILED
17 actionable tasks: 15 executed, 2 up-to-date
I want to make it link properly so I can move forward with my build.
android cmake android-ndk android-gradle sdl-2
After succesfull compiling the code. Linking process begin and there where issue show up.
I did checked main function and it exist in code, checked cmake linking sdl and I suppose is decend. All the libs are static and I did noticed Gradle is using crtbegin_dynamic in linking process shouldn't be used crtbegin_static instead?
Main function:
int main(int argc, char **argv)
{
char commandLine[MAX_STRING_CHARS] = { 0 };
Sys_PlatformInit();
// Set the initial time base
Sys_Milliseconds();
#ifdef __APPLE__
// This is passed if we are launched by double-clicking
if (argc >= 2 && Q_strncmp(argv[1], "-psn", 4) == 0)
{
argc = 1;
}
#endif
Sys_ParseArgs(argc, argv);
#if defined(__APPLE__) && !defined(DEDICATED)
// argv[0] would be /Users/seth/etlegacy/etl.app/Contents/MacOS
// But on OS X we want to pretend the binary path is the .app's parent
// So that way the base folder is right next to the .app allowing
{
char parentdir[1024];
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
if (!url)
{
Sys_Dialog(DT_ERROR, "A CFURL for the app bundle could not be found.", "Can't set Sys_SetBinaryPath");
Sys_Exit(EXIT_FAILURE);
}
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
if (!url2 || !CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, 1024))
{
Sys_Dialog(DT_ERROR, "CFURLGetFileSystemRepresentation returned an error when finding the app bundle's parent directory.", "Can't set Sys_SetBinaryPath");
Sys_Exit(EXIT_FAILURE);
}
Sys_SetBinaryPath(parentdir);
CFRelease(url);
CFRelease(url2);
}
#else
Sys_SetBinaryPath(Sys_Dirname(argv[0]));
#endif
Sys_SetDefaultInstallPath(DEFAULT_BASEDIR); // Sys_BinaryPath() by default
// Concatenate the command line for passing to Com_Init
Sys_BuildCommandLine(argc, argv, commandLine, sizeof(commandLine));
Com_Init(commandLine);
NET_Init();
Sys_SetUpConsoleAndSignals();
#ifdef _WIN32
#ifndef DEDICATED
if (com_viewlog->integer)
{
Sys_ShowConsoleWindow(1, qfalse);
}
#endif
Sys_Splash(qfalse);
{
char cwd[MAX_OSPATH];
_getcwd(cwd, sizeof(cwd));
Com_Printf("Working directory: %sn", cwd);
}
// hide the early console since we've reached the point where we
// have a working graphics subsystems
#ifndef LEGACY_DEBUG
if (!com_dedicated->integer && !com_viewlog->integer)
{
Sys_ShowConsoleWindow(0, qfalse);
}
#endif
#endif
Sys_GameLoop();
return EXIT_SUCCESS;
}
Part of cmake file:
target_link_libraries(etl
${CLIENT_LIBRARIES}
${SDL_LIBRARIES}
${OS_LIBRARIES} # Has to go after cURL and SDL
)
Here is the build log:
> Task :app:compileReleaseJavaWithJavac
> Task :app:externalNativeBuildRelease
Build ui.mp.armeabi-v7a armeabi-v7a
[1/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui /ui_atoms.c.o
[2/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_main.c.o
[3/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_gameinfo.c.o
[4/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_loadpanel.c.o
[5/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_parse.c.o
[6/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_menu.c.o
[7/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/game/bg_misc.c.o
[8/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_menuitem.c.o
[9/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_script.c.o
[10/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_shared.c.o
[11/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/ui/ui_syscalls.c.o
[12/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_math.c.o
[13/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_shared.c.o
[14/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/qcommon/q_unicode.c.o
[15/16] Building C object CMakeFiles/ui.mp.armeabi-v7a.dir/src/game/bg_classes.c.o
[16/16] Linking C shared module legacy/ui.mp.armeabi-v7a.so
Build etl armeabi-v7a
[1/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_animation_mdm.c.o
[2/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_animation_mds.c.o
[3/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_backend.c.o
[4/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_bsp.c.o
[5/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_cmds.c.o
[6/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_cmesh.c.o
[7/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_curve.c.o
[8/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_decals.c.o
[9/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_flares.c.o
[10/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_image.c.o
[11/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_init.c.o
[12/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_light.c.o
[13/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_main.c.o
[14/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_marks.c.o
[15/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_mesh.c.o
[16/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_model.c.o
[17/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_scene.c.o
[18/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shade.c.o
[19/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shade_calc.c.o
[20/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shader.c.o
[21/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_shadows.c.o
[22/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_sky.c.o
[23/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_surface.c.o
[24/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/rendererGLES/tr_world.c.o
[25/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_common.c.o
[26/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_font.c.o
[27/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_bmp.c.o
[28/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_jpg.c.o
[29/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_pcx.c.o
[30/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_png.c.o
[31/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_image_tga.c.o
[32/123] Building C object CMakeFiles/renderer_opengl1_armeabi-v7a.dir/src/renderercommon/tr_noise.c.o
[33/123] Linking C static library librenderer_opengl1_armeabi-v7a.a
[34/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_test.c.o
[35/123] Building C object CMakeFiles/etl.dir/src/qcommon/cmd.c.o
[36/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_load.c.o
[37/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_patch.c.o
[38/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_polylib.c.o
[39/123] Building C object CMakeFiles/etl.dir/src/qcommon/cm_trace.c.o
[40/123] Building C object CMakeFiles/etl.dir/src/qcommon/cvar.c.o
[41/123] Building C object CMakeFiles/etl.dir/src/qcommon/common.c.o
[42/123] Building C object CMakeFiles/etl.dir/src/qcommon/files.c.o
[43/123] Building C object CMakeFiles/etl.dir/src/qcommon/download.c.o
[44/123] Building C object CMakeFiles/etl.dir/src/qcommon/md4.c.o
[45/123] Building C object CMakeFiles/etl.dir/src/qcommon/huffman.c.o
[46/123] Building C object CMakeFiles/etl.dir/src/qcommon/md5.c.o
[47/123] Building C object CMakeFiles/etl.dir/src/qcommon/msg.c.o
[48/123] Building C object CMakeFiles/etl.dir/src/qcommon/puff.c.o
[49/123] Building C object CMakeFiles/etl.dir/src/qcommon/net_chan.c.o
[50/123] Building C object CMakeFiles/etl.dir/src/qcommon/net_ip.c.o
[51/123] Building C object CMakeFiles/etl.dir/src/qcommon/vm.c.o
[52/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_math.c.o
[53/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_shared.c.o
[54/123] Building C object CMakeFiles/etl.dir/src/qcommon/q_unicode.c.o
[55/123] Building C object CMakeFiles/etl.dir/src/qcommon/update.c.o
[56/123] Building C object CMakeFiles/etl.dir/src/client/cl_avi.c.o
[57/123] Building C object CMakeFiles/etl.dir/src/server/sv_bot.c.o
[58/123] Building C object CMakeFiles/etl.dir/src/qcommon/vm_interpreted.c.o
[59/123] Building C object CMakeFiles/etl.dir/src/server/sv_ccmds.c.o
[60/123] Building C object CMakeFiles/etl.dir/src/server/sv_client.c.o
[61/123] Building C object CMakeFiles/etl.dir/src/server/sv_demo.c.o
[62/123] Building C object CMakeFiles/etl.dir/src/server/sv_demo_ext.c.o
[63/123] Building C object CMakeFiles/etl.dir/src/server/sv_game.c.o
[64/123] Building C object CMakeFiles/etl.dir/src/server/sv_init.c.o
[65/123] Building C object CMakeFiles/etl.dir/src/server/sv_main.c.o
[66/123] Building C object CMakeFiles/etl.dir/src/server/sv_net_chan.c.o
[67/123] Building C object CMakeFiles/etl.dir/src/server/sv_snapshot.c.o
[68/123] Building C object CMakeFiles/etl.dir/src/server/sv_tracker.c.o
[69/123] Building C object CMakeFiles/etl.dir/src/server/sv_wallhack.c.o
[70/123] Building C object CMakeFiles/etl.dir/src/server/sv_world.c.o
[71/123] Building C object CMakeFiles/etl.dir/src/client/cl_ogv.c.o
[72/123] Building C object CMakeFiles/etl.dir/src/client/cl_cgame.c.o
[73/123] Building C object CMakeFiles/etl.dir/src/client/cl_cinematic.c.o
[74/123] Building C object CMakeFiles/etl.dir/src/client/cl_console.c.o
[75/123] Building C object CMakeFiles/etl.dir/src/client/cl_demo.c.o
[76/123] Building C object CMakeFiles/etl.dir/src/client/cl_input.c.o
[77/123] Building C object CMakeFiles/etl.dir/src/client/cl_keys.c.o
[78/123] Building C object CMakeFiles/etl.dir/src/client/cl_main.c.o
[79/123] Building C object CMakeFiles/etl.dir/src/client/cl_net_chan.c.o
[80/123] Building C object CMakeFiles/etl.dir/src/client/cl_roq.c.o
[81/123] Building C object CMakeFiles/etl.dir/src/client/cl_parse.c.o
[82/123] Building C object CMakeFiles/etl.dir/src/client/cl_ui.c.o
[83/123] Building C object CMakeFiles/etl.dir/src/client/cl_scrn.c.o
[84/123] Building C object CMakeFiles/etl.dir/src/client/qal.c.o
[85/123] Building C object CMakeFiles/etl.dir/src/sys/sys_main.c.o
[88/123] Building C object CMakeFiles/etl.dir/src/client/snd_codec_ogg.c.o
[89/123] Building C object CMakeFiles/etl.dir/src/client/snd_codec_wav.c.o
[90/123] Building C object CMakeFiles/etl.dir/src/client/snd_dma.c.o
[91/123] Building C object CMakeFiles/etl.dir/src/client/snd_main.c.o
[92/123] Building C object CMakeFiles/etl.dir/src/client/snd_mem.c.o
[93/123] Building C object CMakeFiles/etl.dir/src/client/snd_mix.c.o
[94/123] Building C object CMakeFiles/etl.dir/src/client/snd_openal.c.o
[95/123] Building C object CMakeFiles/etl.dir/src/client/snd_wavelet.c.o
[96/123] Building C object CMakeFiles/etl.dir/src/botlib/be_interface.c.o
[97/123] Building C object CMakeFiles/etl.dir/src/botlib/l_memory.c.o
[98/123] Building C object CMakeFiles/etl.dir/src/botlib/l_precomp.c.o
[99/123] Building C object CMakeFiles/etl.dir/src/botlib/l_script.c.o
[100/123] Building C object CMakeFiles/etl.dir/src/sys/con_log.c.o
[101/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_glimp.c.o
[102/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_input.c.o
[103/123] Building C object CMakeFiles/etl.dir/src/sdl/sdl_snd.c.o
[104/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/log.cpp.o
[105/123] Building C object CMakeFiles/etl.dir/src/qcommon/json_stubs.c.o
[106/123] Building CXX object CMakeFiles/etl.dir/src/qcommon/i18n_main.cpp.o
[107/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/dictionary_manager.cpp.o
[108/123] Building C object CMakeFiles/etl.dir/src/qcommon/i18n_findlocale.c.o
[109/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/dictionary.cpp.o
[110/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/iconv.cpp.o
[111/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/unix_file_system.cpp.o
[112/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/language.cpp.o
[113/123] Building C object CMakeFiles/etl.dir/src/irc/htable.c.o
[114/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/plural_forms.cpp.o
[115/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/po_parser.cpp.o
[116/123] Building CXX object CMakeFiles/etl.dir/src/tinygettext/tinygettext.cpp.o
[117/123] Building C object CMakeFiles/etl.dir/src/db/db_sqlite3.c.o
[118/123] Building C object CMakeFiles/etl.dir/src/irc/irc_client.c.o
[119/123] Building C object CMakeFiles/etl.dir/src/qcommon/dl_main_curl.c.o
[120/123] Building C object CMakeFiles/etl.dir/src/sys/sys_unix.c.o
[121/123] Building C object CMakeFiles/etl.dir/src/db/db_sql_cmds.c.o
[122/123] Building C object CMakeFiles/etl.dir/src/sys/con_tty.c.o
[123/123] Linking CXX executable etl
FAILED: : && /home/rafal/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/rafal/Android/Sdk/ndk-bundle/sysroot -isystem /home/rafal/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -Os -DNDEBUG -ffast-math -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a --sysroot /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections -Wl,-z,nocopyreloc -pie -fPIE CMakeFiles/etl.dir/src/qcommon/cm_load.c.o CMakeFiles/etl.dir/src/qcommon/cm_patch.c.o CMakeFiles/etl.dir/src/qcommon/cm_polylib.c.o CMakeFiles/etl.dir/src/qcommon/cm_test.c.o CMakeFiles/etl.dir/src/qcommon/cm_trace.c.o CMakeFiles/etl.dir/src/qcommon/cmd.c.o CMakeFiles/etl.dir/src/qcommon/common.c.o CMakeFiles/etl.dir/src/qcommon/cvar.c.o CMakeFiles/etl.dir/src/qcommon/download.c.o CMakeFiles/etl.dir/src/qcommon/files.c.o CMakeFiles/etl.dir/src/qcommon/huffman.c.o CMakeFiles/etl.dir/src/qcommon/md4.c.o CMakeFiles/etl.dir/src/qcommon/md5.c.o CMakeFiles/etl.dir/src/qcommon/msg.c.o CMakeFiles/etl.dir/src/qcommon/net_chan.c.o CMakeFiles/etl.dir/src/qcommon/net_ip.c.o CMakeFiles/etl.dir/src/qcommon/puff.c.o CMakeFiles/etl.dir/src/qcommon/q_math.c.o CMakeFiles/etl.dir/src/qcommon/q_shared.c.o CMakeFiles/etl.dir/src/qcommon/q_unicode.c.o CMakeFiles/etl.dir/src/qcommon/update.c.o CMakeFiles/etl.dir/src/qcommon/vm.c.o CMakeFiles/etl.dir/src/qcommon/vm_interpreted.c.o CMakeFiles/etl.dir/src/server/sv_bot.c.o CMakeFiles/etl.dir/src/server/sv_ccmds.c.o CMakeFiles/etl.dir/src/server/sv_client.c.o CMakeFiles/etl.dir/src/server/sv_demo.c.o CMakeFiles/etl.dir/src/server/sv_demo_ext.c.o CMakeFiles/etl.dir/src/server/sv_game.c.o CMakeFiles/etl.dir/src/server/sv_init.c.o CMakeFiles/etl.dir/src/server/sv_main.c.o CMakeFiles/etl.dir/src/server/sv_net_chan.c.o CMakeFiles/etl.dir/src/server/sv_snapshot.c.o CMakeFiles/etl.dir/src/server/sv_tracker.c.o CMakeFiles/etl.dir/src/server/sv_wallhack.c.o CMakeFiles/etl.dir/src/server/sv_world.c.o CMakeFiles/etl.dir/src/client/cl_avi.c.o CMakeFiles/etl.dir/src/client/cl_cgame.c.o CMakeFiles/etl.dir/src/client/cl_cinematic.c.o CMakeFiles/etl.dir/src/client/cl_console.c.o CMakeFiles/etl.dir/src/client/cl_demo.c.o CMakeFiles/etl.dir/src/client/cl_input.c.o CMakeFiles/etl.dir/src/client/cl_keys.c.o CMakeFiles/etl.dir/src/client/cl_main.c.o CMakeFiles/etl.dir/src/client/cl_net_chan.c.o CMakeFiles/etl.dir/src/client/cl_ogv.c.o CMakeFiles/etl.dir/src/client/cl_parse.c.o CMakeFiles/etl.dir/src/client/cl_roq.c.o CMakeFiles/etl.dir/src/client/cl_scrn.c.o CMakeFiles/etl.dir/src/client/cl_ui.c.o CMakeFiles/etl.dir/src/client/qal.c.o CMakeFiles/etl.dir/src/client/snd_adpcm.c.o CMakeFiles/etl.dir/src/client/snd_codec.c.o CMakeFiles/etl.dir/src/client/snd_codec_ogg.c.o CMakeFiles/etl.dir/src/client/snd_codec_wav.c.o CMakeFiles/etl.dir/src/client/snd_dma.c.o CMakeFiles/etl.dir/src/client/snd_main.c.o CMakeFiles/etl.dir/src/client/snd_mem.c.o CMakeFiles/etl.dir/src/client/snd_mix.c.o CMakeFiles/etl.dir/src/client/snd_openal.c.o CMakeFiles/etl.dir/src/client/snd_wavelet.c.o CMakeFiles/etl.dir/src/botlib/be_interface.c.o CMakeFiles/etl.dir/src/botlib/l_memory.c.o CMakeFiles/etl.dir/src/botlib/l_precomp.c.o CMakeFiles/etl.dir/src/botlib/l_script.c.o CMakeFiles/etl.dir/src/sys/sys_main.c.o CMakeFiles/etl.dir/src/sys/con_log.c.o CMakeFiles/etl.dir/src/sdl/sdl_glimp.c.o CMakeFiles/etl.dir/src/sdl/sdl_input.c.o CMakeFiles/etl.dir/src/sdl/sdl_snd.c.o CMakeFiles/etl.dir/src/qcommon/json_stubs.c.o CMakeFiles/etl.dir/src/qcommon/i18n_main.cpp.o CMakeFiles/etl.dir/src/qcommon/i18n_findlocale.c.o CMakeFiles/etl.dir/src/tinygettext/dictionary.cpp.o CMakeFiles/etl.dir/src/tinygettext/dictionary_manager.cpp.o CMakeFiles/etl.dir/src/tinygettext/iconv.cpp.o CMakeFiles/etl.dir/src/tinygettext/language.cpp.o CMakeFiles/etl.dir/src/tinygettext/log.cpp.o CMakeFiles/etl.dir/src/tinygettext/plural_forms.cpp.o CMakeFiles/etl.dir/src/tinygettext/po_parser.cpp.o CMakeFiles/etl.dir/src/tinygettext/tinygettext.cpp.o CMakeFiles/etl.dir/src/tinygettext/unix_file_system.cpp.o CMakeFiles/etl.dir/src/irc/htable.c.o CMakeFiles/etl.dir/src/irc/irc_client.c.o CMakeFiles/etl.dir/src/qcommon/dl_main_curl.c.o CMakeFiles/etl.dir/src/db/db_sqlite3.c.o CMakeFiles/etl.dir/src/db/db_sql_cmds.c.o CMakeFiles/etl.dir/src/sys/sys_unix.c.o CMakeFiles/etl.dir/src/sys/con_tty.c.o -o etl /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libvorbisfile.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libogg.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libvorbis.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libcurl.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libsqlite3.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libz.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libminizip.a librenderer_opengl1_armeabi-v7a.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libSDL2main.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libSDL2.a /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libGLESv1_CM.so /home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/libjpeg.a -l'm' -latomic -lm "/home/rafal/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a" && :
/home/rafal/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/lib/crtbegin_dynamic.o:crtbegin.c:function _start: error: undefined reference to 'main'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
> Task :app:externalNativeBuildRelease FAILED
17 actionable tasks: 15 executed, 2 up-to-date
I want to make it link properly so I can move forward with my build.
android cmake android-ndk android-gradle sdl-2
android cmake android-ndk android-gradle sdl-2
asked Dec 26 '18 at 21:45
rafal1137rafal1137
136
136
1
SDL_main.h
redefinesmain
asSDL_main
for some platforms, android included. Is it java-less build? Take a look at hg.libsdl.org/SDL/file/fbce19db4e53/docs/README-android.md andandroid-project
directory in SDL sources.
– keltar
Dec 27 '18 at 7:20
add a comment |
1
SDL_main.h
redefinesmain
asSDL_main
for some platforms, android included. Is it java-less build? Take a look at hg.libsdl.org/SDL/file/fbce19db4e53/docs/README-android.md andandroid-project
directory in SDL sources.
– keltar
Dec 27 '18 at 7:20
1
1
SDL_main.h
redefines main
as SDL_main
for some platforms, android included. Is it java-less build? Take a look at hg.libsdl.org/SDL/file/fbce19db4e53/docs/README-android.md and android-project
directory in SDL sources.– keltar
Dec 27 '18 at 7:20
SDL_main.h
redefines main
as SDL_main
for some platforms, android included. Is it java-less build? Take a look at hg.libsdl.org/SDL/file/fbce19db4e53/docs/README-android.md and android-project
directory in SDL sources.– keltar
Dec 27 '18 at 7:20
add a comment |
2 Answers
2
active
oldest
votes
The C file that contains main() should be one of the sources of the etl target, not of one of the libraries.
This is where main function is [85/123] Building C object CMakeFiles/etl.dir/src/sys/sys_main.c
– rafal1137
Dec 27 '18 at 11:39
OK, I didn't see that on my phone screen. If your sys_main.c#include "SDL_main.h"
, then @keltar is right. The SDL library expects you to build a JNI shared lib instead of an executable.
– Alex Cohn
Dec 27 '18 at 11:59
Yes but now can I link static libs to shared one? Here is a log pastebin.com/KM43UGed
– rafal1137
Dec 27 '18 at 13:00
It looks as if you didn't definetarget_link_libraries
for etl_lib.
– Alex Cohn
Dec 27 '18 at 14:39
Should I use target_link_libraries(etl etl-lib) or target_link_libraries(etl-lib another-lib) @Alex Cohn ? Because the 2nd one gives me undefined reference to main again :)
– rafal1137
Dec 27 '18 at 15:18
|
show 2 more comments
So after fixing all those undefined reference errors I did hitted a wall there still some to manage but I am not sure how to manage them.
There are 2 files tr_init.c and tr_shade.c which are/were throwing those errors
I kinda did fixed those in tr_init.c
tr_init.c
Before
if (qglLockArraysEXT)
{
primitives = 2;
}
Ren_Print("compiled vertex arrays: %sn", enablestrings[qglLockArraysEXT != 0]);
Afrer
if (&qglLockArraysEXT)
{
primitives = 2;
}
Ren_Print("compiled vertex arrays: %sn", enablestrings[&qglLockArraysEXT != 0]);
tr_shade.c
if (qglLockArraysEXT)
{
qglLockArraysEXT(0, input->numVertexes);
Ren_LogComment("glLockArraysEXTn");
}
if (qglUnlockArraysEXT)
{
qglUnlockArraysEXT();
Ren_LogComment("glUnlockArraysEXTn");
}
Here are errors
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:819: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1429: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1493: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1493: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1604: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1604: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1666: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1666: error: undefined reference to 'glUnlockArraysEXT'
And what is most important line does not respond to those references
1st reference point to 201 line in file
Ok looks like it does not support this extension so I commented them out
– rafal1137
Dec 29 '18 at 20:13
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53937505%2fandroid-gradle-build-error-undefined-reference-to-main%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The C file that contains main() should be one of the sources of the etl target, not of one of the libraries.
This is where main function is [85/123] Building C object CMakeFiles/etl.dir/src/sys/sys_main.c
– rafal1137
Dec 27 '18 at 11:39
OK, I didn't see that on my phone screen. If your sys_main.c#include "SDL_main.h"
, then @keltar is right. The SDL library expects you to build a JNI shared lib instead of an executable.
– Alex Cohn
Dec 27 '18 at 11:59
Yes but now can I link static libs to shared one? Here is a log pastebin.com/KM43UGed
– rafal1137
Dec 27 '18 at 13:00
It looks as if you didn't definetarget_link_libraries
for etl_lib.
– Alex Cohn
Dec 27 '18 at 14:39
Should I use target_link_libraries(etl etl-lib) or target_link_libraries(etl-lib another-lib) @Alex Cohn ? Because the 2nd one gives me undefined reference to main again :)
– rafal1137
Dec 27 '18 at 15:18
|
show 2 more comments
The C file that contains main() should be one of the sources of the etl target, not of one of the libraries.
This is where main function is [85/123] Building C object CMakeFiles/etl.dir/src/sys/sys_main.c
– rafal1137
Dec 27 '18 at 11:39
OK, I didn't see that on my phone screen. If your sys_main.c#include "SDL_main.h"
, then @keltar is right. The SDL library expects you to build a JNI shared lib instead of an executable.
– Alex Cohn
Dec 27 '18 at 11:59
Yes but now can I link static libs to shared one? Here is a log pastebin.com/KM43UGed
– rafal1137
Dec 27 '18 at 13:00
It looks as if you didn't definetarget_link_libraries
for etl_lib.
– Alex Cohn
Dec 27 '18 at 14:39
Should I use target_link_libraries(etl etl-lib) or target_link_libraries(etl-lib another-lib) @Alex Cohn ? Because the 2nd one gives me undefined reference to main again :)
– rafal1137
Dec 27 '18 at 15:18
|
show 2 more comments
The C file that contains main() should be one of the sources of the etl target, not of one of the libraries.
The C file that contains main() should be one of the sources of the etl target, not of one of the libraries.
answered Dec 27 '18 at 8:08
Alex CohnAlex Cohn
41.1k552187
41.1k552187
This is where main function is [85/123] Building C object CMakeFiles/etl.dir/src/sys/sys_main.c
– rafal1137
Dec 27 '18 at 11:39
OK, I didn't see that on my phone screen. If your sys_main.c#include "SDL_main.h"
, then @keltar is right. The SDL library expects you to build a JNI shared lib instead of an executable.
– Alex Cohn
Dec 27 '18 at 11:59
Yes but now can I link static libs to shared one? Here is a log pastebin.com/KM43UGed
– rafal1137
Dec 27 '18 at 13:00
It looks as if you didn't definetarget_link_libraries
for etl_lib.
– Alex Cohn
Dec 27 '18 at 14:39
Should I use target_link_libraries(etl etl-lib) or target_link_libraries(etl-lib another-lib) @Alex Cohn ? Because the 2nd one gives me undefined reference to main again :)
– rafal1137
Dec 27 '18 at 15:18
|
show 2 more comments
This is where main function is [85/123] Building C object CMakeFiles/etl.dir/src/sys/sys_main.c
– rafal1137
Dec 27 '18 at 11:39
OK, I didn't see that on my phone screen. If your sys_main.c#include "SDL_main.h"
, then @keltar is right. The SDL library expects you to build a JNI shared lib instead of an executable.
– Alex Cohn
Dec 27 '18 at 11:59
Yes but now can I link static libs to shared one? Here is a log pastebin.com/KM43UGed
– rafal1137
Dec 27 '18 at 13:00
It looks as if you didn't definetarget_link_libraries
for etl_lib.
– Alex Cohn
Dec 27 '18 at 14:39
Should I use target_link_libraries(etl etl-lib) or target_link_libraries(etl-lib another-lib) @Alex Cohn ? Because the 2nd one gives me undefined reference to main again :)
– rafal1137
Dec 27 '18 at 15:18
This is where main function is [85/123] Building C object CMakeFiles/etl.dir/src/sys/sys_main.c
– rafal1137
Dec 27 '18 at 11:39
This is where main function is [85/123] Building C object CMakeFiles/etl.dir/src/sys/sys_main.c
– rafal1137
Dec 27 '18 at 11:39
OK, I didn't see that on my phone screen. If your sys_main.c
#include "SDL_main.h"
, then @keltar is right. The SDL library expects you to build a JNI shared lib instead of an executable.– Alex Cohn
Dec 27 '18 at 11:59
OK, I didn't see that on my phone screen. If your sys_main.c
#include "SDL_main.h"
, then @keltar is right. The SDL library expects you to build a JNI shared lib instead of an executable.– Alex Cohn
Dec 27 '18 at 11:59
Yes but now can I link static libs to shared one? Here is a log pastebin.com/KM43UGed
– rafal1137
Dec 27 '18 at 13:00
Yes but now can I link static libs to shared one? Here is a log pastebin.com/KM43UGed
– rafal1137
Dec 27 '18 at 13:00
It looks as if you didn't define
target_link_libraries
for etl_lib.– Alex Cohn
Dec 27 '18 at 14:39
It looks as if you didn't define
target_link_libraries
for etl_lib.– Alex Cohn
Dec 27 '18 at 14:39
Should I use target_link_libraries(etl etl-lib) or target_link_libraries(etl-lib another-lib) @Alex Cohn ? Because the 2nd one gives me undefined reference to main again :)
– rafal1137
Dec 27 '18 at 15:18
Should I use target_link_libraries(etl etl-lib) or target_link_libraries(etl-lib another-lib) @Alex Cohn ? Because the 2nd one gives me undefined reference to main again :)
– rafal1137
Dec 27 '18 at 15:18
|
show 2 more comments
So after fixing all those undefined reference errors I did hitted a wall there still some to manage but I am not sure how to manage them.
There are 2 files tr_init.c and tr_shade.c which are/were throwing those errors
I kinda did fixed those in tr_init.c
tr_init.c
Before
if (qglLockArraysEXT)
{
primitives = 2;
}
Ren_Print("compiled vertex arrays: %sn", enablestrings[qglLockArraysEXT != 0]);
Afrer
if (&qglLockArraysEXT)
{
primitives = 2;
}
Ren_Print("compiled vertex arrays: %sn", enablestrings[&qglLockArraysEXT != 0]);
tr_shade.c
if (qglLockArraysEXT)
{
qglLockArraysEXT(0, input->numVertexes);
Ren_LogComment("glLockArraysEXTn");
}
if (qglUnlockArraysEXT)
{
qglUnlockArraysEXT();
Ren_LogComment("glUnlockArraysEXTn");
}
Here are errors
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:819: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1429: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1493: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1493: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1604: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1604: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1666: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1666: error: undefined reference to 'glUnlockArraysEXT'
And what is most important line does not respond to those references
1st reference point to 201 line in file
Ok looks like it does not support this extension so I commented them out
– rafal1137
Dec 29 '18 at 20:13
add a comment |
So after fixing all those undefined reference errors I did hitted a wall there still some to manage but I am not sure how to manage them.
There are 2 files tr_init.c and tr_shade.c which are/were throwing those errors
I kinda did fixed those in tr_init.c
tr_init.c
Before
if (qglLockArraysEXT)
{
primitives = 2;
}
Ren_Print("compiled vertex arrays: %sn", enablestrings[qglLockArraysEXT != 0]);
Afrer
if (&qglLockArraysEXT)
{
primitives = 2;
}
Ren_Print("compiled vertex arrays: %sn", enablestrings[&qglLockArraysEXT != 0]);
tr_shade.c
if (qglLockArraysEXT)
{
qglLockArraysEXT(0, input->numVertexes);
Ren_LogComment("glLockArraysEXTn");
}
if (qglUnlockArraysEXT)
{
qglUnlockArraysEXT();
Ren_LogComment("glUnlockArraysEXTn");
}
Here are errors
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:819: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1429: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1493: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1493: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1604: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1604: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1666: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1666: error: undefined reference to 'glUnlockArraysEXT'
And what is most important line does not respond to those references
1st reference point to 201 line in file
Ok looks like it does not support this extension so I commented them out
– rafal1137
Dec 29 '18 at 20:13
add a comment |
So after fixing all those undefined reference errors I did hitted a wall there still some to manage but I am not sure how to manage them.
There are 2 files tr_init.c and tr_shade.c which are/were throwing those errors
I kinda did fixed those in tr_init.c
tr_init.c
Before
if (qglLockArraysEXT)
{
primitives = 2;
}
Ren_Print("compiled vertex arrays: %sn", enablestrings[qglLockArraysEXT != 0]);
Afrer
if (&qglLockArraysEXT)
{
primitives = 2;
}
Ren_Print("compiled vertex arrays: %sn", enablestrings[&qglLockArraysEXT != 0]);
tr_shade.c
if (qglLockArraysEXT)
{
qglLockArraysEXT(0, input->numVertexes);
Ren_LogComment("glLockArraysEXTn");
}
if (qglUnlockArraysEXT)
{
qglUnlockArraysEXT();
Ren_LogComment("glUnlockArraysEXTn");
}
Here are errors
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:819: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1429: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1493: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1493: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1604: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1604: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1666: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1666: error: undefined reference to 'glUnlockArraysEXT'
And what is most important line does not respond to those references
1st reference point to 201 line in file
So after fixing all those undefined reference errors I did hitted a wall there still some to manage but I am not sure how to manage them.
There are 2 files tr_init.c and tr_shade.c which are/were throwing those errors
I kinda did fixed those in tr_init.c
tr_init.c
Before
if (qglLockArraysEXT)
{
primitives = 2;
}
Ren_Print("compiled vertex arrays: %sn", enablestrings[qglLockArraysEXT != 0]);
Afrer
if (&qglLockArraysEXT)
{
primitives = 2;
}
Ren_Print("compiled vertex arrays: %sn", enablestrings[&qglLockArraysEXT != 0]);
tr_shade.c
if (qglLockArraysEXT)
{
qglLockArraysEXT(0, input->numVertexes);
Ren_LogComment("glLockArraysEXTn");
}
if (qglUnlockArraysEXT)
{
qglUnlockArraysEXT();
Ren_LogComment("glUnlockArraysEXTn");
}
Here are errors
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:819: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1429: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1493: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1493: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1604: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1604: error: undefined reference to 'glUnlockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1666: error: undefined reference to 'glLockArraysEXT'
/home/rafal/Pulpit/etlegacy/src/rendererGLES/tr_shade.c:1666: error: undefined reference to 'glUnlockArraysEXT'
And what is most important line does not respond to those references
1st reference point to 201 line in file
answered Dec 28 '18 at 18:05
rafal1137rafal1137
136
136
Ok looks like it does not support this extension so I commented them out
– rafal1137
Dec 29 '18 at 20:13
add a comment |
Ok looks like it does not support this extension so I commented them out
– rafal1137
Dec 29 '18 at 20:13
Ok looks like it does not support this extension so I commented them out
– rafal1137
Dec 29 '18 at 20:13
Ok looks like it does not support this extension so I commented them out
– rafal1137
Dec 29 '18 at 20:13
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53937505%2fandroid-gradle-build-error-undefined-reference-to-main%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
SDL_main.h
redefinesmain
asSDL_main
for some platforms, android included. Is it java-less build? Take a look at hg.libsdl.org/SDL/file/fbce19db4e53/docs/README-android.md andandroid-project
directory in SDL sources.– keltar
Dec 27 '18 at 7:20