Closed Michael-lindell closed 4 years ago
Which compiler/linker are you using? Are you building static or shared? It looks like it's looking for the shared symbols. Can you share the exact compile and link statements you use?
Hi,
What exactly do you mean by "Are you building static or shared?"
FYI, I am using Windows 10 with Visual Studio 2019 and the MSBuild compiler to compile my project. If you are referring to the information under Configuration properties > linker > Command-Line > Additional option in Visual Studio 2019.. This is the compiler and link statement I use :
/OUT:"C:\Users\MichaelLindell\source\repos\read_xlsx_file\Debug\Project1.exe" /MANIFEST /NXCOMPAT /PDB:"C:\Users\MichaelLindell\source\repos\read_xlsx_file\Debug\Project1.pdb" /DYNAMICBASE "C:\Users\MichaelLindell\source\repos\read_xlsx_file\lib\libxlsxio_read.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:X86 /INCREMENTAL /PGD:"C:\Users\MichaelLindell\source\repos\read_xlsx_file\Debug\Project1.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Debug\Project1.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"C:\Users\MichaelLindell\source\repos\read_xlsx_file\lib" /TLBID:1
Was that what you were looking for?
I'm focusing more on GCC, so on Windows that's MinGW-w64.
But it should build with MSVC if you link with the library correctly.
Did you make libxlsxio_read.lib
from the .dll
and def
file from the binary distribution (32-bit/64-bit as needed), or did you build it yourself?
I see, I made the libxlsxio_read.lib file from the .dll provided from the binary distribution (32-bits) using the "lib-command" and Developer Command prompt for VS 2019.
However, when using the lib command it threw a couple of warnings at me :
libxlsxio_read.def(1) : warning LNK4017: !
Is this of interest to the issue?
I did a quick search on the web tells me this is how to create the MSVC .lib file (replace x86
with x64
as needed):
lib /def:libxlsxio_read.def /out:libxlsxio_read.lib /machine:x86
But again I'm not an MSVC expert. However if you search stackexchange.com you can find a lot of tibe about this, for example here.
Hi,
It turned out to be that I was not generating the .def file correctly. I followed your link on stack overflow which pointed me in the right direction and I am now able to generate a .lib file as well as compile my project without any issues.
Thank you for your help and I am closing the issue now!
Best regards, Michael.
Greetings! I am using the pre-built binary to use with my c project. When I compile my project, the linker is throwing an error at me. More exactly, "Unresolved external symbol __imp_xlsxioread_open".
Furthermore this is the code I have been trying to use that uses your project (Yes, it is from your example code)
:
//open .xlsx file for reading xlsxioreader xlsxioread; if ((xlsxioread = xlsxioread_open(filename)) == NULL) { fprintf(stderr, "Error opening .xlsx file\n"); return 1;}
Can you help me with this issue?
Best regards, Michael.