Is CImg compatible with Emscripten - c++

I have written a program in c++, but need to turn it to javascript to be run on an iPad. The only issue is that my program uses CImg. This is the compile command
em++ -std=c++11 -Wall -L./lib -lX11 -ljpeg -lpng -I./include -I./include/include main.cpp obj/object1.o obj/object2.o -o bin/executable.js
./include has my program header files and ./include/include has all the files that were located in /opt/X11/include which are needed to run CImg. and I get the following error:
warning: unresolved symbol: XUnlockDisplay
warning: unresolved symbol: XMoveWindow
warning: unresolved symbol: png_read_info
warning: unresolved symbol: XWindowEvent
warning: unresolved symbol: XFreeColormap
warning: unresolved symbol: XAllocClassHint
warning: unresolved symbol: XCreatePixmapCursor
warning: unresolved symbol: png_set_sig_bytes
warning: unresolved symbol: XGetWindowAttributes
warning: unresolved symbol: pthread_testcancel
warning: unresolved symbol: XSync
warning: unresolved symbol: jpeg_start_decompress
warning: unresolved symbol: jpeg_CreateDecompress
warning: unresolved symbol: jpeg_stdio_src
warning: unresolved symbol: XQueryKeymap
warning: unresolved symbol: png_create_write_struct
warning: unresolved symbol: jpeg_destroy
warning: unresolved symbol: png_read_end
warning: unresolved symbol: XCreateImage
warning: unresolved symbol: png_write_image
warning: unresolved symbol: XSetWindowColormap
warning: unresolved symbol: pthread_cancel
warning: unresolved symbol: XGrabKeyboard
warning: unresolved symbol: png_read_image
warning: unresolved symbol: XSetWMProtocols
warning: unresolved symbol: png_write_end
warning: unresolved symbol: png_set_gray_to_rgb
warning: unresolved symbol: XCheckTypedEvent
warning: unresolved symbol: png_init_io
warning: unresolved symbol: XFree
warning: unresolved symbol: png_set_filler
warning: unresolved symbol: XUnmapWindow
warning: unresolved symbol: png_set_longjmp_fn
warning: unresolved symbol: XCreateSimpleWindow
warning: unresolved symbol: XMapRaised
warning: unresolved symbol: XCloseDisplay
warning: unresolved symbol: XLockDisplay
warning: unresolved symbol: png_create_info_struct
warning: unresolved symbol: png_set_IHDR
warning: unresolved symbol: jpeg_write_scanlines
warning: unresolved symbol: XSelectInput
warning: unresolved symbol: jpeg_finish_compress
warning: unresolved symbol: XPutImage
warning: unresolved symbol: XCheckWindowEvent
warning: unresolved symbol: XUndefineCursor
warning: unresolved symbol: XVisualIDFromVisual
warning: unresolved symbol: jpeg_set_quality
warning: unresolved symbol: jpeg_CreateCompress
warning: unresolved symbol: XFreePixmap
warning: unresolved symbol: XCreateBitmapFromData
warning: unresolved symbol: pthread_create
warning: unresolved symbol: XStoreColors
warning: unresolved symbol: XInitThreads
warning: unresolved symbol: XLookupString
warning: unresolved symbol: png_get_valid
warning: unresolved symbol: jpeg_read_header
warning: unresolved symbol: jpeg_stdio_dest
warning: unresolved symbol: XSetInputFocus
warning: unresolved symbol: jpeg_std_error
warning: unresolved symbol: jpeg_destroy_decompress
warning: unresolved symbol: png_set_palette_to_rgb
warning: unresolved symbol: png_create_read_struct
warning: unresolved symbol: pthread_setcanceltype
warning: unresolved symbol: png_read_update_info
warning: unresolved symbol: jpeg_set_defaults
warning: unresolved symbol: png_set_expand_gray_1_2_4_to_8
warning: unresolved symbol: jpeg_read_scanlines
warning: unresolved symbol: jpeg_start_compress
warning: unresolved symbol: png_destroy_read_struct
warning: unresolved symbol: XResizeWindow
warning: unresolved symbol: png_get_IHDR
warning: unresolved symbol: jpeg_destroy_compress
warning: unresolved symbol: XCheckMaskEvent
warning: unresolved symbol: XCreateColormap
warning: unresolved symbol: XGetVisualInfo
warning: unresolved symbol: pthread_setcancelstate
warning: unresolved symbol: XDestroyWindow
warning: unresolved symbol: png_write_info
warning: unresolved symbol: XDefineCursor
warning: unresolved symbol: XUngrabKeyboard
warning: unresolved symbol: XSetClassHint
warning: unresolved symbol: png_set_tRNS_to_alpha
warning: unresolved symbol: jpeg_finish_decompress
warning: unresolved symbol: png_sig_cmp
warning: unresolved symbol: png_destroy_write_struct
warning: unresolved symbol: _ZTVSt9exception
I'm pretty sure it has something to do with linking the libraries. But I don't know if it is even possible to work with CImg while converting through Emscripten.

