|
Thanks for replying. I know this fact. But my problem is of some different sort. Let me more precise on the matter.
I am X.264 library for my project. This library has been generated using Msys and MinGW. I have included libx264.a in Additinal Dependencies tab. If i compile the included X.264 using C compile code in Linker/C-C++/Advanced/Compile As in project property page, then it is being compiled successfully, But if i compile as C++ then it gives me error. So what should i do? may i need to do any configuration changes for that under VS 2005?
Thanks & Regards,
Hemang
|
|
|
|
|
What are the error messages?
Maxwell Chen
|
|
|
|
|
error LNK2019: unresolved external symbol "struct x264_t * __cdecl x264_encoder_open(struct x264_param_t *)
|
|
|
|
|
Hemang Raval wrote: error LNK2019: unresolved external symbol "struct x264_t * __cdecl x264_encoder_open(struct x264_param_t *)
Because I don't have your source to view the whole relationship, I could only guess.
Check the includes and / or prototypes for:
extern "C" {
#include "some_header"
};
extern "C" {
x264_t* x264_encoder_open(x264_param_t*);
}
Maxwell Chen
|
|
|
|
|
Ok thats same as my problem.
Now i am posting my code
I am having two projects in one solution: one is Test1 and another one is Test2
Test1 having two files Test1.h and Test1.c
Test1.h
void testFunc();
Test1.c
<br />
#include "Test1.h"<br />
void testFunc()<br />
{<br />
printf("In Function testFunc()");<br />
}<br />
Now Test2 Having Two Files Test2.h and Test2.cpp
Test2.h
<br />
class Test2<br />
{<br />
Test2();<br />
}<br />
Test2.cpp
<br />
#include "Test2.h"<br />
#include "Test1.h"<br />
<br />
Test2::Test2()<br />
{<br />
testFunc();<br />
}<br />
Now i am compiling Test1 by c Compiler and Test2 by c++ compiler in "VS2005"
so it is giving me linking error as below:
error LNK2019: unresolved external symbol _testFunc referenced in function "public: __thiscall Test2::Test2(void)" (??0Test2@@QAE@XZ)
So do you have any idea regarding this??
Please Give me any idea, i am stuck on it.
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
I just created two project:
1. C:\Tmp\Test1, in C,
2. C:\Tmp\Test2, in C++.
Test2 uses Test1 functions.
Steps:
1. Compile Test1 without worrying about Test2 at all.
2. Write this way in "Test2.cpp" :
#include "test2.h"
extern "C" {
#include "../test1/test1.h"
}
3. Remember to add (to import, not file copy) "C:\Tmp\Test1\test1.c" and "C:\Tmp\Test1\test1.h" into your "test2" project.
And everything compiles happily!
Maxwell Chen
|
|
|
|
|
Thanks
Its working fine.!!!!
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
Maxwell Chen
|
|
|
|
|
Hello everyone,
On Windows Server 2003, task manager there is a term called PF (Page File) and it has a related curve. Task manager also has another term called commit charge.
1. I think PF is the same as commit charge. Previously, I think Page File only includes the paged-out pages which physical memory can not contain, and the pages are not in memory are counted as PF. Now I think I am wrong and PF includes all committed pages, including the ones in memory and the ones on disk;
2. Even if the pages are marked as COMMIT, it is not always counted as a part of PF in some situations before it is actually used (request for zero and copy-on-write scenarios);
Are my understandings of (1) and (2) correct?
thanks in advance,
George
|
|
|
|
|
Hello everyone,
It is correct to assume that all exceptions from STL are either std::exception itself or derived class from std::exception?
thanks in advance,
George
|
|
|
|
|
|
Thanks Stephen,
My question is answered.
regards,
George
|
|
|
|
|
dear all
how to solve this problem: i initialize xx[10][3][4] = (double)rand()/RAND_MAX; in main function,
and define this function, when i call this function, why it has problem?
void Centroids::createPosition(double x[10][3][4])
{
cout <<endl<<The following is positions of 10 particles ! "<<endl<<endl;
for (int i = 0; i < 10; i++)
{
cout <<endl<<" "<<"Position of particle :"<<endl;
for (int j = 0; j< 3; j++)
{
for (int k = 0; k < 4; k++)
cout<< " "<<x[i][j][0]<<" "<<x[i][j][1]<<" "<<x[i][j][2]<<" "<<x[i][j][3]<<endl;
}
}
}
coulndn't display correctly..thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
li zhiyuan wrote: for (int k = 0; k < 4; k++)
cout<< " "<<x[i][j][0]<<" "<<x[i][j][1]<<" "<<x[i][j][2]<<" "<<x[i][j][3]<<endl;
You are using k to iterate, but there is no k in the [] .
Maxwell Chen
|
|
|
|
|
Hi, I'm currently learning MFC, and I have a question about serialization.
If I have an application, and I use it to serialize a file, can I use a second application to open the same file (of course, both applications having the same attributes in their documents)? Every time I try to call the Serialize method of a CTypedPtrList with the corresponding CArchive I get an "Unexpected File Format" error. Both applications are using the same DLLs, which contain the polymorphic classes being used in the list. I am using Visual Studio 2008.
Thanks.
|
|
|
|
|
Perrin01 wrote: If I have an application, and I use it to serialize a file, can I use a second application to open the same file (of course, both applications having the same attributes in their documents)?
AFAIK, yes
[added]
I made a little test: it confims you can do it.
[/added]
Perrin01 wrote: Every time I try to call the Serialize method of a CTypedPtrList with the corresponding CArchive I get an "Unexpected File Format" error. Both applications are using the same DLLs, which contain the polymorphic classes being used in the list. I am using Visual Studio 2008.
I think you have to proceed with little steps, for instance.
(1) Make sure that both applications use the same version number inside IMPLEMENT_SERIAL macro.
(2) Make sure the application that created file is able itself to load it.
(3) Try to store and load very simple files first.
(4) ...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
modified on Wednesday, January 30, 2008 4:24:19 AM
|
|
|
|
|
CTypedPtrList is serializable?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Sure! But the pointers in it are another story...
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I have doubt
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well, everything is serializable (Uhm, I've a little doubt about democracy...), with just a bit effort into.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I have a case where a file path reported by ReadDirectoryChangesW is different from the correct path...
The case is a file server -- where a mac file system is hosted on an ntfs volume. The mac file system seems to have some extra stuff.
When I access the files locally (from the file server), I run into some problems:
Here's a very long filename reported from the system file change via ReadDirectoryChangesW()
C:\dev\macbug1\.BAHC3Kq7\This is the Mac folder\In this folder I will store some mac image files\this is just a folder with a long filename - In this folder I will store some mac image files\another In this folder I will store some mac image files\This folder contains some pictures of the new cooooooool macboc air\overview_bigair_one20080115.png
This very long path contains a folder which doesn't seem to actually be there... .BAHC3Kq7\
If I use FindFirstFile I can correctly find the files and folders as they seem to be there.
But this contradicting path from the changes API is causing me problems.
Any thoughts out there?
Are there any good references on the insides of how a mac file system is stored on NTFS?
Thanks in advance -- this is such an esoteric question, I won't hold my breath waiting for an answer.
But it's always good to ask!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Remote change notifications are not reliable on remote filesystems, especially when the remote filesystem is hosted on a non-Windows platform. The path is also longer than _MAX_PATH , so you would not be able to access the path using the normal (ANSI) APIs - you would have to use the Unicode version of the APIs.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I don't have an issue with MAX_PATH, I am using unicode API's with the funky \\?\ prefix. (everyone should use unicode!)
The filesystem isn't remote though. My software is running locally on the same machine where the file system is stored. It's just that the folder structure is created by a mac which is connected to my machine remotely. But, to my software, the file system is local.
If I scan the folders using FindFirstFile I don't get the artifact. The file paths coming back from ReadDirectoryChangesW include it.
I cannot use any sort of GetShortFileName(), GetLongFileName() function -- because in the case of a "delete file" notification, these functions don't work. I need a more systemic answer -- one which operates on the path not on the file -- to deal with this.
I guess, I am going to have to implement a periodic scan to make sure that I have accurate information. But mostly, I am trying to figure out what that mysterious artifact is, in the path that I get back from ReadDirectoryChangesW().
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Hi all,
could you give me a little hint how to get a name of process which opened file?
example:
I have a file C:\temp\test.txt - I need to know which process opened this file.
Thanks.
|
|
|
|
|