Hello all, I got the following makefile for the GD Library (http://www.fred.net/brv/chart/gdchart0.94b.tar.gz[^] : GDC_INCL = . GD_INCL = gd1.3 GD_LIB = gd1.3 CC=gcc all: gdc_samp1 gdc_samp2 gdc_pie_samp # compile the samples gdc_samp1: gdc.o gdchart.o price_conv.o gdc_samp1.o $(GD_LIB)/libgd.a $(CC) -o gdc_samp1 gdc.o gdchart.o price_conv.o gdc_samp1.o -L$(GD_LIB) -lgd -lm gdc_samp1.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdc_samp1.c $(CC) -I$(GDC_INCL) -c gdc_samp1.c gdc_samp2: gdc.o gdchart.o price_conv.o gdc_samp2.o $(GD_LIB)/libgd.a $(CC) -o gdc_samp2 gdc.o gdchart.o price_conv.o gdc_samp2.o -L$(GD_LIB) -lgd -lm gdc_samp2.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdc_samp2.c $(CC) -I$(GDC_INCL) -c gdc_samp2.c gdc_pie_samp: gdc.o gdc_pie.o price_conv.o gdc_pie_samp.o $(GD_LIB)/libgd.a $(CC) -o gdc_pie_samp gdc.o gdc_pie.o price_conv.o gdc_pie_samp.o -L$(GD_LIB) -lgd -lm gdc_pie_samp.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdcpie.h gdc_pie_samp.c $(CC) -I$(GDC_INCL) -c gdc_pie_samp.c # --- compile the lib --- price_conv.o: price_conv.c $(CC) -c price_conv.c gdc.o: gdc.c gdc.h $(CC) -I$(GD_INCL) -I$(GDC_INCL) -c gdc.c gdc_pie.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdcpie.h gdc_pie.c $(CC) -I$(GD_INCL) -I$(GDC_INCL) -c gdc_pie.c gdchart.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdchart.c $(CC) -I$(GD_INCL) -I$(GDC_INCL) -c gdchart.c $(GD_LIB)/libgd.a: cd $(GD_LIB) ; make -f Makefile libgd.a # --- clean --- clean: rm -f *.o gdc_samp1 gdc_samp2 gdc_pie_samp cd $(GD_LIB) ; make -f Makefile clean My problem is : 1. How did the make file compile and link the gdc_samp1.c file ? Really appreciated if anyone could have some answers ...I am a BIG NOOB in linkers... Thanks, Leslie
leslie wu
Posts
-
Some help on interpreting this makefile for linux... -
String to char* in DLLDear All, You have be soo helpful !! I let you know which one is working as soon as get back from home !!! Regards, Leslie
-
String to char* in DLLDear All, I have a DLL with method signature like this : void printname (char* name) I tried using the following code to to make use of my method: ----------------------- string s="abc.xml"; char[] b = new char[100]; s.CopyTo(0,b,0,20); unsafe { fixed (char* p=b); printname(p); } ------------------------ but it seems not working.... can anyone give me some hints ?? Thanks, Leslie
-
Problem: How to include DLL when I compiled my windows mobile project?Got it ...you need to use Window CE Remote File Viewer to look at the path.. Everything sorted..thanks everyone !!!
-
Problem: How to include DLL when I compiled my windows mobile project?To be precise, I got the following error: An unhandled exception of type 'System.MissingMethodException' occurred in DeviceApplication2.exe Additional information: Can't find PInvoke DLL 'smartdevicedll.dll'.
-
Problem: How to include DLL when I compiled my windows mobile project?Hi Tony, Thank you for your reply. What I mean by that is if I drag my compiled DLL from windows explorer directly into the the solution explorer space, I can see the DLL copied into the project. However, if I try adding by clicking: my project -->"add reference" and add my DLL,it says " A reference to mydll could not be added. What is the problem with it ? What should be the proper way in adding my DLL ? And to my second problem concerning my dll function is not working properly, any clue ? Thanks, Leslie
-
Problem: How to include DLL when I compiled my windows mobile project?Hello all, I have created a DLL (smart device -> win32 application -> DLL) in Visual Studio 2005 and it can be compiled successfully using the Windows Mobile 6 SDK. I try going to test my DLL by creating a new project (c#->device application -> wm6 application) and add the DLL to it. I tried dragging the DLL into application it works, but it doesnt work when I tried to add reference to it However, whenever I try building the project on simulator, it says it cannot find the DLL. Funny enough, when I directly put the application exe and the dll to my device, it works. But I observe that my DLL library is not performing what it should be. What is the problem with it ? Assistance of any forms will be highly appreciated. Thanks, Leslie
-
About creating Smart Device DLL using Libxml2Being a Noob, I just want to ask 2 more questions: 1.I have download all the header and the C files associated with the library. If I ever want to build a DLL, I only need to call the header ? (e.g. I call xmlmemory.h for the "parseDoc" function ??) Do I have to compiled all the C files and the header into a static library first ? 2. When I did iphone development, I notice that there is already a compiled .lib files in the path /usr/bin/lib (if i remember the path correctly =P ). Could I copy the .lib file ? I notice that iphone and windows mobile both use the ARMV4 processor...so the architecture should bethe same ? Thanks, Leslie
-
About creating Smart Device DLL using Libxml2Hi Stuart, Thank you for your answer first. I know you must be wondering why we don't use the integrated XML, but it is my supervisor request (OMG ~). We are trying to build a common engine that is written in plain C and is fully operational in iphone and windows mobile environment. Do you have any idea if there is any avaliable library avaliable ? If so, very appreicated if you could just post the link ! Thanks, Leslie
-
About creating Smart Device DLL using Libxml2Hello all, I am currently doing my FYP. I download a set of header files of libxml2 with .h files and .lib files. I first try to create a windows 32 application console application and it works fine (to ensure i link it properly) I then head off and try to create a DLLs for the smart device, however, i return with the following errors: Linking... 1> Creating library Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.lib and object Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.exp 1>TESTTESTTEST.obj : error LNK2019: unresolved external symbol xmlParseFile referenced in function ExportedFunction 1>Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.dll : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:\Documents and Settings\wu\My Documents\Visual Studio 2005\Projects\TESTTESTTEST\TESTTESTTEST\Windows Mobile 6 Professional SDK (ARMV4I)\Debug\BuildLog.htm" 1>TESTTESTTEST - 2 error(s), 1 warning(s) I created my DLL like this: #include "resourceppc.h" #include "stdio.h" #include "string.h" #include "stdlib.h" #include "xmlmemory.h" #include "parser.h" extern "C" void EXPORT ExportedFunction(){ char * docname = "abc"; xmlDocPtr doc; xmlNodePtr cur; doc = xmlParseFile(docname); } Being noob, i just want to know: 1. It is possible to create a DLL using .lib files ? 2. Is my linking wrong ? Any help of somekind will be greatly appreciated ! Thanks, Leslie
-
IOException 10054.Hi Mbah, I finally got it working. However, I notice that I am reading nothing at all. When I call client.ReadBufferSize, it returned 0 in windows mobile but 8167 in windows (which 8167 is the datasize I set for server sending information to this program). Any suggestions ?
-
IOException 10054.Hi Mbah, I am still getting an error after inserting your line. Any more suggestions ? Thanks !
-
IOException 10054.Hello all, I am currently developing a application on windows mobile that can receive video image from webcam via a desktop. Here is my code: namespace ABC { public partial class Form1 : Form { // private System.Net.IPHostEntry ips = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); //---port nos and server IP address--- const Int32 PORTNO = 500; string server_IP = "10.0.1.200"; //---size of the video image--- const int SIZEOFIMAGE = 341504; //---use for connecting to the server--- TcpClient client; //--used for sending and receiving data--- byte[] data; //---used for receiving images from the server--- System.Threading.Thread t; private void ReceiveImageLoop() { //---keep on receiving image until an error occurs--- while (ReceiveImage()) { MessageBox.Show("in receive image"); } //---display error message--- MessageBox.Show("Server has stopped responding. Please try restarting the video."); } //---Sends a message to the server--- private void SendMessage(string message) { //---adds a carriage return char--- message += "\n"; try { //---send the text System.Net.Sockets.NetworkStream ns = null; lock (client.GetStream()) { ns = client.GetStream(); byte[] bytesToSend = System.Text.Encoding.ASCII.GetBytes(message); //---sends the text--- ns.Write(bytesToSend, 0, bytesToSend.Length); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } //---receive video image from server--- public bool ReceiveImage() { MemoryStream s = new MemoryStream(); NetworkStream nws = client.GetStream(); int counter = 0; int totalBytes = 0; do { MessageBox.Show("trying to read data..."); //---read the incoming data--- int bytesRead = nws.Read(data, 0, client.ReceiveBufferSize); totalBytes += bytesRead; //---write the byte() array in
-
TcpClient for Windows Mobile 6Hi Leppie, The IP address I specified for this fuction was 127.0.0.1. I specifed this IP address since I want the simulator to connect back to my own computer PC (which it contains a program that relays webcam images back to the simulator). I checked the connection for the simulator it seems it is not on the internet. How could I resolve the problem ? Second, sinec this program will be running on a HSDPA phone, will specifying Tcpclient is not enough ? I Googled some code and it requires some other C# class to enable the GPRS function : http://blogs.msdn.com/anthonywong/archive/2006/03/13/550686.aspx[^] Thanks for your help leppie.
-
TcpClient for Windows Mobile 6Hi leppie, Thank you again for your assistance. The following is the exception details I got: System.Net.Sockets.SocketException was unhandled Message="An error message cannot be displayed because an optional resource assembly containing it cannot be found" ErrorCode=10061 NativeErrorCode=10061 StackTrace: at System.Net.Sockets.Socket.ConnectNoCheck() at System.Net.Sockets.Socket.Connect() at System.Net.Sockets.TcpClient.Connect() at System.Net.Sockets.TcpClient.Connect() at FYP.Form1.button1_Click() at System.Windows.Forms.Control.OnClick() at System.Windows.Forms.Button.OnClick() at System.Windows.Forms.ButtonBase.WnProc() at System.Windows.Forms.Control._InternalWnProc() at Microsoft.AGL.Forms.EVL.EnterMainLoop() at System.Windows.Forms.Application.Run() at FYP.Program.Main()
-
TcpClient for Windows Mobile 6Actually my program didn't stop, it just doesn't work. When I press the button to start the TCP connection, it just shows nothing. Should I paste all the code for your reference ?
-
TcpClient for Windows Mobile 6Hi Leppie, Just wonder what do you mean by final excpetion. Sorry I am a newbie to C#. Please further help by providing me some guidance to get to the final excpetion. Once again, thank you for your help ! --Leslie
-
TcpClient for Windows Mobile 6Hello all experts, I am currenting doing my final year project about Windows mobile devices. I have the following code: if (((Button)sender).Text == "Start") { try { //---connect to the server--- client = new TcpClient(); client.Connect(server_IP, PORTNO); data = new byte[client.ReceiveBufferSize]; //---send message--- SendMessage("Send"); //---begin reading data asynchronously from the server--- t = new System.Threading.Thread(ReceiveImageLoop); t.Start(); MessageBox.Show("threat created"); } catch (Exception ex) { Console.WriteLine(ex.ToString()); MessageBox.Show("error !"); } } If I compile this code using Windows XP SP2, it is working fine. However, as I paste the code onto WM6, I got the following error message : " A first chance exception of type 'System.IO.IOException' occurred in mscorlib.dll A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll " I see that my windows mobile device could not initiate a TCP connection. Could anyone give me some hints ? Wholeheartly thanks !