473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Export symbols from .a files

Hi, everybody:

I created this very small class on Windos32, mingw:

main.h
------
#ifdef DLL
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT __declspec(dllimport)
#endif

class DLLEXPORT A
{
public:
A();
virtual ~A();

virtual const char* GetMessage();
};

class DLLEXPORT B : public A
{
public:
B();
virtual ~B();

virtual const char* GetMessage();
};
main.cpp
----------
#include <stdio.h>

#include "main.h"

A::A()
{
printf("A constructor\n");
}

A::~A()
{
printf("A destructor\n");
}

const char* A::GetMessage()
{
return "Hello A world";
}

B::B()
{
printf("B constructor\n");
}

B::~B()
{
printf("B destructor\n");
}

const char* B::GetMessage()
{
return "B sides are better";
}

I compiled it using:

g++ -c main.cpp -DDLL
ar -r main.a main.o
g++ -shared -o main.dll main.a -Wl,-output-def,main.def

and it does not export any symbols, but doing a:

g++ -shared -o main.dll main.o -Wl,-output-def,main.def

exports all classes and methods perfectly.

Any ideas?
ernesto

Jul 23 '05 #1
1 4161
ernesto wrote:
Hi, everybody:

I created this very small class on Windos32, mingw:

main.h
------
[...]
main.cpp
----------
[...]
I compiled it using:

g++ -c main.cpp -DDLL
ar -r main.a main.o
g++ -shared -o main.dll main.a -Wl,-output-def,main.def

and it does not export any symbols, but doing a:

g++ -shared -o main.dll main.o -Wl,-output-def,main.def

exports all classes and methods perfectly.

Any ideas?

Please post to a newsgroup dedicated to your compiler. Your question
is compiler-specific and as such is off-topic in a language newsgroup.
I recommend gnu.g++.help.

V
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Torbak | last post by:
I got some question about symbols in libraries ... In libraries, there is public symbols and "not public" symbols (private, static)... In C when we use the "static" keyword on the declaration of...
2
by: asdf | last post by:
Hello, I was enjoying working in VS for half a year without any problems and now I cannot debug anymore. Without any really reason my Studio tells me that the page that I want to debug has - No...
1
by: glaserp | last post by:
Hi, I am developing a Windows application with C# in Visual Stuio .NET. My application references three assemblies that are developed in another project. I have added these assemblies as...
205
by: Jeremy Siek | last post by:
CALL FOR PAPERS/PARTICIPATION C++, Boost, and the Future of C++ Libraries Workshop at OOPSLA October 24-28, 2004 Vancouver, British Columbia, Canada http://tinyurl.com/4n5pf Submissions
1
by: ernesto | last post by:
Hi everybody: I am writing this very small test class using g++ and mingw: #ifdef DLL #define DLLEXPORT __declspec(dllexport) #else #define DLLEXPORT __declspec(dllimport) #endif
0
by: shan | last post by:
*** ERROR: Module load completed but symbols could not be loaded for crystaldecisions.web.dll *** ERROR: Module load completed but symbols could not be loaded for crystalenterpriselib.dll ***...
4
by: Steven T. Hatton | last post by:
<quote url="http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=53&rl=1"> exported Templates Last updated Sep 6, 2006. exported Templates The separate compilation model enables...
5
by: JHNielson | last post by:
I have a somewhat simple question, but have been baffled by it for a while, and now I'm on a tight deadline - have to get it done within 24 hours. I am trying to export a set of files to my hard...
2
by: =?Utf-8?B?U2VhbiBDb25uZXJ5?= | last post by:
Is there a way to automagically export all the symbols in a dll? mingw has an argument --export-all-symbols. I'm not afraid to write some scripts to do my work, so suggest anything :-) The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.