Author Topic: Compile errors  (Read 18740 times)

JustinThyme

  • Guest
Compile errors
« on: January 20, 2005, 03:46:27 am »
I just downloaded and installed Code::Blocks, and so far, it looks amazing!  Before I get to my problem (which I think I already know the answer to), please let me say thanks for your hard work in providing a great free tool!

Anyway, I installed CB and MinGW (into default directories).  One HUGE benefit that CB seems to have is importing projects from different formats.  I have MSVC6.0, but there are some .vcproj's I'd like to use, but the available conversion utilities leave much to be desired.

For a point of reference, the project in question is a port of the Quake game engine.

The import seems to go fine.  I go into the project options and ensure MinGW is selected, and the directories are correct.  On compile I was just seeing several red errors, and it wouldn't compile.  I thought there might be a config error, but I created a generic win32 shell, and it compiled fine.  I went back to the game project and tried it again.  On closer inspection, one of the errors was something like:

"winsock.lib not found"

Sure enough, it isn't in the MinGW libraries.  So I'm assuming I need to install the MS Windows Platform SDK.  Correct?

As I'm a hobbyist, and not a programmer, another silly question.  Is the VC2003Toolkit strictly .NET based, or will it compile traditional C++ code?  I have the Toolkit, and could go that route as well.

mike

  • Guest
Compile errors
« Reply #1 on: January 20, 2005, 09:24:07 am »
VCToolkit 2003 is a C/C++ compiler and linker, usually delivered with MSVS .NET 2003, along with some necessary libraries (kernel32.lib and libc.lib in different flavours). So "vcproj", being a C/C++ project, shall compile just fine.

I am afraid I cannot answer you proficiently on the "winsock" question, but my guess is that even if you get the library with Platform SDK, it might not link as the objects produced by MinGW might not be compatible with those produced by VC (which was probably used for "winsock"). But this is just a guess, don't take it for absolute truth :-)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Compile errors
« Reply #2 on: January 20, 2005, 09:51:57 am »
Quote from: mike
I am afraid I cannot answer you proficiently on the "winsock" question, but my guess is that even if you get the library with Platform SDK, it might not link as the objects produced by MinGW might not be compatible with those produced by VC (which was probably used for "winsock"). But this is just a guess, don't take it for absolute truth :-)

mike is right. Even if you get the Platform SDK, gcc will probably not link with these libs...
Go to project options and, in linker options, change all xyz.lib entries to -lxyz (e.g. winsock.lib to -lwinsock). If it's using only windows standard libraries, this might get the job done.
Your other option, is to install VC free toolkit and patform SDK and build with it.

Two notes:
a) Quake is cross-platform so it should compile with gcc, easily
b) When you imported the .vcproj, codeblocks should ask you to convert its options to gcc's format (this would convert the libs like above). Didn't it?

Yiannis.
Be patient!
This bug will be fixed soon...

JustinThyme

  • Guest
Compile errors
« Reply #3 on: January 20, 2005, 02:32:15 pm »
Since I do have (but not installed) both the VCToolKit and Platform SDK, it wouldn't both me to install it.  But I know other Quake versions compile fine under MinGW, so I assumed this one would too, although there is no mention in it's meager documentation about it.

I'm trying again as I type to make sure my process is correct:

- Open CB
- Go to Project | Import... | MSVS
- Browse to .vcproj and OK
- Select Compiler box select MinGW
- Change command line switches....Yes
- Config to Import....GLRelease|Win32
- Click OK

The project seems to open, but in the browse window, under Workspace, I have the app name, JoeQuake, and then one folder..."Others", which has the assembler code and resources.  Normally, under VC, there would be folders for Source, Headers, Resources, External Dependancies, and maybe a couple others.

Here's the output:

Quote

Project   : joequake
Compiler  : MinGW Compiler Suite
Directory : C:\Games\Source\joequake\
C:\DOCUME~1\MIKEME~1\LOCALS~1\Temp\cbm1FE.tmp:60: no file name for `-include'
mingw32-g++.exe  -o ./release_gl/joequake-gl.exe -LC:/MinGW/bin    dxguid.lib opengl32.lib wsock32.lib winmm.lib libpng.lib zlib.lib  /incremental /pdb:.\\release_gl/joequake-gl.pdb
mingw32-g++.exe: dxguid.lib: No such file or directory
mingw32-g++.exe: opengl32.lib: No such file or directory
mingw32-g++.exe: wsock32.lib: No such file or directory
mingw32-g++.exe: winmm.lib: No such file or directory
mingw32-g++.exe: /incremental: No such file or directory
mingw32-g++.exe: /pdb:.\release_gl/joequake-gl.pdb: Invalid argument
mingw32-make.exe: *** [release_gl/joequake-gl.exe] Error 1
Process terminated with status 1 (0 minutes, 1 seconds)
0 errors, 0 warnings


Tonight I'll probably try installing the MS stuff and see how it goes.

Thanks for the help!

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Compile errors
« Reply #4 on: January 20, 2005, 08:07:20 pm »
Quote
mingw32-g++.exe -o ./release_gl/joequake-gl.exe -LC:/MinGW/bin dxguid.lib opengl32.lib wsock32.lib winmm.lib libpng.lib zlib.lib

You didn't change the libs as I told you...
Quote
Go to project options and, in linker options, change all xyz.lib entries to -lxyz (e.g. winsock.lib to -lwinsock)

Do this and remove the linker options "/pdb:.\release_gl/joequake-gl.pdb" and "/incremental". Hopefully, the linking will succeed then...

Yiannis.
Be patient!
This bug will be fixed soon...

Anonymous

  • Guest
Compile errors
« Reply #5 on: January 22, 2005, 10:37:11 pm »
Well, actually, I kinda did...from your initial response...

Quote from: mandrav
Two notes:
a) Quake is cross-platform so it should compile with gcc, easily
b) When you imported the .vcproj, codeblocks should ask you to convert its options to gcc's format (this would convert the libs like above). Didn't it?


That was why for my reply I stepped back through openning the project.  But to answer your question, no, it didn't automatically make those changes.  I then made the manual changes, and it still didn't compile.

But in any case, I'm going to start with something less complex to make sure everything is working right, then I'll move up to a more ambitious project.

Thanks for the help!

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Compile errors
« Reply #6 on: January 22, 2005, 11:10:48 pm »
Quote from: Anonymous
But to answer your question, no, it didn't automatically make those changes.  


Thanx for this info. I 'll have to check this...

Yiannis.

PS: Btw, can you send me this .vcproj file?
Be patient!
This bug will be fixed soon...