I use MinGW on Windows. I get the boost source files from svn and they are in S:\Boost\ directory. Now my program needs the program_options library and in my source files I use #include to include those hpp files. When I compile the .cpp file, my makefile contains “-I S:/Boost” and compile successes. But when I want to link the object files, g++ reports lots of “undefined reference” problems. Now I write “g++ -o foo.exe file1.o file2.o”. How can I solve the problem?
Share
boost::program_options is not a header-only library, which means that you should build the library first. It seems that you got the source code but haven’t built the library yet. Try to build it or get a prebuilt library.