473,385 Members | 1,528 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,385 software developers and data experts.

Cannot export class symbols

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
#include <stdio.h>
class DLLEXPORT MyTestClass
{
public:
MyTestClass() { }
~MyTestClass() { }
int GetSuccessor(int a) { return a + 1; }
int GetPredecessor(int a) { return a - 1; }

};
As you can see, I want to export that class into a DLL.
So, I do:

g++ -shared -o test.dll test.cpp -Wl,-output-def=test.def -DDLL
and my DLL is an empty DLL with no exported symbols!!! (and the .def
file has length 0).
Am I doing something wrong? I am creating a C++ library, so, I want to
export only classes into my DLL.
Thanks in advance
Ernesto

Jul 23 '05 #1
1 2117
ernesto wrote:
I am writing this very small test class using g++ and mingw:

#ifdef DLL
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT __declspec(dllimport)
#endif

[...]


These things are not standard C++. Please ask in a newsgroup for
your compiler since compiler-specific extensions are OT here. Thanks.

V
Jul 23 '05 #2

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

Similar topics

3
by: roblenderman | last post by:
I start in debug mode and set a breakpoint on the page load event for the startup page. The browser opens and the page renders. The breakpoint turns to a "?" and says the breakpiont cannot be...
10
by: New_user | last post by:
Hello. Excerpt from ISO/IEC 14882 : 14/6 A namespace-scope declaration or definition of ........skipped...... a non- inline member function of a class template or a static data member of a...
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 created this very small class on Windos32, mingw: main.h ------ #ifdef DLL #define DLLEXPORT __declspec(dllexport) #else #define DLLEXPORT __declspec(dllimport)
0
by: Rob Burke | last post by:
I'm trying to create a hybrid Managed/unmanaged C++ DLL that uses ATL and wraps some of DirectShow. When I add a reference to that Managed C++ DLL in another managed project, I end up...
1
by: Jim | last post by:
Have fully operational software package developed on VB.NET that worked until Jan 1 2003, with early stage deployments on Oct 10, Oct 23, Nov 11, Dec 12 and Dec 30. When attempted final...
0
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
17
by: Fabry | last post by:
Hi All, I'm new of this group and I do not know if this is the correct group for my question. I have a DLL with its export library (.lib) wrote in Borland C++ 6. In borland everything is OK and...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.