Any portable C or C++ codebase should work. But you do need to port all dependencies. Looks like the app uses Xlib and libpng, based on those warnings. You might need to port the X stuff to something emscripten already supports, like SDL. For png, there are a few ports around (or you can compile it yourself), e.g. https://github.com/hachque-Emscripten/libpng-1.2.49

If you don't need the X11 features of CImg (basically, if you don't want to display an image into a CImgDisplay window), then you can disable it by defining the macro cimg_display=0 while compiling your CImg-based code.

Related

which library contains _is_c_termination_complete

I am getting LNK2019 error from linking C++ code with the standard library C++ library. I need to know which libraries contain the functions:
is_c_termination_complete,
__acrt_initialize,
__acrt_uninitialize,
__acrt_uninitialize_critical,
__acrt_thread_attach,
__acrt_thread_detach
to include it in the linking process.
I am writing code in C++ with MS Visual Studio community 2017 and Intel Parallel studio xe 2019 update 1 to be integrated in 3rd party software. The 3rd party software provides a "make" option to compile the object files and link them together.
Compilation works fine, linking provides an issue.
The 3rd party software provides an entry to provide basic linker options in the form of a variable. The default options are as follows:
link_sl='LINK', '/nologo', '/NOENTRY', '/INCREMENTAL:NO', '/subsystem:console', '/machine:AMD64',
' /NODEFAULTLIB:LIBC.LIB', '/NODEFAULTLIB:LIBCMT.LIB','/DEFAULTLIB:OLDNAMES.LIB', '/DEFAULTLIB:LIBIFCOREMD.LIB', '/DEFAULTLIB:LIBIFPORTMD.LIB', '/DEFAULTLIB:LIBMMD.LIB', '/DEFAULTLIB:kernel32.lib', '/DEFAULTLIB:user32.lib', '/DEFAULTLIB:advapi32.lib','/FIXED:NO', '/dll','/def:%E', '/out:%U', '%F', '%A', '%L', '%B',
'oldnames.lib', 'user32.lib', 'ws2_32.lib', 'netapi32.lib','advapi32.lib',
'msvcrt.lib', 'vcruntime.lib', 'ucrt.lib']
This gives the following 11 errors when linking:
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __vcrt_initialize referenced in function __scrt_initialize_crt
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __vcrt_uninitialize referenced in function __scrt_initialize_crt
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __vcrt_uninitialize_critical referenced in function __scrt_dllmain_uninitialize_critical
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __vcrt_thread_attach referenced in function __scrt_dllmain_crt_thread_attach
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __vcrt_thread_detach referenced in function __scrt_dllmain_crt_thread_attach
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol _is_c_termination_complete referenced in function __scrt_dllmain_uninitialize_c
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_initialize referenced in function __scrt_initialize_crt
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_uninitialize referenced in function __scrt_uninitialize_crt
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_uninitialize_critical referenced in function __scrt_dllmain_uninitialize_critical
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_thread_attach referenced in function __scrt_dllmain_crt_thread_attach
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_thread_detach referenced in function __scrt_dllmain_crt_thread_detach
Which basically means that I am not including all the necessary libraries.
I already found out that including the library 'libvcruntime.lib' in the options reduces the errors to 6. So, using:
link_sl='LINK', '/nologo', '/NOENTRY', '/INCREMENTAL:NO', '/subsystem:console', '/machine:AMD64',
' /NODEFAULTLIB:LIBC.LIB', '/NODEFAULTLIB:LIBCMT.LIB','/DEFAULTLIB:OLDNAMES.LIB', '/DEFAULTLIB:LIBIFCOREMD.LIB', '/DEFAULTLIB:LIBIFPORTMD.LIB', '/DEFAULTLIB:LIBMMD.LIB', '/DEFAULTLIB:kernel32.lib', '/DEFAULTLIB:user32.lib', '/DEFAULTLIB:advapi32.lib','/FIXED:NO', '/dll','/def:%E', '/out:%U', '%F', '%A', '%L', '%B',
'oldnames.lib', 'user32.lib', 'ws2_32.lib', 'netapi32.lib','advapi32.lib',
'msvcrt.lib', 'vcruntime.lib', 'ucrt.lib',**'libvcruntime.lib'**]
Results in:
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol _is_c_termination_complete referenced in function __scrt_dllmain_uninitialize_c
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_initialize referenced in function __scrt_initialize_crt
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_uninitialize referenced in function __scrt_uninitialize_crt
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_uninitialize_critical referenced in function __scrt_dllmain_uninitialize_critical
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_thread_attach referenced in function __scrt_dllmain_crt_thread_attach
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_thread_detach referenced in function __scrt_dllmain_crt_thread_detach
Which other libraries do I need to include in the linking process to resolve these?
I have encountered exactly the same problem when working within the framework provided by this 3rd party software. Although I cannot answer directly the question for finding the libraries containing _is_c_termination_complete, I realised it is still possible to make your code work: simply adding a /FORCE flag to your link_sl flag list.
According to MSVC official documentation:
The /FORCE option tells the linker to create a valid .exe file or DLL even if a symbol is referenced but not defined or is multiply defined.
Therefore, LNK2019 error messages will not stop the linker producing the dll library which is critical for the 3rd party software to run. The linker messages would look like:
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol _is_c_termination_complete referenced in function __scrt_dllmain_uninitialize_c
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_initialize referenced in function __scrt_initialize_crt
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_uninitialize referenced in function __scrt_uninitialize_crt
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_uninitialize_critical referenced in function __scrt_dllmain_uninitialize_critical
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_thread_attach referenced in function __scrt_dllmain_crt_thread_attach
msvcrt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_thread_detach referenced in function __scrt_dllmain_crt_thread_detach
: warning LNK4088: image being generated due to /FORCE option; image may not run
msvcprt.lib(locale0_implib.obj) : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators
This is certainly not a decant solution and is not guaranteed to be working in any case, however it worked for my codes at least.

