473,473 Members | 1,782 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 help me out , what the correct cl command is ?

Oct 15 '07 #1
3 2203
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 help 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
Oct 15 '07 #2
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

Oct 15 '07 #3
On 10 15 , 3 43 , ravinder thakur <ravindertha...@gmail.comwrote:
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!

Oct 24 '07 #4

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

Similar topics

4
by: jesper | last post by:
Hi I am currently following the tutorial from IBM (http://www-106.ibm.com/developerworks/xml/edu/x-dw-xjaxb-i.html) I have three problems at the moment. 1. It says else where that when the...
8
by: Sowen | last post by:
Hi, I have an object "elem", there are only simple functions inside, like setName, getName, and three constructors Now I have another class "Base", need an array of elem to initialize class...
5
by: Carmine Cairo | last post by:
Hi, I'm working on a project and today I've note a little problem during the compile fase. Here a little piece of code: // 1st version welldone = 0; size = p->getSize(); backbone = new...
2
by: AlexS | last post by:
Hello, I have error when reading schema using XmlSchema. Read and then .Compile: System.Xml.Schema.XmlSchemaException: May not be nominated as the {substitution group affiliation} of any...
12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
8
by: Michael L. Hostbaek | last post by:
Hi, I am trying to compile a piece of software, on a FreeBSD system. gcc version 2.95.4 When compiling, I get lots of these warnings: --- logger.c: In function `cf_logger_init':
9
by: ludocluba | last post by:
Hello, here is my problem: I have 3 files: main.c toto.c toto.h: ----------------------------------------------------------- toto.h: #ifndef _toto_h #define _toto_h int var; void test(void);...
15
by: Ken Allen | last post by:
I have been developing a suite of assemblies over the past couple of weeks, and this afternoon somethign started misbehaving. If I do not run the IDE and compiler the code from the command line,...
1
by: tony | last post by:
Hello! I access the class MyComparer in this way. steel_post.Sort(new MeltPracDataComposition.Composition.MyComparer()); You can see the class definition for MyComparer below. As you can see...
1
by: wizmagister | last post by:
Hi everyone, I've just installed VisualStudio 2008 on my dev PC. I use this PC to compile a program that uses MapPointControl.ocx. I've compile a new version of my program using VS 2005 after...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.