problem with compiling library
corey taylor
corey.taylor@gmail.com
Wed Feb 9 19:21:00 GMT 2005
Chris,
GCC uses __attribute__ extensions for such declarations as
dlliimport and dllexport.
http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Function-Attributes.html#Function-Attributes
has a section specifically on dllimport and dllexport and a
comparison to the declspec() Microsoft version.
As you can see, unless you are compiling under cygwin, you will need
to use the __attribute__ keyword:
"On cygwin, mingw and arm-pe targets, __declspec(dllexport) is
recognized as a synonym for __attribute__ ((dllexport)) for
compatibility with other Microsoft Windows compilers."
corey
On Wed, 09 Feb 2005 16:59:36 +0100, SEM GmbH <entwicklung@sem.at> wrote:
> hello gcc-team!
>
> at first, I have to do a short description of our problem.
>
> Since about 2 years we have a existing software (developed in delphi 5)
> that is currently running on windows-systems. Now we have to "re-write"
> this software on linux, because we have to read out a
> ticket-reading-device that is only supported by linux (fedora).
>
> To communicate with the device we got some c++-libraries (.so) for
> linux, header-files where class-decleration are contained and some
> c++-demo-source.
>
> unfortunately we can't directly access from kylix delphi the c++
> libraries, so we have to wrote some functions that return the needed
> datas (int, string, bool) and wanted to compile them into a c++-library.
> Unfortunately we have big troubles with compiling this c++ library. The
> frist attempt was to compile the library with the gcc (3.3.3) compiler,
> that failed because the compiler don't know __declspec(dllexport).
>
> the exact error-message says:
> - 'dllexport' was not declared in this scope
> - ISO C++ forbids decleration of 'declspec' with no type
>
> the secound attempt was compiling with borland kylix c++ 3. the
> compiling was succesful but the linking failed. error-message
> (unresolved external (CnServerReader::~CnServerReader()) reference from
> (main.o)).
>
> we searched many foums, newsgroups etc. but there was nothing that could
> help us.
>
> Please help me!!!!!!!!
>
> thx!
>
> Yours sincerely
>
> chris
>
More information about the Gcc-help
mailing list