Why I get unresolved external errors when I want to link the release version of the static library TinyXML 2 in C++ Builder Starter?

I got a simple question. I read that linking debug static libraries to release executables is considered a bad thing. So I compiled the static library of TinyXML 2 in release mode. Library compiled without any errors. But when I want to link the release static library library with the release version of my example application I get the following output:
Checking project dependencies...
Building PrjTinyXML2_App.cbproj (Release, Win32)
bcc32 command line for "main.cpp"
c:\program files (x86)\embarcadero\studio\18.0\bin\bcc32.exe -DNDEBUG -n.\Win32\Release -I"C:\Program Files
(x86)\Embarcadero\Studio\18.0\include\boost_1_39\boost\tr1\tr1";"C:\Program Files (x86)\Embarcadero\Studio\18.0\include\boost_1_39";"c:\program files
(x86)\embarcadero\studio\18.0\include";"c:\program files (x86)\embarcadero\studio\18.0\include\dinkumware";"c:\program files
(x86)\embarcadero\studio\18.0\include\windows\crtl";"c:\program files (x86)\embarcadero\studio\18.0\include\windows\sdk";"c:\program files
(x86)\embarcadero\studio\18.0\include\windows\rtl";"c:\program files (x86)\embarcadero\studio\18.0\include\windows\vcl";"c:\program files
(x86)\embarcadero\studio\18.0\include\windows\fmx";C:\Users\Public\Documents\Embarcadero\Studio\18.0\hpp\Win32;
C:\Users\Public\Documents\Embarcadero\Studio\18.0\hpp\Win32 -Q -c -tC -C8 -o.\Win32\Release\main.obj -w-par -O2 -v- -vi
-H=.\Win32\Release\PrjTinyXML2_App.pch -H main.cpp
brcc32 command line for "PrjTinyXML2_App.vrc"
c:\program files (x86)\embarcadero\studio\18.0\bin\cgrc.exe -c65001 PrjTinyXML2_App.vrc -foPrjTinyXML2_App.res
ilink32 command line
c:\program files (x86)\embarcadero\studio\18.0\bin\ilink32.exe -G8 -L.\Win32\Release;
C:\Users\Donald\Documents\Embarcadero\Studio\Projects\TinyXML2_Static_lib\Win32\Release;
C:\Users\Donald\Documents\Embarcadero\Studio\Projects\TinyXML2_Static_lib\Win32\Debug;"c:\program files
(x86)\embarcadero\studio\18.0\lib\win32\release";"c:\program files (x86)\embarcadero\studio\18.0\lib\win32\release\psdk";
C:\Users\Public\Documents\Embarcadero\Studio\18.0\DCP -j.\Win32\Release;
C:\Users\Donald\Documents\Embarcadero\Studio\Projects\TinyXML2_Static_lib\Win32\Release;
C:\Users\Donald\Documents\Embarcadero\Studio\Projects\TinyXML2_Static_lib\Win32\Debug;"c:\program files
(x86)\embarcadero\studio\18.0\lib\win32\release";"c:\program files (x86)\embarcadero\studio\18.0\lib\win32\release\psdk";
C:\Users\Public\Documents\Embarcadero\Studio\18.0\DCP -l.\Win32\Release -Tpe c0x32 .\Win32\Release\main.obj , .\Win32\Release\PrjTinyXML2_App.exe ,
.\Win32\Release\PrjTinyXML2_App.map , PrjTinyXML2_lib.lib import32.lib cw32.lib , , PrjTinyXML2_App.res
[ilink32 Error] Error: Unresolved external '___seh_personality_v0' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '__Unwind_SjLj_Register' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '__cxxabiv1::__si_class_type_info::' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '___cxa_pure_virtual' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '___cpp_terminate' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '__Unwind_SjLj_Unregister' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external 'tinyxml2::StrPair::~StrPair()' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_APP\WIN32\RELEASE\MAIN.OBJ
[ilink32 Error] Error: Unresolved external '__cxxabiv1::__class_type_info::' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '__Unwind_Resume' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unable to perform link
Failed
Elapsed time: 00:00:02.3
If I compile the application with the debug static TinyXML 2 library it compiles ok. Am I doing something wrong? I use C++ Builder 10.1 Berlin Update 2 Starter.
Looks like your issue is linked to compiler options in release mode.
Could you have a look on "Exception handling" options?
___seh_personality_v0 and __Unwind_SjLj_Register are "Exception handler" functions.

