C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 16th, 2003, 10:38 AM
Ctb's Avatar
Ctb Ctb is offline
An Ominous Coward
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jan 2002
Posts: 4,425 Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 10 h
Reputation Power: 0
DBD:Pg, PostgreSQL Source, nmake

This is an ongoing problem that I'd love to solve. I keep creeping closer to a final solution, but I'd really llike to get there... like... NOW.

I'm trying to build the DBD::Pg module for Perl to interface to PostgreSQL. I've got cygwin, cygipc and postgres installed and running just peachy (aside from the fact that I mistakenly removed, with force, the entire /usr/local/bin directory in cygwin... oopsy). However, I'm at the end of my rope trying to build DBD::Pg with Visual Studio 6. Here's the latest transcript:
Code:
c:/postgres_dir_here/src>nmake /f win32.mak
        cd include
        if not exist pg_config.h copy pg_config.h.win32 pg_config.h
        1 file(s) copied.
        cd ..
        cd interfaces\libpq
        nmake /f win32.mak

Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

Building the Win32 static library...

        if not exist ".\Release/" mkdir ".\Release"
        cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\nma02456.
dllist.c
        cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\nmb02456.
md5.c
        cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\nmc02456.
wchar.c
        cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\nmd02456.
encnames.c
        cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\nme02456.
win32.c
fe-auth.c
fe-connect.c
fe-connect.c(805) : error C2143: syntax error : missing ';' before 'type'
fe-connect.c(850) : error C2065: 'family' : undeclared identifier
fe-connect.c(885) : error C2065: 'portno' : undeclared identifier
fe-exec.c
fe-lobj.c
fe-misc.c
fe-print.c
fe-secure.c
pqexpbuffer.c
NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\bin\N
MAKE.EXE"' : return code '0x2'
Stop.

I have no clue which file it failed on, what the return code is for, or anything else (I HATE nmake with a passion for this very reason). All I know is that U1077 is a generic "the program failed at something, check the return code" error. I can't find any info for the code 0x2.

At this point, I have a bunch of object files built, but they need to get built to the .lib library. So close... yet so far.

Any help or suggestions greatly appreciated, as always!

[edit]
Here's something that might be of interest. It cds down to a different makefile farther down the directory structure. I ran nmake with the /N option on that makefile and here's the output of commands it runs. I don't know what i'm looking at here really, but maybe someone else will:
Code:
Building the Win32 static library...

        cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\nma02316
        link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\n
        cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\nmc02316
        rc.exe /l 0x409 /fo".\Release\libpq.res" libpq.r
        link.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\nmd023
        del C:\DOCUME~1\Owner\LOCALS~1\Temp\nma02316.
        del C:\DOCUME~1\Owner\LOCALS~1\Temp\nmb02316.
        del C:\DOCUME~1\Owner\LOCALS~1\Temp\nmc02316.
        del C:\DOCUME~1\Owner\LOCALS~1\Temp\nmd02316.

