Author Topic: building CodeBlocks with M$ VC++ Toolkit 2003  (Read 36466 times)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #30 on: June 18, 2005, 08:40:16 am »
Quote from: CrazyAbbot
... ok i just managed to get the codeblocks.dll to build and i managed to link it with the codeblocks.exe  (albiet with 600+ warnings, but working none the less)...


Great !
can you upload the diffs & project files somewhere ?
i would like to have a closer look too.

thanks, tiwag

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #31 on: June 18, 2005, 05:35:31 pm »
Quote

in the file startherepage.cpp what is this class for?
Code

class DLLIMPORT MyHtmlWin : public wxHtmlWindow

I had to remove the DLLIMPORT macro for it to compile


You're right! DLLIMPORT should only be used for files belonging to the SDK! I'm gonna remove it right now. I'm also adding the DLLIMPORT to messagemanager.

As a final note, can you report a bug ( Correction: feature request) at sourceforge about the 600 warnings? Please upload a file, too. Thanks :)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #32 on: June 18, 2005, 06:21:03 pm »
Quote from: rickg22
As a final note, can you report a bug at sourceforge about the 600 warnings? Please upload a file, too. Thanks

This is not a bug Rick!
It's the code he edited to compile with an unsupported (yet) compiler. What makes you think I should be hunting down bugs from source code outside the CVS tree, instead of fixing existing (and real) bugs?

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

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #33 on: June 18, 2005, 06:51:04 pm »
Oh, sorry. Then it should be a feature request then. Anyway I'm installing the MSVC Toolkit. Actually I'm beginning to think I should have installed it from the beginning (as to give more support to VC++ users). I got this curiosity for since the bug reports about importing msvc projects.

This way, I think I could offer windows support as Yiannis' field is Linux :)

Anyway - Tiwag, mind giving me a hand with this? You were the one who started this whole "compiling with msvc" business. And you're OBVIOUSLY a msvc++ user, so.... :)

CrazyAbbot

  • Guest
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #34 on: June 19, 2005, 03:37:46 am »
Well, it is the code from the CVS, I just had to fix a few bugs to get it to compile.

Anyway there are a few major types of warnings that appear:

Implict cast from size_t to int (nothing important)
Calling the SANITY_CHECK() macro, but not giving it any parameters.
Cast from pointer to a long.
Using magic numbers, instead of a boolean true or false

and the main one with making codeblocks.dll

Take this bit of code from configmanager.h
Code

WX_DECLARE_OBJARRAY(ConfigurationPath, Configurations);


I ran the header file through the preprocessor to see what it did and this is the declaration of the class it generated

Code

class Configurations : protected wxArrayPtrVoid


so this macro is creating a class called Configurations.

If a class is declared as being exportable (in this case, ConfigManager), then all the member classes of that class must be exportable as well (class Configurations).

so MSVC wants this class to be declared as DLLEXPORT.  however it seems to be working fine without it.  is class Configurations ever used from OUTSIDE the dll?  if it's only for internal use (IE, within the DLL) then that is probably ok.


I will try to stuff about with the wx widgets header files to get their macro to declare the class as DLLEXPORT and see if that stops the compiler warnings.

rickg22:  What do you want me to upload?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #35 on: June 19, 2005, 07:21:13 am »
CrazyAbbot: Actually just the info about the warnings, but it seems you just listed it here.

The macros declare arrays, so i don't think it'll be a problem. They're data-only classes and they're MSVC-safe.

Anyway I modified the latest CVS with some of your dllimport modifications.

Hey, I have an idea  that Yiannis might like. In the stdafx.h we could check for NULL and define it as 0L depending on the configuration, if it's not set.

NOTE:
Regarding my installation of the platform SDK, it seems i'm the first to experience an awful error with windows installer 3.1v2. No matter what package i'm installing, it aborts unexpectedly. It could be something in my config, or it could be one of the infamous "updates". Until Microsoft fixes this issue (i submitted an automated report), I'm afraid I won't be able to install the platform SDK nor try to compile codeblocks by myself. Sorry, you're on your own for now :(

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #36 on: June 19, 2005, 09:37:19 am »
Quote from: rickg22
... I modified the latest CVS ...


Would it be possible to create and maintain a web-log where one can read about the latest cvs-changes ?

or is it possible to automatically create a log of all check-in comments of  all newly modified files ?

@rick: what kind of help do you need regarding MSVC ?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #37 on: June 19, 2005, 09:44:58 am »
Quote from: CrazyAbbot
so MSVC wants this class to be declared as DLLEXPORT. however it seems to be working fine without it. is class Configurations ever used from OUTSIDE the dll? if it's only for internal use (IE, within the DLL) then that is probably ok.

Try replacing
Code
WX_DECLARE_OBJARRAY(ConfigurationPath, Configurations)
with
Code
WX_DECLARE_USER_EXPORTED_OBJARRAY(ConfigurationPath, Configurations, DLLIMPORT)
and see if it works.

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

CrazyAbbot

  • Guest
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #38 on: June 19, 2005, 10:17:17 am »
rickg22:  What are you talking about with the null macro? every compiler i've seen defines it, its in the standard library.


mandrav:
That fixed it

Would you mind if I went through the source code and fixed just about all the warnings that MSVC is generating? and put a few pragmas in to turn off the size_t cast warnings?

It shouldn't cause the GCC compile to break, and I can always test it and fix that.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #39 on: June 19, 2005, 11:59:24 am »
Quote from: CrazyAbbot
Would you mind if I went through the source code and fixed just about all the warnings that MSVC is generating? and put a few pragmas in to turn off the size_t cast warnings?

It shouldn't cause the GCC compile to break, and I can always test it and fix that.

Patches are always welcome ;)
Just make sure you work on recent CVS.

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

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #40 on: June 20, 2005, 03:31:43 am »
CrazyAbbot: I'm talking about the NULL macro because many pointer to integer conversion warnings are caused by the 0L (instead of null) present in many functions. (Right Yiannis?).

Anyway, all changes you make should be posted in the "patch requests" at sourceforge (it's right after 'RFE')

tiwag: Just testing MSVC builds and possible bugs / misconfigurations. Making a tutorial on "compiling codeblocks and wxwidgets with MSVC" wouldn't be bad, either :)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #41 on: June 21, 2005, 05:49:31 am »
I just reinstalled windows on my machine and fixed the registry with some tool.

:( Still doesn't work. So VC++ is now officially not-supported-by-me.

CrazyAbbot

  • Guest
building CodeBlocks with M$ VC++ Toolkit 2003
« Reply #42 on: June 21, 2005, 06:37:04 am »
I can probably do it,
It's more or less working now, there is just a few dll export issues to clean up