Bug #11854 2007-08-26 13:12

antoniozhou

Macro defines Failure & Build options Setting Trouble!

1.Macro defines Failure :
I defined a macro 'CTEST_EXPORTS' to control exporting a CTest class in a dll project ,such as :
#ifdef CTEST_EXPORTS
    #define EXPORT_CTEST __declspec(dllexport)
#else
    #define EXPORT_CTEST __declspec(dllimport)
#endif
when i define 'CTEST_EXPORTS' in project properties setting panel ,it always doesn't work, the warning message follows:
:: === Console application, default ===
.\..\ctest\CTest.h:14: warning: inline function 'CTest::CTest()' is declared as dllimport: attribute ignored.
.\..\ctest\CTest.h:14: warning: inline function 'CTest::CTest()' is declared as dllimport: attribute ignored.
.\..\ctest\CTest.h:15: warning: inline function 'CTest::CTest(int)' is declared as dllimport: attribute ignored.
.\..\ctest\CTest.h:15: warning: inline function 'CTest::CTest(int)' is declared as dllimport: attribute ignored.
.\..\ctest\CTest.h:16: warning: inline function 'CTest::~CTest()' is declared as dllimport: attribute ignored.
.\..\ctest\CTest.h:16: warning: inline function 'virtual CTest::~CTest()' is declared as dllimport: attribute ignored.
.\..\ctest\CTest.h:16: warning: inline function 'virtual CTest::~CTest()' is declared as dllimport: attribute ignored.
.\..\ctest\CTest.h:20: warning: inline function 'int CTest::GetData()' is declared as dllimport: attribute ignored.
.\..\ctest\CTest.h:21: warning: inline function 'void CTest::SetData(int)' is declared as dllimport: attribute ignored.
:: === Build finished: 0 errors, 9 warnings ===

but if i define the macro in the header file, there is also a macro redine warning message:

:: === ctest, Debug ===
E:\CodeBlocks_Proj\ctest\main.cpp:10: warning: unused parameter 'hinstDLL'
E:\CodeBlocks_Proj\ctest\main.cpp:10: warning: unused parameter 'lpvReserved'
E:\CodeBlocks_Proj\ctest\CTest.h:4: warning: "CTEST_EXPORTS" redefined
:3:1: warning: this is the location of the previous definition
:: === Build finished: 0 errors, 4 warnings ===



2.Build options Setting Trouble!

I set the macro CTEST_EXPORTS throgh a way project->build options...->Compiler Settings->#defines, another way is project->Properties...Build targes->Build options->Compiler Settings->#defines, above two way don't have the same result, the settings in one way doesn't display when you see in another way. I want to no why, if you save the settings in different files or place?
Category
Application::Editor
Group
 
Status
Closed
Close date
2007-09-02 17:26
Assigned to
biplab
biplab 2007-08-27 19:18

1. I'm not sure where you've specified it.

2. a) If you set it via **project->build options...->Compiler Settings->#defines** then the settings will be applied to **all the targets inside the project**.

b) If you set it via **Project->Properties...Build targes->Build options->Compiler Settings->#defines** then the settings will be applied to that **specific target only**.

biplab 2007-09-02 17:14

Report is closed.

Note: This is a preformatted standard message.

Possible reasons for closing this report are:

* the developer in charge of the issue

- could not reproduce it despite trying several times

- did not get sufficient information

- got no reply to an inquiry for specific information

* the report is quite a bit dated of now, and

- no user comments have been added for several weeks

- significant changes have been made to the code

- no other developer could reproduce it either

It is assumed that the problem does not persist and the report

can be closed.

If the problem reappears in future releases, please feel free to

re-open this report and provide precise information on how to

reproduce it.