Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 971807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:01:18+00:00 2026-05-16T03:01:18+00:00

Program :main.cpp struct X { int x; }; export template <class T> T const&

  • 0

Program :main.cpp

 struct X {
            int x;
           };

export template <class T> T const& min(T const&, T const&);

int main() 
 {
  return min(2, 3);
 } 

x.cpp

 struct X {
    int  x; 
     };

 export template <class T> T const& min(T const &a, T const &b) {
 return a<b ? a : b;
  } 

error:Compiling with gcc

 export.cpp:23: warning: keyword ‘export’ not implemented, and will be ignored
 export.cpp: In function ‘int main()’:
 export.cpp:27: error: call of overloaded ‘min(int, int)’ is ambiguous

 swap.cpp:16: warning: keyword ‘export’ not implemented, and will be ignored

error: Compiling with EDG compiler

export.cpp", line 27: error: more than one instance of overloaded function    
export.cpp", line 23: error: support for exported templates is disabled
swap.cpp", line 16: error: support for exported templates is disabled

Can anyone solve this problem?

Any one explain the usage of export keyword?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:01:19+00:00Added an answer on May 16, 2026 at 3:01 am

    Looks like your compiler doesn’t support separate template compilation. It is a common practice not use separate compilation with templates and distribute templates in header files. Besides that, I spotted several issues.

    1. Remove export keyword from the declaration. This should take care of call of overloaded ‘min(int, int)’ is ambiguous error message. A template may be defined as exported only once in a program.
    2. X is defined twice. Why?

    P.S. I’ve never seen any code which uses exported templates. A while ago, when I was learning C++, every compiler I tried did not support exported templates. No wonder it’s going to be deprecated from C++.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following program: #include <iostream> #include <algorithm> using namespace std; template<class T> struct
#include <ctime> #include <iostream> #include <cstring> int main() { struct tm tm ; //memset(&tm,
This is my program: int main(int argc, char *argv[]){ if(argc != 2){ printf(Uso: ./server
Consider this program int main() { float f = 11.22; double d = 44.55;
I am working on a class for an existing main program, and it is
I am compiling the following simple program with g++-4.6.1 --std=c++0x : #include <algorithm> struct
I currently have two threads running in my program: Main thread - Grabs image
I use the Frama-C tool to generate the dependence graph of this program(main.c). #include<stdio.h>
My main program running 8 tasks using Task.Factory.StartNew Each task will request XML format
Our main program is in java but the code that extracts our data from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.