Compile FFmpeg Zeranoe Build with Visual Studio 2013

I downloaded the most recent Zeranoe dev build here, included the header files to my code, placed extern "C" around the includes, since this is a C++ project and FFmpeg is a C library, and added the libs to Visual Studio as well, and I get this linker error:
1>Camera.obj : error LNK2019: unresolved external symbol _av_free referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_freep referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_frame_alloc referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_frame_free referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_register_all referenced in function __catch$??0Camera#MicroDFV_Camera##QAE#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##0PAX#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_alloc_context3 referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_open2 referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_close referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_init_packet referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_packet_unref referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_find_encoder referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_encode_video2 referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_opt_set referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_image_alloc referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>M:\Desktop\OpenCVTest\Debug\OpenCVTest.exe : fatal error LNK1120: 14 unresolved externals
Searching here and on Google I found many recommendations, such as to add #pragma comment(lib,...), and that the libs are static, so their order is important, and none of this helps.
So I scratched my head even more and realized that the Zeranoe build is made with MinGW-w64, so probably it won't link with Visual Studio. I inspected the lib using dumpbin and the symbols on the libs don't have the underscore, so I am pretty sure it won't work.
The other Zeranoe builds for Windows don't have libs, they are just plain .exe or exe + .dll.
Will I have to make my own VS2013 build of FFmpeg to link it, or is there some alternative way?

