User forums > General (but related to Code::Blocks)
Import a mvs2012 solution
BlueHazzard:
ws2_32 is a windows library... it "comes" with mingw, so you don't have to do anything else as adding it to the linker libraries
for the mysql thing you have two options: google for "mysql mingw windows" or
http://forums.codeblocks.org/index.php/topic,21701.msg147853.html#msg147853
Note: this is my last post in this thread because it has nothing to do with codeblocks and so violates the forum rues. If you have more question about using microsoft dll with mingw ask on stackoverflow or other programming forums. If you have other questions about codeblocks feel free to come back and ask. We will happily answer them...
patrocle:
back again,
this time is related to Makefile.
I tryed to load the project makefile
--- Code: ---SHELL = /bin/sh
SYSTEM = $(shell uname)
C++ = g++
DFLAGS =
OFLAGS = -O3
LFLAGS = -lmysqlclient -lboost_system
CFLAGS =
CFLAGS += $(OFLAGS) $(DFLAGS) -I. -I../
GHOSTOBJS = config.o
OBJS = elo.o update_dota_elo.o
PROGS = ./update_dota_elo
all: $(GHOSTOBJS) $(OBJS) $(PROGS)
./update_dota_elo: $(GHOSTOBJS) $(OBJS) $(COBJS)
$(C++) -o ./update_dota_elo $(GHOSTOBJS) $(OBJS) $(LFLAGS)
clean:
rm -f $(GHOSTOBJS) $(OBJS) $(PROGS)
$(GHOSTOBJS): %.o: ../%.cpp
$(C++) -o $@ $(CFLAGS) -c $<
$(OBJS): %.o: %.cpp
$(C++) -o $@ $(CFLAGS) -c $<
./update_dota_elo: $(GHOSTOBJS) $(OBJS)
all: $(PROGS)
config.o: ../ghost.h ../config.h
elo.o: elo.h
update_dota_elo.o: ../config.h elo.h
--- End code ---
and i have this error:
--- Code: ----------------- Build: Release Win32 in update_dota_elo (compiler: GNU GCC Compiler)---------------
Checking if target is up-to-date: make.exe -q -f Makefile Release Win32
Running command: make.exe -f Makefile Release Win32
make.exe: *** No rule to make target 'Win32'. Stop.
make.exe: Nothing to be done for 'Release'.
Process terminated with status 2 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
--- End code ---
My quest is: how to add 'Debug' in actual Makefile to be readable for C::B?
sodev:
This Makefile won't work on Windows, but why bother with it anyway? All it does is compiling 3 files, why dont you make a CodeBlocks project that compiles these files?!
stahta01:
--- Quote from: patrocle on May 09, 2017, 10:49:35 am ---Thank you guys for all help!
Allready I tryed MSys2 from here https://nuwen.net/mingw.html but i cant find ws2_32.lib or libmysql.lib
--- End quote ---
So, you do NOT understand what MSys2 is. And likely can NOT follow directions.
I will try to remember that about you so I do NOT waste my time trying to help you in the future.
Tim S.
patrocle:
@stahta01 really sorry but I'm not advanced like you expect :'(, and for me is not so easy to find directions. I did not want to upset you.
@sodev Thank you for the point, didnt know how CB works with gcc in windows.
I build the project succesfully,
--- Code: ---g++.exe -Llib -Latlmfc\lib -L -L..\zlib\lib -L..\mysql\lib\opt -LC:\5entbot\mysql\lib\opt -LC:\5entbot\mysql\lib\opt -LC:\5entbot\bncsutil\vc8_build -LC:\5entbot\bncsutil\src\bncsutil -LC:\5entbot -o update_dota_elo.exe .objs\ghost\config.o .objs\update_dota_elo\elo.o .objs\update_dota_elo\update_dota_elo.o -lboost_system -lmysql -mwindows
Output file is update_dota_elo.exe with size 2.91 MB
Process terminated with status 0 (0 minute(s), 6 second(s))
0 error(s), 0 warning(s) (0 minute(s), 6 second(s))
--- End code ---
but when i test it, the mysql code is not integrated in the build.
This is why I asked for the Makefile, because I saw this command inside of the Makefile
--- Code: ---LFLAGS = -lmysqlclient -lboost_system
--- End code ---
If I add to compiler "-lmysqlclient" i get this error:
--- Code: ---g++.exe -Llib -Latlmfc\lib -L -L..\zlib\lib -L..\mysql\lib\opt -LC:\5entbot\mysql\lib\opt -LC:\5entbot\mysql\lib\opt -LC:\5entbot\bncsutil\vc8_build -LC:\5entbot\bncsutil\src\bncsutil -LC:\5entbot -o update_dota_elo.exe .objs\ghost\config.o .objs\update_dota_elo\elo.o .objs\update_dota_elo\update_dota_elo.o -lboost_system -lmysqlclient -lmysql -mwindows
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmysqlclient
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 6 second(s))
2 error(s), 0 warning(s) (0 minute(s), 6 second(s))
--- End code ---
If the MSys2 is the key to made it I must read more,mby i need this version http://www.msys2.org/
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version