Jump to content

Recommended Posts

Posted

I am requesting permission to use AutoIt's AString class in 1 of my C++ applications.

The reason why I would like to use this class instead of STL's string class is because Dev C++'s implementation of the STL is very buggy and I could not get it to work.

Looking forward to your response.

#)

  • Administrators
Posted

Sure you can use it. But Dev C will be using the gnu libraries STL implementation and that should be fine and not buggy at all. The AutoIt implementation is quite "quirky" with some odd memory allocation routines that help speed some things up that are important to autoit.

Posted

Thanks very much!

But Dev C will be using the gnu libraries STL implementation and that should be fine and not buggy at all.

Here's a small source file that I attempted to compile:

#include <cstdlib>
#include <iostream>
#include <string>

using namespace std;

int main(int argc, char *argv[])
{
    system("PAUSE");
    return EXIT_SUCCESS;
}

34 Errors. Here are a few of them:

J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/postypes.h:74: error: conflicting declaration 'typedef long long int std::streamoff'

J:/Dev-Cpp/include/c++/mingw32/bits/c++io.h:43: error: 'std::streamoff' has a previous declaration as `typedef long int std::streamoff'

J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/postypes.h:74: error: declaration of `typedef long long int std::streamoff'

J:/Dev-Cpp/include/c++/mingw32/bits/c++io.h:43: error: conflicts with previous declaration `typedef long int std::streamoff'

J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/postypes.h:74: error: declaration of `typedef long long int std::streamoff'

J:/Dev-Cpp/include/c++/mingw32/bits/c++io.h:43: error: conflicts with previous declaration `typedef long int std::streamoff'

In file included from J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/string:53,

from J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/locale_classes.h:47,

from J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ios_base.h:47,

from J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ios:49,

from J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:45,

from J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iostream:45,

from main.cpp:2:

J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_string.h: In member function `void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_dispose(const _Alloc&)':

J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_string.h:215: error: `__exchange_and_add' is not a member of `__gnu_cxx'

J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_string.h: In member function `_CharT* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_refcopy()':

J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_string.h:226: error: `__atomic_add' is not a member of `__gnu_cxx'

J:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_string.h: In member function `typename _Alloc::size_type std::basic_string<_CharT, _Traits, _Alloc>::_M_check(typename _Alloc::size_type, const char*) const':

The AutoIt implementation is quite "quirky" with some odd memory allocation routines that help speed some things up that are important to autoit.

I don't mind... the fact that it works is good enough.

I would like to thank you again!

#)

Posted (edited)

I think you better check your setup :D

This is what I get with same source:

Compiler: Default compiler
Building Makefile: "C:\slettes\Makefile.win"
Executing  make...
make.exe -f "C:\slettes\Makefile.win" all
g++.exe -c test.cpp -o test.o -I"Z:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"Z:/Dev-Cpp/include/c++/3.4.2/backward"  -I"Z:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"Z:/Dev-Cpp/include/c++/3.4.2"  -I"Z:/Dev-Cpp/include"   

g++.exe test.o  -o "Project1.exe" -L"Z:/Dev-Cpp/lib"  

Execution terminated
Compilation successful

No warnings, no errors just plain happiness :D

Edited by Uten
Posted

Same here... Compiles excellently. I noticed you had yours installed to J:\ Is this an attached drive or removable?

Also another compiler you may want to check out (I havent yet, but soon hope to have the chance to really get into it) is Code::Blocks.

If you try it before I do let me know how it works for you. If I make it first then I will let you know.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Posted

Code::Blocks is just a IDE/editor (same as dev-c). Configuring Code::Blocks to use another compiler seems to be easier than dev-c (not shure it is possible in dev-c). As fare as I know you can choose between mingw32, MS or Borlands compilers (MS and Borland have freeware options). Probably some of the others to.

In dev-c you could try to launche devcpp.exe with the \config option to get ride off old settings.

Posted

Code::Blocks is just a IDE/editor (same as dev-c). Configuring Code::Blocks to use another compiler seems to be easier than dev-c (not shure it is possible in dev-c). As fare as I know you can choose between mingw32, MS or Borlands compilers (MS and Borland have freeware options). Probably some of the others to.

In dev-c you could try to launche devcpp.exe with the \config option to get ride off old settings.

Yes I know they are both IDE's. Dev's C++ can only run GCC and Mingw32 (to my knowledge) (only two compilers). However on the other hand; Code::Blocks can run of some of the most common compilers around and available today.

Not to mention the IDE part of Code::Blocks is more advanced. You can have multiple projects going all in one simple window where as Dev's C++ you must have multiple windows...

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Posted

It's actually a good lesson to set up mingw32 "from scratch". And then make dev-c or any other IDE use it.

@nfwu if you use the updatemanager in dev-c you should get the latest (or atleast one of the latest) mingw32 binaries.

I have not tried Code::Blocks for a while but it does have quite a few things going for it in the competition with dev-c. You dont need Delphi to make changes is one of them.. :D (NOTE: I think Delphi is a really nice pice of work, but it is to expencive to have as a tool you just use occationaly, sorry Borland )

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...