I imagine it is failing on one of those two cl.exe calls, but I can't be sure. ATM I'm trying to figure out how to get some echos to execute from the makefile at different steps to see if I can weed out a culprit here (unfortunately, I don't know makefiles ).
[/edit]

[edit2]
Alright, here's the code chunk in fe-connect.c that's throwing errors. It also appears that the fe-connect.obj file isn't getting built, so maybe that's where cl is bombing out:
Code:
#ifdef WIN32
        static int WeHaveCalledWSAStartup;
        if(!WeHaveCalledWSAStartup) {
//                WSADATA wsaData;
//                if(WSAStartup(MAKEWORD(1, 1), &wsaData)) {
//                        printfPQExpBuffer(&conn->errorMessage, "WSAStartup failed: errno=%d\n", h_errno);
//                        goto connect_errReturn;
 //               }
 //               WeHaveCalledWSAStartup = 1;
        }
#endif

Commenting out that inner if(!WeHaveCalledWSAStartup) block allows me to compile fe-connect.c without errors. Uncomment that if() block, however (and leave the meat inside of it commented) and it throws the error:
Code:
syntax error : missing ';' before 'type'

on that line. That error then cascades to an int declaration a few lines later (i.e. it can't declare the ints because apparently there's an unterminated line or something...

Last edited by Ctb : May 16th, 2003 at 11:30 AM.

Reply With Quote
  #2  
Old May 16th, 2003, 02:37 PM
Ctb's Avatar
Ctb Ctb is offline
An Ominous Coward
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jan 2002
Posts: 4,425 Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 10 h
Reputation Power: 0
Unhappy Not quite...

Following up on my morning adventures:

I commented out the entire offending #ifdef ... #endif block and libpq compiled flawlessly. After wrangling with DBD::Pg for awhile, I managed to get everything built and installed with warnings (closer...). I can 'use DBD::Pg' in my scripts, but when I try to call the DBI->connect() method, I get:
Code:
DBI->connect(dbname=names) failed: Could not create socket: WSAStartup not yet called (0x0000276D/10093) at test.pl line 8

Which apparently leads me back to the b0rked code chunk I commented out....

Reply With Quote
  #3  
Old May 16th, 2003, 07:42 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,589 Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 23 h 19 m 21 sec
Reputation Power: 1001
Just a random shot in the dark, but can uncomment all the code and try putting this line
#include <winsock2.h>
in fe-connect.c, under all the other #includes, and see what happens.

Reply With Quote
  #4  
Old May 16th, 2003, 11:03 PM
Ctb's Avatar
Ctb Ctb is offline
An Ominous Coward
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jan 2002
Posts: 4,425 Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 10 h
Reputation Power: 0
Thanks for the tip scorp, but that include directive addition throws 61 errors and 11 warnings out at compile time (including the 3 that I originally was getting) regarding the header file.

I don't understand what that message is trying to tell me. Through selective commenting / deletions I eventually got it to this point where it would compile ok:
Code:
#ifdef WIN32

                WSADATA wsaData;
                //WSAStartup(MAKEWORD(1, 1), &wsaData);

#endif

All it did was throw a warning about that lil lonely wsaData sitting there not doing anything. Uncomment that other line though and you get the weird "syntax error : missing ';' before 'type'" error. This is an XP machine using VC++6, and everyone else who used this code chunk used NT with VC++5/6. Could there be a significant difference in the WSAStartup() call between NT and XP that's blowing this up?

Reply With Quote
  #5  
Old May 17th, 2003, 12:34 AM
dwise1_aol's Avatar
dwise1_aol dwise1_aol is offline
Contributing User
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 3,868 dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 3 h 14 m 44 sec
Reputation Power: 480
Is it possible that XP is uppity and thinks that version 1.1 of Winsock is beneath it? See what happens when you ask for 2.0:
Code:
WSAStartup(MAKEWORD(2, 0), &wsaData);

I always request 2.0, but that's just because the example I based my first programs on did. I have no idea what the effect would be of requesting a lower number. Unless the functions you're using require higher than 1.1.

You might also want to test the return value of WSAStartup(). It should be zero if successful. Otherwise, it will return a WSA error code.

Reply With Quote
  #6  
Old May 17th, 2003, 10:51 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,589 Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 23 h 19 m 21 sec
Reputation Power: 1001
The code looks just fine as is. The only thing I can think of is maybe the MAKEWORD macro has some comments or something that throws your compiler off?

What if you did this:
Code:
WSADATA wsaData;
WORD wVerRequested = MAKEWORD(1,1);
WSAStartup(wVerRequested, &wsaData);

Reply With Quote
  #7  
Old May 17th, 2003, 02:01 PM
Ctb's Avatar
Ctb Ctb is offline
An Ominous Coward
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jan 2002
Posts: 4,425 Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 10 h
Reputation Power: 0
Nope, thanks for the suggestions though. I tried both, and both caused the same missing token before type error. Commenting this:
Quote:
WSAStartup(wVerRequested, &wsaData);

from Scorpions' suggestion causes the error to go away (and just throws a warning about the unused wsaData instead).

When I installed this version of Visual Studio, there was something wrong with the installation. It erred out of some step, but at the time it was working on VB6 and it didn't halt the installation process. At the time, I suspected that my documentation had just been fragged by the error because I can't get any of the Help dialogs to work. Is it possible that my installation is damaged and I can't call WSAStartup() for some reason?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > DBD:Pg, PostgreSQL Source, nmake


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT