Author Topic: Portability Question )  (Read 3966 times)

Offline Roman

  • Multiple posting newcomer
  • *
  • Posts: 78
Portability Question )
« on: August 28, 2007, 09:40:14 pm »
Hi there!

MinGW fans may kill me in no time but the question sticks in my head:

Coud C::B be compiled by MSVC (6,7,8)?
Did someone try?

Why I'm interesting:
MSVC shows several times better performance when doing with c++ streams. I suppose C::B uses them much (correct me if I'm wrong). So it is interesting to have a build with 'fast' IO )

Best Regards,
Roman
CB LSI (C::B as a Little Secret Initiative)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6727
    • My Best Post
Re: Portability Question )
« Reply #1 on: August 28, 2007, 10:14:56 pm »
Yes, someone has tried. I never heard of anyone who finished it. But, someone posted that he was close in the past year or two.

I tried once, gave up after two hours of trying.

Tim S

Very old mid 2005 thread
http://forums.codeblocks.org/index.php/topic,335.30.html

Early 2006 threads
http://forums.codeblocks.org/index.php/topic,2437.0.html
http://forums.codeblocks.org/index.php/topic,2085.0.html

« Last Edit: August 28, 2007, 10:32:20 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Portability Question )
« Reply #2 on: August 29, 2007, 12:17:54 am »
Code::Blocks uses no streams at all (at least not the streams you are thinking about). Building Code::Blocks with MSVC 6/7 is almost certainly impossible, since they don't support the necessary C++ language features.

MSVC 8 might work, I don't know... there is no urgent reason why it should not.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Roman

  • Multiple posting newcomer
  • *
  • Posts: 78
Re: Portability Question )
« Reply #3 on: August 29, 2007, 04:30:28 pm »
they don't support the necessary C++ language features.

I know a bit of sad truth about VC6 ). What are C++ features missing in VC7 but used by C::B?

With regards,
Roman

CB LSI (C::B as a Little Secret Initiative)

Offline Tjaalie

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Portability Question )
« Reply #4 on: August 29, 2007, 10:49:10 pm »
Actualy I'm working on a version that works on MSVC becouse this is my first step into compiling a x64 version
wich I don't think I will ever compile.

Offline Tjaalie

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Portability Question )
« Reply #5 on: August 30, 2007, 05:10:09 pm »
I have a problem with the fact that the SDK uses -export-all-symbols, the ms compiler doesn't have a parameter like this
so I can build the codeblocks.dll but not all the needed stuff is exported, im working on a tool that will extract all this info
from a .obj and then add it to a .def file. So I got all build targets working till 'src' wich fails on linking becouse of the fact that
not everything is exported.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: Portability Question )
« Reply #6 on: August 30, 2007, 05:38:44 pm »
I have a problem with the fact that the SDK uses -export-all-symbols, the ms compiler doesn't have a parameter like this
so I can build the codeblocks.dll but not all the needed stuff is exported, im working on a tool that will extract all this info
from a .obj and then add it to a .def file.

I don't know if this works PEEXPORT.EXE, it extract info that you can output to some .def file. You can find that tool on the Walk32 package. Here is a download location: http://www.programmersheaven.com/download/355/download.aspx

Offline Tjaalie

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Portability Question )
« Reply #7 on: August 30, 2007, 06:48:49 pm »
Does this suport .obj (COFF) files?
Becouse I can't test it becouse I have a 64bit system and it complains that
this is not a a 64 exe, while code blocks another 32 bit exe works fine.

But I found a very usefull document on MSDN,

http://www.microsoft.com/whdc/system/platform/firmware/PECOFFdwn.mspx
« Last Edit: August 30, 2007, 06:51:01 pm by Tjaalie »

Offline Tjaalie

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Portability Question )
« Reply #8 on: August 30, 2007, 07:50:20 pm »
Owke I managed to extract the symbol names from the .obj file.
But the contents seems a bit cryptic, the names are there but I fail to understand all the other stuff inside the name.
And of course when you declerate it as something else as the standard __thiscall (if I recall correct) it will be totaly different (correct?).
But if there is a realy smart guy floating around here that is willing to give me a hand at this stuff here is the output (so far).

Quote
Crc32.obj (from sdk/Crc32.cpp)
[email protected]@[email protected]
[email protected]@Z
[email protected]@Z
[email protected]@[email protected]
[email protected]@@[email protected]@@Z
[email protected]@@[email protected]@@Z$1
[email protected]@@[email protected]@@Z$0
[email protected]@[email protected]@[email protected]@[email protected]@@Z
[email protected]@@[email protected]@@Z
___CxxFrameHandler3
@[email protected]
[email protected]@@[email protected]@@Z
[email protected]@[email protected]
[email protected]@Z

In the mean time I will google my **s off.

So far I think the double '?' must be ignored and and the single '?' contain the usefull stuff, I'm going to write a simple extractor but I would like to know what the rubbish at the end of the name does?

EDIT:
No Problem(tm) I already found it out. You only want the ones with ? in front and read till a @ is it a double class name follows, else parameter trash follows. Its realy easy I'm gonne finish the tool now, if anyone is intrested I can post the source+binary, its a realy handy tool if you want to export all functions and classes from a vc++ dll but don't want to create a .def file by hand, all you need is all the .obj files.
« Last Edit: August 30, 2007, 08:19:53 pm by Tjaalie »

Offline Tjaalie

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Portability Question )
« Reply #9 on: August 30, 2007, 09:45:58 pm »
The tool is ready, I will upload it here.
Its one big hacked togetter c and c++ mixture so don't expect to feel happy when you look at the code.

Usage '"OBJ2DEF [obj file] [def file] [0=overwrite 1=apend]"
The only thing you need to do after you used this app is add the following lines
infront of your generated .def file:
Code: [Select]
LIBRARY [YourDllNameHere]
EXPORTS

[attachment deleted by admin]