cmake codeblocks project - missing libs

I'm using the latest box2d source files & codeblocks 10.05 running on windows 7.
This is what I've done so far:

-downloaded latest box2d source files (v2.2.1)
-downloaded and installed cmake (v2.8.6) (setup is good AFIK)
-opened cmake GUI and set paths,hit configure,and generate no problems (I did have to set the code blocks exe path myself. see here)
-Opened the codeblocks project that was generated in the box2d build folder.
-built and compiled
I was hoping the testbed would just spring into action but then the compiler complained...

Code:
-------------- Build: all in Box2D ---------------

Using makefile: Makefile
[ 29%]
Built target Box2D
[ 59%]
Built target Box2D_shared
[ 60%]
Built target HelloWorld
[ 76%]
Built target freeglut_static
[ 98%]
Built target glui
Linking CXX executable Testbed.exe
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lwinmm.lib
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lglu32.lib
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lopengl32.lib
collect2: ld returned 1 exit status
mingw32-make.exe[2]: *** [Testbed/Testbed.exe] Error 1
mingw32-make.exe[1]: *** [Testbed/CMakeFiles/Testbed.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2
Process terminated with status 2 (7 minutes, 32 seconds)
3 errors, 0 warnings


it says I'm missing those 3 libraries:
lwinmm.lib
lglu32.lib
lopengl.lib

Now do I need to obtain these libraries myself and link them to the project (I assume the opengl and glut libs are required for the testbed, the other I think has something to do with time i think?...) Or did I possibly do something wrong? I haven't altered the project that Cmake generated in any way.
wow I'm an idiot... 🙄 I didn't even notice they were supposed to be in the Mingw folder. I've found the files I believe but they are .a files not .lib files. I'm off to try and find out a way to tell the compiler to look for those instead. If any one sees this and knows a way to fix this that would be handy. either way I'll post what I find
This is what mine has, maybe it will help:

Right click the 'TestBed' project, choose 'Properties...' -> 'Project's build options' -> 'Linker settings'

In the 'Link libraries' list, I have:
GLU32
OpenGL32
GDI32
WinMM
(plus the Box2D libs as well)

I guess these are found in the MinGW folder automatically. You can also specify a full path name if you still have trouble. The .a files are the ones you want.
I dont think it got built properly. Look at this...
I only get one big project with all the source files and headers in one

it sounds like there should be a few different projects....


[Edit] there are however project files for visual studio. perhaps this make file just wont work for codeblocks in that manner. I suppose I can make my own box2d static library with the codeblocks template. Then just compile the test bed my self by creating a new project and adding the test bed source files to it. I'll try that now
Yeah they are intended to be separate. However if you have got to the linking stage I guess it's mostly working out. You might need to remove the HelloWorld from the picture because it also has a main() which you don't want to use.
You should be able to do what I said above for the 'Box2D' project.
Yeah thats the thing it doesn't show anything about linker options... I get post build and pre build options and a tab that shows libraries being linked (none currently) but I dont have the option to add any... Its weird because thats one of the first things I tried. Any project I create I have no problem doing this....

But I just deleted the box2d folder and did a reinstall and re ran cMake and removed hello world.
Should the build process take FOREVER though? I mean I hit F9 to compile and run like 10 mins ago and I'm at 3% 😮

It did this the first time I built it too. I had to run it over night. sigh..All I know is this is driving me bat shit crazy! I'm frickin amped to use this software...
No. My new quad-core can build this in a few seconds (oohh... bet you didn't want to hear that eh 😆 )

Maybe you could try the project files I uploaded here:
http://www.iforce2d.net/b2dtut/setup-windows
Is there any way you could upload the files for v2.2.1??? I actually was going by your site this whole time lol. I was gonna just download those but I saw that yours was a little older and I kinda wanted the latest and greatest. I dont think the new version adds or changes a whole lot but I'd like to start with the most recent..

I'm at work now so I'll have to wait to try it anyway. If you think I'd be fine just using 2.2.0 I'll download those when I get home and give it a try. Thanks
Finally! I downloaded the old version and used your projects and it worked, I had the test bed running.

but it really got to me that I didn't have the latest version lol. I'm just too damn picky....
So basically I just used your project files as a guide to create my own test bed project. all the necesarry lib files were already created by cmake(or possibly my attempted build???) they were just scattered all over in the build folder. (libfreeglut.a, libbox2d.a, and libglui.a)

not really scattered but just seperated into their own corresponding folders. I would prefer the previous versions file layout myself but thats just me.

Anyway I linked the libraries necesarry (I didn't have to specify the mingw libs specifically by the way, same as how yours was) and set all the corresponding search dirs.

So now I have the test bed 😀 . 3 days later and I can finally start your tutorials lol. But thank you for your help it definatley helped steer me in the right direction as I'm sure you and your tutorials will in the future.

see ya around

Original thread: https://box2d.org/forum/viewtopic.php?t=7853