|
I am sorry, I ignored the DLU used in rc files. Thanks to Mark Salsbery.
- NS -
|
|
|
|
|
Hi,
I have to create a static library of a whole source code which contains ".c",
".cpp" files. I am using Microsoft Visual Studio 6.0, but i have the following error message which i am unable to solve.
The following is the problem,
fatal error C1853: 'Debug/<filename>.pch' is not a precompiled header file created with this compiler Error executing cl.exe.
I am inserting a ".c" file into my project which also needs to include "stdafx.h" but this header is not compatible with the C complier but this "stdafx" is an essential header for a VC++ project.
Please do help me on this issue of how to use the "stdafx.h" for a ".c" file.
Please note that I have also tried setting the "not using pre-complier header" Option in the Project->settings->C/C++ tab for every ".c" file I am using.
The following is the error i receive,
error C2146: syntax error : missing ';......
fatal error C1004: unexpected end of file found.
Advance thanks.
With regards,
Arul Prakash
Arul prakash
|
|
|
|
|
Whats the problem in renaming all the c files to cpp?
|
|
|
|
|
.C and .CPP files are treated differently by the compiler. (Or so I think).
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
prakashd wrote: fatal error C1853: 'Debug/.pch' is not a precompiled header file created with this compiler Error executing cl.exe.
I am inserting a ".c" file into my project which also needs to include "stdafx.h"
No! Dont do that!
Instead, switch your C-files individually to "Not using precompiled headers".
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Hi jhwurmbach,
Thanks, It's working yar... I have created the standard library. Now i have to implement in the console application. I have import standard library in to console application. Finally i got two error. Can u please give me some solution's.
main.obj : error LNK2001: unresolved external symbol "public: int __thiscall IperfMain::executeIperf(int,char * * const)" (?executeIperf@IperfMain@@QAEHHQAPAD@Z)
Debug/PorduceEXE2.exe : fatal error LNK1120: 1 unresolved externals
This are all the two errors i got.
Advance thanks.
Arul prakash
|
|
|
|
|
It seem as if the lib containing IperfMain::executeIperf does not get linked.
Check your linker settings.
Maybe you need to follow Karls advice and add "extern C " to the header/around the header inclusion.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Hi jhwurmbach,
It's working fine. But i got link error called
error LNK2001: unresolved external symbol _getaddrinfo@16
Debug/pro.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Note: I have included
#include"ws2tcpip.h"
and I have linked Ws2_32.lib.
please note i'm using MSVC 6.
please tell how to use getaddrinfo()
in VS 6. Thanks Mr.jhwurmbach
Arul prakash
|
|
|
|
|
|
* The xmlparser XmlLite from microsoft uses IStream to read and write xml.
It is described how to copy text into a stream, but not how to read the text back from the stream. Do you know how to do this?
Code to write text to IStream.
IStream * pStream = NULL;
HGLOBAL hXmlContent;
HRESULT hr;
int iResult = 0;
// allocate global memory to copy the HTML content to
hXmlContent = ::GlobalAlloc( GPTR, ( ::_tcslen( kpszXML_in ) + 1 ) * sizeof(TCHAR) );
if (!hXmlContent)
return false;
::_tcscpy( (TCHAR *) hXmlContent, kpszXML_in );
// create a stream object based on the HTML content
hr = ::CreateStreamOnHGlobal( hXmlContent, TRUE, &pStream );
|
|
|
|
|
|
Thank you for the link.
I also found another way to do this.
LARGE_INTEGER pos;<br />
pos.QuadPart = 0;<br />
pOutStream->Seek((LARGE_INTEGER)pos, STREAM_SEEK_SET, NULL);<br />
<br />
char pszXml[4095];
ULONG cb=4095;<br />
ULONG cbRead=0;<br />
CString strXmlFromIStream;<br />
do <br />
{<br />
memset(pszXml,0,4095);<br />
hr = pOutStream->Read(pszXml, cb, &cbRead);<br />
strXmlFromIStream += pszXml;<br />
} while(cbRead!=0);
|
|
|
|
|
Hello everyone,
I am looking for some tutorials about how to use OLE Viewer. But I can not find any detailed tutorials. Any reference?
thanks in advance,
George
|
|
|
|
|
In which forum should I submit C questions???????
|
|
|
|
|
Just ask here!
Maxwell Chen
|
|
|
|
|
This is the forum...
- NS -
|
|
|
|
|
If you like to ask on the codeproject this forum is good choice.;)
|
|
|
|
|
Thanks and sorry for the late reply,
my ques is like that:
i have a struct built for ADT in a source file, and it compiles successfully.
the problem is that when i try to use it in the designated program, It doesn't recognize all of the members of the struct.
here is the relevant code:
this is the struct source file:
typedef struct data
{
char** colName;
const struct element_interface** ifc;
Element* temp_row;
}data;
typedef struct table_rec
{
char TabInitFlag;
int iterator;
data* localData;
char** last_found_array;
Matrix tableArray;
int tableWidth;
int last_found;
}table_rec;
header file:
typedef struct table_rec *Table;
application try to use:
Result rdb_del_customer(RestaurantDB rdb,const char* name)
{
Element passName[1];
int *count;
passName[0] = string_to_element(name);
count = (int*)malloc(sizeof(int));
tab_delete_rows(rdb->customers , rdb->customers->localData->colName , passName , 1 , count);
if(*count == 0)
return RES_NO_MATCH;
else
return RES_NO_ERROR;
}
it doesn't recognize the rdb->customer as a Table, pointer to table_rec Struct
Error message:
error C2037: left of 'localData' specifies undefined struct/union 'table_rec' c:\documents and settings\dan\my documents\visual studio 2005\projects\mtm_rst\mtm_rst\restaurantdb.c 61
and of course I want to use code project to ask my questions, it's my guide in
every step on my way to become a programmer excellent.
|
|
|
|
|
Put your structure in the header file instead of the source file.
|
|
|
|
|
I am not allowed to do this, this is what ADT programming is all about.
I must hide my implementation from the user(in this case me ),
so I only pass to the user the header interface to my ADT, and the object file,
he uses that to create he's own program using my module.
it's a school assignment :->
|
|
|
|
|
gizmokaka wrote: I must hide my implementation from the user(in this case me ),
Which implementation ? I just see a structure with data in it, no functions at all. How can somebody manipulate an 'object' without knowing what's inside.
How could you know that the structure contains a localData member if it is hidden ?
Hide implementation means that you put your function definitions in a cpp file and only 'show' (through a header file) the function prototypes.
|
|
|
|
|
true, and that's what I do,
only I am not allowed to reveal the members of the struct because
then the user of the ADT can change their type or value directly
which can hurt the functionality and integrity of the ADT.
|
|
|
|
|
The error message tells clearly what is the error:
gizmokaka wrote: rdb->customers->localData->colName
at this line the structs are unknown.
You have to include the struct declarations before, so, as is telling Cedric, you canto put they in the header file.
Or, if you want to hide that structs to the user, you have to put ALL the code that use they in the SAME file, above the declaration of that structs.
Elseway the compiler can't know that table_rec and data exists.
Russell
|
|
|
|
|
Maybe I am missing something here but
the ADT is a module of it's own, and is separated from the application using it.
I can't put the struct in the user application, only the header and link to the
ADT object file.
and yes I do want to hide the structs to the user.
Again, how do you suggest I do that???
I think I didn't understand the last time
|
|
|
|
|
gizmokaka wrote: and yes I do want to hide the structs to the user.
You can not hide to the user what is part of the public interface the user is programming against.
But maybe a forward declaration can solve your problem? Just as to tell the compiler "There is a data-type named 'local_data', and you will know it when you need to".
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|