How to fix Code Blocks Unresolved External?

Recently I installed CodeBlocks and Borland C++ as the compiler to just make a C program. But when I started to build it gives an error.
bcc32.exe -q -IE:\Borland\Include -o"C:\Users\thamidu\Documents\Thamidu's Documens\Self Learning\C++\helloc.obj" -c "C:\Users\thamidu\Documents\Thamidu's Documens\Self Learning\C++\helloc.c"
C:\Users\thamidu\Documents\Thamidu's Documens\Self Learning\C++\helloc.c:
ilink32.exe -q -ap -LE:\Borland\Lib -LE:\Borland\Lib\PSDK c0x32 "C:\Users\thamidu\Documents\Thamidu's Documens\Self Learning\C++\helloc.obj","C:\Users\thamidu\Documents\Thamidu's Documens\Self Learning\C++\helloc.exe",,,,
Error: Unresolved external '___CRTL_VCL_Init' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_MEM_UseBorMM' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_VCLLIB_Linkage' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__ExceptInit' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external 'GetModuleHandleA' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__startup' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__GetExceptDLLinfoInternal' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external 'HeapAlloc' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_SetValue' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_InitThread' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_Alloc' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_GetValue' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external 'GetProcessHeap' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external 'HeapFree' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_ExitThread' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_Free' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '_printf' referenced from C:\USERS\THAMIDU\DOCUMENTS\THAMIDU'S DOCUMENS\SELF LEARNING\C++\HELLOC.OBJ
Error: Unresolved external '__matherr' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__matherrl' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__fmode' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__argv_expand_ptr' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__wargv_expand_ptr' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__handle_setargv' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__handle_exitargv' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__handle_wsetargv' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__handle_wexitargv' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__fileinfo' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__setargv__' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__setenvp__' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__turboFloat' referenced from E:\BORLAND\LIB\C0X32.OBJ
Process terminated with status 2 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Please how can i get rid of this?? thanks
Those missing symbols are from the Borland-C++ Compiler libraries.
Since you're using Code::Blocks add these to the Link Libraries pane on your project's build options (Menu Bar->Project Options->Linker Settings):
cw32.lib - Single Threaded
cw32i.lib - Single Threaded (Dynamic)
cw32mt.lib - Multi Threaded
cw32mti.lib - Multi Threaded (Dynamic)

linker problems for EasyHook in Visual C++ 10

I have downloaded EasyHook 2.7 source and I try to compile it in my Visual Studio 2012 environment.
After solving a lot of warnings, I have found other warnings that I cannot solve, and these are:
1>error.obj : error LNK2019: unresolved external symbol _CoTaskMemAlloc#4 referenced in function _RtlGetLastErrorStringCopy#0
1>error.obj : error LNK2019: unresolved external symbol _CopyMemory#12 referenced in function _RtlGetLastErrorStringCopy#0
1>reloc.obj : error LNK2019: unresolved external symbol _ud_init#4 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_mode#8 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_input_buffer#12 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_syntax#8 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_disassemble#4 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_translate_intel#4 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_asm_buffer#12 referenced in function _LhDisassembleInstruction#20
1>C:\Users\Jaime Stuardo\Downloads\EasyHook-2.7.5159.0-Source\\Debug\x86\EasyHook32Drv.sys : fatal error LNK1120: 9 unresolved externals
What lib files I need to add so that the linker will not fail? notice that the first 2 functions belong to Windows API, so it is very curious it does not link.
Regards
Jaime
For the Windows functions, just look them up on MSDN. CoTaskMemAlloc says you need to link OLE32.LIB. CopyMemory says KERNEL32.LIB. The functions beginning with ud come from a library which Easyhook depends on: "EasyHook makes use of the udis86 library by Vivek.