Reputation: 41
I am writing code which requires reading stuff from xls files and I settled on using the XLNT library.
I did the following:
Configure and generate a Visual Studio project using CMAKE gui
Compiled it in visual studio - generated a build folder with a .lib
file
Followed instructions on: How to install 3rd party libraries
codeblocks
Added /lib/include
directory to both linker and compiler
search directories
Added the .lib
file to project build options
Added -std=c++14 -Ixlnt/include -lxlnt
to Other compiler options
The errors I have are:
undefined reference to 'xlnt::workbook::workbook()
- in total 18
identical errorsC:\Users\pinkunicorn\Documents\Personal Files\C\testing\main.cpp|36|undefined reference to xlnt::worksheet::freeze_panes(xlnt::cell_reference const&)'
I looked around on forums what some people are saying about similar problems is to include the .cpp files as well. I don't understand how to do it so I haven't tried it yet (all instructions seem to say to add .cpp library file name to the command line when compiling) - but I am not even using the command line to compile and there are like 50 cpp files in the source folder of the library download file so not sure how that would work.
What do you think possible fixes could be?
Upvotes: 0
Views: 1823
Reputation: 1
I sometimes use g++ myfile.cpp -std=c++14 -Ixlnt/include -Lxlnt/lib -lxlnt -o myfile
I believe that the order of the above is important (using the right arguments in the wrong order has tripped me up before).
Upvotes: 0