PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.cplus > problem when compile with g++ and cl
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
problem when compile with g++ and cl

Réponse
 
LinkBack Outils de la discussion
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
Vieux 15/10/2007, 08h35   #2
Michael DOUBEZ
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: problem when compile with g++ and cl

marsarden a ¨¦crit :
> 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


I guess cl is more fashion than gcc.
Singleton hunt is open !

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

Search 'compiling a C++ program' on:
http://msdn2.microsoft.com/

This is a c++ group not an ms one.

Michael
  Réponse avec citation
Vieux 15/10/2007, 08h43   #3
ravinder thakur
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: problem when compile with g++ and cl

if this wasn't obvious this is not a c++ question per se... but
anyways here is the official discussion and resoluiton for the issue
http://support.microsoft.com/kb/834332

  Réponse avec citation
Vieux 24/10/2007, 09h06   #4
marsarden
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: problem when compile with g++ and cl

On 10 15 , 3 43 , ravinder thakur <ravindertha...@gmail.com> wrote:
> if this wasn't obvious this is not a c++ question per se... but
> anyways here is the official discussion and resoluiton for the issuehttp://support.microsoft.com/kb/834332


thks alot!

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h40.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07924 seconds with 12 queries