Compiling HDFql on Visual Studio 2015, Linker Errors


#1

Hi all,

I’m working on a project and I can’t seem to get the hdfql.lib to link just right. Right now, it’s coming up with 17 unresolved external symbols. I’ve changed my debug settings to be Release, x64, the RunTime Library is Multi-Threaded, and I’m ignoring the msvcrt.lib (since it was also giving errors).

I just added HDF5 to see if it would resolve any errors, to no avail.

Any help would be greatly appreciated, thanks in advance!


#2

Hi Gabriella,

Thanks for reaching out.

Would it be possible to post the 17 unresolved external symbols in this thread, as well as the flags you are using to compile your C++ program (that uses HDFql) using Visual Studio 2015? With this information, we will be able to better assist you.

Thanks!


#3

Sure thing, thanks!

1>hdfql.lib(H5.obj) : error LNK2001: unresolved external symbol __imp__fdopen
1>hdfql.lib(H5.obj) : error LNK2001: unresolved external symbol __imp_fputs
1>hdfql.lib(H5system.obj) : error LNK2001: unresolved external symbol __imp_fputs
1>hdfql.lib(H5Dchunk.obj) : error LNK2001: unresolved external symbol __imp_fputs
1>hdfql.lib(H5Dbtree.obj) : error LNK2001: unresolved external symbol __imp_fputs
1>hdfql.lib(H5.obj) : error LNK2001: unresolved external symbol __imp_strncat
1>hdfql.lib(H5system.obj) : error LNK2001: unresolved external symbol __imp_strncat
1>hdfql.lib(H5Gname.obj) : error LNK2001: unresolved external symbol __imp_strncat
1>hdfql.lib(H5Gstab.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Gcompact.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Gdense.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Fsuper_cache.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5C.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5FDfamily.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5FDlog.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5FDmulti.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Gloc.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Opline.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Pdxpl.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5FDsec2.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Eint.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Gname.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5RS.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Gint.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Pdapl.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Plapl.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5system.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5PL.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5E.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5F.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Pocpl.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Pdcpl.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5T.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5L.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5Lexternal.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5A.obj) : error LNK2001: unresolved external symbol __imp_strncpy
1>hdfql.lib(H5system.obj) : error LNK2001: unresolved external symbol __imp__putenv_s
1>hdfql.lib(H5Fint.obj) : error LNK2001: unresolved external symbol __imp__ctime64
1>hdfql.lib(H5FDsec2.obj) : error LNK2001: unresolved external symbol __imp__ctime64
1>hdfql.lib(H5FDcore.obj) : error LNK2001: unresolved external symbol __imp__ctime64
1>hdfql.lib(H5FDlog.obj) : error LNK2001: unresolved external symbol __imp__ctime64
1>hdfql.lib(H5Fint.obj) : error LNK2001: unresolved external symbol __imp__time64
1>hdfql.lib(H5FDsec2.obj) : error LNK2001: unresolved external symbol __imp__time64
1>hdfql.lib(H5FDcore.obj) : error LNK2001: unresolved external symbol __imp__time64
1>hdfql.lib(H5FDlog.obj) : error LNK2001: unresolved external symbol __imp__time64
1>hdfql.lib(H5Omtime.obj) : error LNK2001: unresolved external symbol __imp__gmtime64
1>hdfql.lib(H5Omtime.obj) : error LNK2001: unresolved external symbol __imp__localtime64
1>hdfql.lib(H5Odbg.obj) : error LNK2001: unresolved external symbol __imp__localtime64
1>hdfql.lib(H5Omtime.obj) : error LNK2001: unresolved external symbol __imp__mktime64
1>hdfql.lib(H5Ztrans.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vsscanf
1>hdfql.lib(H5FDsec2.obj) : error LNK2001: unresolved external symbol __imp_strerror
1>hdfql.lib(H5FDcore.obj) : error LNK2001: unresolved external symbol __imp_strerror
1>hdfql.lib(H5FDlog.obj) : error LNK2001: unresolved external symbol __imp_strerror
1>hdfql.lib(antlr3collections.obj) : error LNK2001: unresolved external symbol __imp_strdup
1>OLDNAMES.lib(strdup.obi) : error LNK2001: unresolved external symbol __imp_strdup
1>hdfql.lib(H5FDmulti.obj) : error LNK2001: unresolved external symbol __imp_strstr
1>hdfql.lib(H5FDstdio.obj) : error LNK2001: unresolved external symbol __imp_freopen
1>hdfql.lib(H5Defl.obj) : error LNK2001: unresolved external symbol __imp__access
1>OLDNAMES.lib(strdup.obi) : error LNK2001: unresolved external symbol __imp__strdup


#4

Thanks for the list of undefined external symbols!

Additionally, would you mind to post the flags (options) used to compile your C++ (that uses HDFql) in Visual Studio 2015, as well as the location (i.e. directory) where you have decompressed HDFql?


#5

Of course!

The location of HDFql is C:\Users\det-lab\Desktop\DetLab\Fermilab\Applications\HDFql-2.1.0_Windows64_VS-2015\hdfql-2.1.0.

Under Linker, the options are: /OUT:“c:\users\det-lab\documents\visual studio 2015\Projects\HDFqlVS15Testv2\x64\Release\HDFqlVS15Testv2.exe” /MANIFEST /LTCG:incremental /NXCOMPAT /PDB:“c:\users\det-lab\documents\visual studio 2015\Projects\HDFqlVS15Testv2\x64\Release\HDFqlVS15Testv2.pdb” /DYNAMICBASE “szip.lib” “zlib.lib” “hdf5.lib” “hdf5_cpp.lib” “hdfql.lib” “kernel32.lib” “user32.lib” “gdi32.lib” “winspool.lib” “comdlg32.lib” “advapi32.lib” “shell32.lib” “ole32.lib” “oleaut32.lib” “uuid.lib” “odbc32.lib” “odbccp32.lib” /DEBUG /MACHINE:X64 /NODEFAULTLIB:“msvcrt.lib” /OPT:REF /PGD:“c:\users\det-lab\documents\visual studio 2015\Projects\HDFqlVS15Testv2\x64\Release\HDFqlVS15Testv2.pgd” /SUBSYSTEM:CONSOLE /MANIFESTUAC:“level=‘asInvoker’ uiAccess=‘false’” /ManifestFile:“x64\Release\HDFqlVS15Testv2.exe.intermediate.manifest” /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /TLBID:1

Under C/C++, the options are: /GS /GL /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /sdl /Fd"x64\Release\vc140.pdb" /Zc:inline /fp:precise /D “H5_BUILT_AS_DYNAMIC_LIB” /D “_MBCS” /errorReport:prompt /WX- /Zc:forScope /Gd /Oi /MT /Fa"x64\Release" /EHsc /nologo /Fo"x64\Release" /Fp"x64\Release\HDFqlVS15Testv2.pch"

Would it be best if I moved the HDFql directory to C:/ and/or changing it from x64 to x86?

Thanks!

Gabriella


#6

Hi Gabriella,

Thanks for the info!

Would you mind to pass the following flags to the C++ compiler and see how it goes:

 /IC:\Users\det-lab\Desktop\DetLab\Fermilab\Applications\HDFql-2.1.0_Windows64_VS-2015\hdfql-2.1.0\include  C:\Users\det-lab\Desktop\DetLab\Fermilab\Applications\HDFql-2.1.0_Windows64_VS-2015\hdfql-2.1.0\wrapper\cpp\HDFql.lib

Concerning the linker, pass the following:

 /NODEFAULTLIB:libcmt.lib

and remove (in the linker) the following libraries since they are not needed (at least by HDFql):

 "hdf5.lib" "hdf5_cpp.lib"

Please take a look at section 3.2 in HDFql reference manual for a detailed explanation on how to compile a C++ using HDFql static and shared libraries.

Concerning your questions, there is no need to move HDFql directory to another location or change from x64 to x86 as HDFql supports 64 bit architectures (unless you wish to compile your C++ in 32 bit; in that case, yes, you need to change to x86 and download HDFql 32 bit distribution package).

Hope this helps!


#7

Realized I was using the wrong version of Visual Studio on the last post. On Visual Studio 2015, I’m not receiving any errors, just “a task was cancelled”. Thus, I think I’ve solved the issue with the compiler, it must now be something with my code.

Thanks for all your help!


#8

Thanks so much! I’m not getting linker errors anymore, but I am getting syntax errors and unknown character errors with the “hdfql.lib”, am looking into the reference manual for insight.


#9

Great to know that you managed to get rid of linking errors!

Feel free to read the reference manual then, and to let us know if you get stuck in solving the new errors you’re facing (maybe by contacting us directly if that is more comfortable for you - http://www.hdfql.com/#contact)

Thanks!