Good morning everyone, I'm having some trouble getting the compilation for a particular project to work on Code::Blocks.
I recently discovered the FLTK library for GUI on Windows, and after setting it up I opened a test project to try and make it work. Unfortunately when I try to compile it I get 19 linker errors:
g++.exe -LC:\Users\Svalorzen\Documents\Projects\fltk-1.3.0\lib -o bin\Debug\test.exe obj\Debug\main.o -mwindows -lole32 -luuid -lcomctl32 C:\Users\Svalorzen\Documents\Projects\fltk-1.3.0\lib\libfltk.a
C:\Users\Svalorzen\Documents\Projects\fltk-1.3.0\lib\libfltk.a(Fl.o):Fl.cxx:(.text+0x2bb): undefined reference to `OleUninitialize@0'
C:\Users\Svalorzen\Documents\Projects\fltk-1.3.0\lib\libfltk.a(Fl.o):Fl.cxx:(.text+0x738): undefined reference to `OleInitialize@4'
...
However if I compile the project from command prompt ( or even Msys ), with this script
g++ -I..\fltk-1.3.0\ -mwindows -DWIN32 -DUSE_OPENGL32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -o 'main' main.cpp -mwindows ..\fltk-1.3.0\lib\libfltk.a -lole32 -luuid -lcomctl32
it compiles correctly. I've attached an image with the settings of my Code::Blocks, what exactly am I doing wrong?
Thanks in advance!
If you do NOT know what a library is then you do NOT know enough to program.
I will help you this time; but, you need to learn how to program.
g++ -I..\fltk-1.3.0\ -mwindows -DWIN32 -DUSE_OPENGL32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -o 'main' main.cpp -mwindows ..\fltk-1.3.0\lib\libfltk.a -lole32 -luuid -lcomctl32
The clear libraries in your above command are
ole32
uuid
comctl32
The not so clear one is
libfltk.a
You need to really know the difference between compiler and linking to understand some basic things in programming.
If you DO NOT wish to use an IDE do NOT do so; do NOT complain that it is NOT efficient because you need to learn something.
NOTE: The efficient way to program may or may NOT be with an IDE; but, you do not seem to know the basic needed to judge which is more efficient.
Tim S.