Afficher un message
Vieux 15/10/2007, 07h06   #1
marsarden
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut problem when compile with g++ and cl

when i compile a cpp file using microsoft cl (version 13.10.3077) ,
error occurs:

singleton.h : fatal error LNK1106: invalid file or disk full: cannot
seek to 0x6D75

the command line is : cl test.cpp singleton.h -o test.exe

but ,when i using g++ on linux system , it's ok. the command line is :

g++ test.cpp singleton.h -o test

the file :

//test.cpp
#include "singleton.h"

int main(void)
{
Singleton s;
s.instance()->fun();
s.instance()->fun();
return 0;
}

//singleton.h
#include <iostream>
using namespace std;
class Singleton
{
public:
Singleton()
{
}
static Singleton* instance()
{
static Singleton* instance_;
if(!instance_)
instance_=new Singleton();
return instance_;
}
void fun(){cout<<"instance call"<<endl;}
};

any one who me out , what the correct cl command is ?

  Réponse avec citation
 
Page generated in 0,05576 seconds with 9 queries